api.c: Factor out SVC|JOB:ID string parser

This patch breaks out the JOB:ID parser from api.c, placing it in a new
function called svc_parse_jobstr().

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-01-15 23:12:53 +01:00
1 parent 1999956d91
commit 47b4850aa8
3 files changed
+75 -44

No files matched your search

+2
View File
@@ -171,6 +171,8 @@ const char *svc_dirtystr (svc_t *svc);
int svc_next_id (char *cmd);
int svc_is_unique (svc_t *svc);
int svc_parse_jobstr (char *str, size_t len, int (*found)(svc_t *), int (not_found)(char *, int));
static inline int svc_in_runlevel (svc_t *svc, int runlevel) { return svc && ISSET(svc->runlevels, runlevel); }
static inline int svc_has_sighup (svc_t *svc) { return svc && 0 != svc->sighup; }