aboutsummaryrefslogtreecommitdiffstats
path: root/src/libexecline/el_parse_from_string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexecline/el_parse_from_string.c')
-rw-r--r--src/libexecline/el_parse_from_string.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libexecline/el_parse_from_string.c b/src/libexecline/el_parse_from_string.c
new file mode 100644
index 0000000..04c48a3
--- /dev/null
+++ b/src/libexecline/el_parse_from_string.c
@@ -0,0 +1,15 @@
+/* ISC license. */
+
+#include <skalibs/stralloc.h>
+#include <execline/execline.h>
+
+static int next (unsigned char *c, void *p)
+{
+ *c = *(*(char const **)p)++ ;
+ return 1 ;
+}
+
+int el_parse_from_string (stralloc *sa, char const *s)
+{
+ return el_parse(sa, &next, &s) ;
+}