summaryrefslogtreecommitdiffstats
path: root/src/dstring.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dstring.h')
-rw-r--r--src/dstring.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/dstring.h b/src/dstring.h
index 2673f1b..88ca79f 100644
--- a/src/dstring.h
+++ b/src/dstring.h
@@ -8,6 +8,7 @@
#ifndef BFS_DSTRING_H
#define BFS_DSTRING_H
+#include "bfstd.h"
#include "config.h"
#include <stdarg.h>
#include <stddef.h>
@@ -262,6 +263,36 @@ BFS_FORMATTER(2, 0)
int dstrvcatf(char **str, const char *format, va_list args);
/**
+ * Concatenate while shell-escaping.
+ *
+ * @param dest
+ * The destination dynamic string.
+ * @param str
+ * The string to escape.
+ * @param flags
+ * Flags for wordesc().
+ * @return
+ * 0 on success, -1 on failure.
+ */
+int dstrescat(char **dest, const char *str, enum wesc_flags flags);
+
+/**
+ * Concatenate while shell-escaping.
+ *
+ * @param dest
+ * The destination dynamic string.
+ * @param str
+ * The string to escape.
+ * @param n
+ * The maximum length of the string.
+ * @param flags
+ * Flags for wordesc().
+ * @return
+ * 0 on success, -1 on failure.
+ */
+int dstrnescat(char **dest, const char *str, size_t n, enum wesc_flags flags);
+
+/**
* Free a dynamic string.
*
* @param dstr