diff options
author | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-05-13 03:35:30 +0200 |
---|---|---|
committer | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-05-13 03:35:30 +0200 |
commit | 670a8f984fc6d8342180c59ae9e96b0b76f34d3d (patch) | |
tree | 9f2ce7eec1a77e56b3bb1ad0ad40f212d7a996b0 /jam-files/engine/command.h | |
parent | eb3ee28dc0eb1d3e5ed01ba0df843be329ae450d (diff) | |
parent | 2f64af3e06a518b93f7ca2c30a9d0aeb2c947031 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'jam-files/engine/command.h')
-rw-r--r-- | jam-files/engine/command.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/jam-files/engine/command.h b/jam-files/engine/command.h new file mode 100644 index 00000000..ddd38e68 --- /dev/null +++ b/jam-files/engine/command.h @@ -0,0 +1,61 @@ +/* + * Copyright 1994 Christopher Seiwald. + * + * This file is part of Jam - see jam.c for Copyright information. + */ + +/* + * command.h - the CMD structure and routines to manipulate them + * + * Both ACTION and CMD contain a rule, targets, and sources. An + * ACTION describes a rule to be applied to the given targets and + * sources; a CMD is what actually gets executed by the shell. The + * differences are due to: + * + * ACTIONS must be combined if 'actions together' is given. + * ACTIONS must be split if 'actions piecemeal' is given. + * ACTIONS must have current sources omitted for 'actions updated'. + * + * The CMD datatype holds a single command that is to be executed + * against a target, and they can chain together to represent the + * full collection of commands used to update a target. + * + * Structures: + * + * CMD - an action, ready to be formatted into a buffer and executed. + * + * External routines: + * + * cmd_new() - return a new CMD or 0 if too many args. + * cmd_free() - delete CMD and its parts. + * cmd_next() - walk the CMD chain. + */ + + +/* + * CMD - an action, ready to be formatted into a buffer and executed. + */ + +typedef struct _cmd CMD; + +struct _cmd +{ + CMD * next; + CMD * tail; /* valid on in head */ + RULE * rule; /* rule->actions contains shell script */ + LIST * shell; /* $(SHELL) value */ + LOL args; /* LISTs for $(<), $(>) */ + char * buf; /* actual commands */ +}; + +CMD * cmd_new +( + RULE * rule, /* rule (referenced) */ + LIST * targets, /* $(<) (freed) */ + LIST * sources, /* $(>) (freed) */ + LIST * shell /* $(SHELL) (freed) */ +); + +void cmd_free( CMD * ); + +#define cmd_next( c ) ( ( c )->next ) |