about summary refs log tree commit diff
path: root/src/libexecline/el_parse_from_string.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-03-26 12:47:19 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-03-26 12:47:19 +0000
commit9cf89b4437df6a7741532dd73fed770cd8eef9f2 (patch)
treeabdeb249d992b1ba90d44b838318d0d09c3369a2 /src/libexecline/el_parse_from_string.c
parentcfe736ed5615d6e00f4ce6704591782fe790a752 (diff)
downloadexecline-9cf89b4437df6a7741532dd73fed770cd8eef9f2.tar.gz
execline-9cf89b4437df6a7741532dd73fed770cd8eef9f2.tar.xz
execline-9cf89b4437df6a7741532dd73fed770cd8eef9f2.zip
- added el_parse() and friends
 - refactored execlineb to use them
 - version: rc for 2.1.1.1
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) ;
+}