diff options
author | David Oberhollenzer <david.oberhollenzer@tele2.at> | 2018-04-04 18:54:59 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@tele2.at> | 2018-04-04 18:54:59 +0200 |
commit | 65d2abc3f0f87b32a6dd3fc0bbf9f98b8ab049a0 (patch) | |
tree | af143b1fed068727f7cf4dad1407e5745c6dc65e /lib | |
parent | 04a23330e4a2085ee91980c223c5e4f089ebbe97 (diff) |
Add comments to library headers
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/include/service.h | 21 | ||||
-rw-r--r-- | lib/include/util.h | 11 |
2 files changed, 24 insertions, 8 deletions
diff --git a/lib/include/service.h b/lib/include/service.h index 593b221..eaa35bb 100644 --- a/lib/include/service.h +++ b/lib/include/service.h @@ -45,8 +45,8 @@ enum { }; typedef struct exec_t { - char **argv; - char *raw_argv; + char **argv; /* NULL terminated argument vector */ + char *raw_argv; /* backing store for argv contents */ struct exec_t *next; } exec_t; @@ -56,15 +56,20 @@ typedef struct service_t { int target; /* TGT_* service target */ char *name; /* canonical service name */ char *desc; /* description string */ - exec_t *exec; /* command lines to execute */ char *ctty; /* controlling tty or log file */ - int rspwn_limit; /* maximum respawn count */ - char **before; /* services that must be executed later */ - char **after; /* services that must be executed first */ - char *raw_after; - char *raw_before; + /* linked list of command lines to execute */ + exec_t *exec; + + /* NULL terminated array of services that must be executed later */ + char **before; + + /* NULL terminated array of services that must be executed first */ + char **after; + + char *raw_before; /* backing store for 'before' contents */ + char *raw_after; /* backing store for 'after' contents */ pid_t pid; int status; /* process exit status */ diff --git a/lib/include/util.h b/lib/include/util.h index a6e96fa..a9d111b 100644 --- a/lib/include/util.h +++ b/lib/include/util.h @@ -73,6 +73,17 @@ char *rdline(int fd, int argc, const char *const *argv); */ int unescape(char *src); +/* + 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. + + If a double quote is encountered, the entire string up to to the next, + unescaped double quite is interpreted as a single sub string and + fed through the unescape function. + + The returned array must be freed with free(). +*/ char **split_argv(char *str); /* |