aboutsummaryrefslogtreecommitdiff
path: root/lib/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-04-11 19:45:26 +0200
committerDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-04-11 19:45:26 +0200
commit6642b2b2bf3d16e0632989c1e29c672882e0d283 (patch)
treef39581ab909a41fe07c005cbb81f2ec273d057ea /lib/include
parent71d98c150f6242fcf1b8a5845e46db56caad3885 (diff)
Don't pre-allocate argument vector for command lines
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Diffstat (limited to 'lib/include')
-rw-r--r--lib/include/service.h4
-rw-r--r--lib/include/util.h12
2 files changed, 2 insertions, 14 deletions
diff --git a/lib/include/service.h b/lib/include/service.h
index 471ccbb..595c60e 100644
--- a/lib/include/service.h
+++ b/lib/include/service.h
@@ -46,8 +46,8 @@ enum {
typedef struct exec_t {
struct exec_t *next;
- char **argv; /* NULL terminated argument vector */
- char buffer[]; /* backing store for argv */
+ int argc; /* number of elements in argument vector */
+ char args[]; /* argument vectot string blob */
} exec_t;
typedef struct service_t {
diff --git a/lib/include/util.h b/lib/include/util.h
index d824b22..d6b68f1 100644
--- a/lib/include/util.h
+++ b/lib/include/util.h
@@ -113,18 +113,6 @@ int unescape(char *src);
int pack_argv(char *str);
/*
- Split a space seperated string into a sequence of null-terminated
- strings. Return a NULL terminated array of strings pointing to the
- start of each sub string.
-
- It basically runs pack_argv on 'str' and then constructs the argv
- vector from that, with each entry pointing into 'str'.
-
- The returned array must be freed with free().
-*/
-char **split_argv(char *str);
-
-/*
Search through an array of enum_map_t entries to resolve a string to
a numeric value. The end of the map is indicated by a sentinel entry
with the name set to NULL.