fixed pkg-config rule
[k8jam.git] / src / command.h
blob2685b2234a2b733cb9b4ab09cc421ed377ba8bab
1 /*
2 * Copyright 1994 Christopher Seiwald.
4 * This file is part of Jam - see jam.c for Copyright information.
5 */
6 /*
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.
22 * Structures:
24 * CMD - an action, ready to be formatted into a buffer and executed
26 * External routines:
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
36 #include "kstrings.h"
40 * CMD - an action, ready to be formatted into a buffer and executed
42 typedef struct _cmd CMD;
43 struct _cmd {
44 CMD *next;
45 CMD *tail; /* valid on in head */
46 RULE *rule; /* rule->actions contains shell script */
47 LIST *shell; /* $(SHELL) value */
48 LOL args; /* LISTs for $(<), $(>) */
49 //char buf[MAXLINE]; /* actual commands */
50 tKString buf;
54 extern CMD *cmd_new (
55 RULE *rule, /* rule (referenced) */
56 LIST *targets, /* $(<) (freed) */
57 LIST *sources, /* $(>) (freed) */
58 LIST *shell, /* $(SHELL) (freed) */
59 int maxline /* max line length */
62 extern void cmd_free (CMD *cmd);
65 #define cmd_next(c) ((c)->next)
68 #endif