fixed pkg-config rule
[k8jam.git] / src / variable.h
blob0e847741214ae9340ef418991729981b2952d585
1 /*
2 * Copyright 1993, 2000 Christopher Seiwald.
4 * This file is part of Jam - see jam.c for Copyright information.
5 */
6 /*
7 * variable.h - handle jam multi-element variables
9 * 11/04/02 (seiwald) - const-ing for string literals
11 #ifndef JAMH_VARIABLE_H
12 #define JAMH_VARIABLE_H
14 #include "kstrings.h"
18 * var_defines() - load a bunch of variable=value settings
20 * if variable name ends in PATH, split value at :'s, otherwise, split at blanks
22 extern void var_defines (const char **e, int dontignore);
25 * var_string() - expand a string with variables in it
27 * copies in to 'out'; doesn't modify targets & sources
28 * 'out' should be initialized
29 * returns length of added data or -1
31 extern int var_string (const char *in, tKString *out, LOL *lol, char separator);
34 * var_get() - get value of a user defined symbol
36 * returns NULL if symbol unset
38 extern LIST *var_get (const char *symbol);
41 * defines for var_set()
43 enum {
44 VAR_SET, /* override previous value */
45 VAR_APPEND, /* append to previous value */
46 VAR_REMOVE, /* find and remove all occurences of value */
47 VAR_DEFAULT /* set only if no previous value */
51 * var_set() - set a variable in jam's user defined symbol table
53 * 'flag' controls the relationship between new and old values of
54 * the variable: SET replaces the old with the new; APPEND appends
55 * the new to the old; DEFAULT only uses the new if the variable
56 * was previously unset and REMOVE removes all occurences of all
57 * items in 'value' list
59 * copies symbol, takes ownership of value
61 extern void var_set (const char *symbol, LIST *value, int flag);
64 * var_swap() - swap a variable's value with the given one
66 extern LIST *var_swap (const char *symbol, LIST *value);
69 * var_done() - free variable tables
71 extern void var_done (void);
74 #endif