]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/src/engine/command.h
2 * Copyright 1994 Christopher Seiwald.
4 * This file is part of Jam - see jam.c for Copyright information.
8 * command.h - the CMD structure and routines to manipulate them
10 * Both ACTION and CMD contain a rule, targets, and sources. An
11 * ACTION describes a rule to be applied to the given targets and
12 * sources; a CMD is what actually gets executed by the shell. The
13 * differences are due to:
15 * ACTIONS must be combined if 'actions together' is given.
16 * ACTIONS must be split if 'actions piecemeal' is given.
17 * ACTIONS must have current sources omitted for 'actions updated'.
19 * The CMD datatype holds a single command that is to be executed
20 * against a target, and they can chain together to represent the
21 * full collection of commands used to update a target.
25 * CMD - an action, ready to be formatted into a buffer and executed.
29 * cmd_new() - return a new CMD or 0 if too many args.
30 * cmd_free() - delete CMD and its parts.
31 * cmd_next() - walk the CMD chain.
32 * cmd_release_targets_and_shell() - CMD forgets about its targets & shell.
37 * CMD - an action, ready to be formatted into a buffer and executed.
40 #ifndef COMMAND_SW20111118_H
41 #define COMMAND_SW20111118_H
49 typedef struct _cmd CMD
;
52 * A list whose elements are either TARGETS or CMDS.
53 * CMDLIST is used only by CMD. A TARGET means that
54 * the CMD is the last updating action required to
55 * build the target. A CMD is the next CMD required
56 * to build the same target. (Note that a single action
57 * can update more than one target, so the CMDs form
58 * a DAG, not a straight linear list.)
60 typedef struct _cmdlist
{
61 struct _cmdlist
* next
;
69 CMDLIST
* cmdlist_append_cmd( CMDLIST
*, CMD
* );
70 CMDLIST
* cmdlist_append_target( CMDLIST
*, TARGET
* );
71 void cmd_list_free( CMDLIST
* );
76 RULE
* rule
; /* rule->actions contains shell script */
77 LIST
* shell
; /* $(JAMSHELL) value */
78 LOL args
; /* LISTs for $(<), $(>) */
79 string buf
[ 1 ]; /* actual commands */
80 int noop
; /* no-op commands should be faked instead of executed */
81 int asynccnt
; /* number of outstanding dependencies */
82 TARGETS
* lock
; /* semaphores that are required by this cmd. */
83 TARGETS
* unlock
; /* semaphores that are released when this cmd finishes. */
84 char status
; /* the command status */
89 RULE
* rule
, /* rule (referenced) */
90 LIST
* targets
, /* $(<) (ownership transferred) */
91 LIST
* sources
, /* $(>) (ownership transferred) */
92 LIST
* shell
/* $(JAMSHELL) (ownership transferred) */
95 void cmd_release_targets_and_shell( CMD
* );
97 void cmd_free( CMD
* );
99 #define cmd_next( c ) ((c)->next)