ezmlmx 0.68
ezmlmx
Loading...
Searching...
No Matches
wrap_execbin.c
Go to the documentation of this file.
1#include "auto_bin.h"
2#include "stralloc.h"
3#include "wrap.h"
4#include "idx.h"
5#include "errtxt.h"
6#include "logmsg.h"
7
8#define WHO "wrap_execbin"
9
15
16static stralloc path;
17
18static void die_nomem() { logmsg(WHO,111,FATAL,ERR_NOMEM); }
19
20void wrap_execbin(const char *program,stralloc *opts,const char *dir)
21{
22 const char *args[4];
23 int i;
24
25 if (!stralloc_copys(&path,auto_bin)) die_nomem();
26 if (!stralloc_cats(&path,program)) die_nomem();
27 if (!stralloc_0(&path)) die_nomem();
28 args[0] = path.s;
29
30 i = 1;
31 if (opts && opts->len > 1) {
32 if (!stralloc_0(opts)) die_nomem();
33 args[i++] = opts->s;
34 }
35
36 args[i++] = dir;
37 args[i] = 0;
38
39 wrap_execv(args);
40}
void wrap_execv(const char **argv)
Definition wrap_execv.c:25
Error messages. If you translate these, I would urge you to keep the English version as well....
#define ERR_NOMEM
Definition errtxt.h:14
void die_nomem()
Definition getconf.c:17
void wrap_execbin(const char *program, stralloc *opts, const char *dir)
#define WHO
Definition author.c:1
char * dir
const char auto_bin[]
Definition auto_bin.c:1
const char * logmsg(const char *dir, unsigned long num, unsigned long listno, unsigned long subs, int done)
Definition loginfo.c:32