version 1.11, 2014/06/07 15:28:21 |
version 1.12, 2015/01/20 09:00:16 |
|
|
* SUCH DAMAGE. |
* SUCH DAMAGE. |
*/ |
*/ |
|
|
#include "defs.h" |
#include "client.h" |
|
|
static struct namelist *addnl(struct namelist *, struct namelist *); |
static struct namelist *addnl(struct namelist *, struct namelist *); |
static struct namelist *subnl(struct namelist *, struct namelist *); |
static struct namelist *subnl(struct namelist *, struct namelist *); |
|
|
*/ |
*/ |
void |
void |
insert(char *label, struct namelist *files, struct namelist *hosts, |
insert(char *label, struct namelist *files, struct namelist *hosts, |
struct subcmd *subcmds) |
struct subcmd *scmds) |
{ |
{ |
struct cmd *c, *prev, *nc; |
struct cmd *c, *prev, *nc; |
struct namelist *h, *lasth; |
struct namelist *h, *lasth; |
|
|
debugmsg(DM_CALL, "insert(%s, %p, %p, %p) start, files = %s", |
debugmsg(DM_CALL, "insert(%s, %p, %p, %p) start, files = %s", |
label == NULL ? "(null)" : label, |
label == NULL ? "(null)" : label, |
files, hosts, subcmds, getnlstr(files)); |
files, hosts, scmds, getnlstr(files)); |
|
|
files = expand(files, E_VARS|E_SHELL); |
files = expand(files, E_VARS|E_SHELL); |
hosts = expand(hosts, E_ALL); |
hosts = expand(hosts, E_ALL); |
|
|
nc->c_name = h->n_name; |
nc->c_name = h->n_name; |
nc->c_label = label; |
nc->c_label = label; |
nc->c_files = files; |
nc->c_files = files; |
nc->c_cmds = subcmds; |
nc->c_cmds = scmds; |
nc->c_flags = 0; |
nc->c_flags = 0; |
nc->c_next = c; |
nc->c_next = c; |
if (prev == NULL) |
if (prev == NULL) |
|
|
* executed in the order they appear in the distfile. |
* executed in the order they appear in the distfile. |
*/ |
*/ |
void |
void |
append(char *label, struct namelist *files, char *stamp, struct subcmd *subcmds) |
append(char *label, struct namelist *files, char *stamp, struct subcmd *scmds) |
{ |
{ |
struct cmd *c; |
struct cmd *c; |
|
|
|
|
c->c_name = stamp; |
c->c_name = stamp; |
c->c_label = label; |
c->c_label = label; |
c->c_files = expand(files, E_ALL); |
c->c_files = expand(files, E_ALL); |
c->c_cmds = subcmds; |
c->c_cmds = scmds; |
c->c_next = NULL; |
c->c_next = NULL; |
if (cmds == NULL) |
if (cmds == NULL) |
cmds = last_cmd = c; |
cmds = last_cmd = c; |