2 * Copyright 1994 Christopher Seiwald.
4 * This file is part of Jam - see jam.c for Copyright information.
7 * command.h - the CMD structure and routines to manipulate them
9 * Both ACTION and CMD contain a rule, targets, and sources. An
10 * ACTION describes a rule to be applied to the given targets and
11 * sources; a CMD is what actually gets executed by the shell. The
12 * differences are due to:
14 * ACTIONS must be combined if 'actions together' is given.
15 * ACTIONS must be split if 'actions piecemeal' is given.
16 * ACTIONS must have current sources omitted for 'actions updated'.
18 * The CMD datatype holds a single command that is to be executed
19 * against a target, and they can chain together to represent the
20 * full collection of commands used to update a target.
24 * CMD - an action, ready to be formatted into a buffer and executed
28 * cmd_new() - return a new CMD or 0 if too many args
29 * cmd_free() - delete CMD and its parts
30 * cmd_next() - walk the CMD chain
32 #ifndef JAMH_COMMAND_H
33 #define JAMH_COMMAND_H
37 * CMD - an action, ready to be formatted into a buffer and executed
39 typedef struct _cmd CMD
;
43 CMD
*tail
; /* valid on in head */
44 RULE
*rule
; /* rule->actions contains shell script */
45 LIST
*shell
; /* $(SHELL) value */
46 LOL args
; /* LISTs for $(<), $(>) */
47 char buf
[MAXLINE
]; /* actual commands */
52 RULE
*rule
, /* rule (referenced) */
53 LIST
*targets
, /* $(<) (freed) */
54 LIST
*sources
, /* $(>) (freed) */
55 LIST
*shell
, /* $(SHELL) (freed) */
56 int maxline
); /* max line length */
58 extern void cmd_free (CMD
*cmd
);
60 #define cmd_next(c) ((c)->next)