Ignore:
Timestamp:
May 23, 2007, 7:31:19 AM (18 years ago)
Author:
bird
Message:

Merged with the 2007-05-23 CVS. Added rsort and fixed a couple of windows build issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gmakenew/variable.h

    r533 r903  
    6161    int value_alloc_len;        /* The amount of memory we've actually allocated. */
    6262    /* FIXME: make lengths unsigned! */
    63 #endif 
     63#endif
    6464    char *value;                /* Variable value.  */
    6565    struct floc fileinfo;       /* Where the variable was defined.  */
     
    109109  {
    110110    struct pattern_var *next;
    111     char *target;
     111    const char *suffix;
     112    const char *target;
    112113    unsigned int len;
    113     char *suffix;
    114114    struct variable variable;
    115115  };
     
    119119
    120120/* expand.c */
    121 extern char *variable_buffer_output PARAMS ((char *ptr, char *string, unsigned int length));
    122 extern char *variable_expand PARAMS ((char *line));
    123 extern char *variable_expand_for_file PARAMS ((char *line, struct file *file));
    124 extern char *allocated_variable_expand_for_file PARAMS ((char *line, struct file *file));
     121char *variable_buffer_output (char *ptr, const char *string, unsigned int length);
     122char *variable_expand (const char *line);
     123char *variable_expand_for_file (const char *line, struct file *file);
     124char *allocated_variable_expand_for_file (const char *line, struct file *file);
    125125#define allocated_variable_expand(line) \
    126126  allocated_variable_expand_for_file (line, (struct file *) 0)
    127 extern char *expand_argument PARAMS ((const char *str, const char *end));
    128 extern char *variable_expand_string PARAMS ((char *line, char *string,
    129                                              long length));
    130 extern void install_variable_buffer PARAMS ((char **bufp, unsigned int *lenp));
    131 extern void restore_variable_buffer PARAMS ((char *buf, unsigned int len));
     127char *expand_argument (const char *str, const char *end);
     128char *variable_expand_string (char *line, const char *string, long length);
     129void install_variable_buffer (char **bufp, unsigned int *lenp);
     130void restore_variable_buffer (char *buf, unsigned int len);
    132131#ifdef CONFIG_WITH_VALUE_LENGTH
    133 extern void append_expanded_string_to_variable PARAMS ((struct variable *v, char *value));
     132extern void append_expanded_string_to_variable (struct variable *v, char *value);
    134133#endif
    135134
    136135/* function.c */
    137 extern int handle_function PARAMS ((char **op, char **stringp));
    138 extern int pattern_matches PARAMS ((char *pattern, char *percent, char *str));
    139 extern char *subst_expand PARAMS ((char *o, char *text, char *subst, char *replace,
    140                 unsigned int slen, unsigned int rlen, int by_word));
    141 extern char *patsubst_expand PARAMS ((char *o, char *text, char *pattern, char *replace,
    142                 char *pattern_percent, char *replace_percent));
     136int handle_function (char **op, const char **stringp);
     137int pattern_matches (const char *pattern, const char *percent, const char *str);
     138char *subst_expand (char *o, const char *text, const char *subst,
     139                    const char *replace, unsigned int slen, unsigned int rlen,
     140                    int by_word);
     141char *patsubst_expand_pat (char *o, const char *text, const char *pattern,
     142                           const char *replace, const char *pattern_percent,
     143                           const char *replace_percent);
     144char *patsubst_expand (char *o, const char *text, char *pattern, char *replace);
    143145
    144146/* expand.c */
    145 extern char *recursively_expand_for_file PARAMS ((struct variable *v,
    146                                                   struct file *file));
     147char *recursively_expand_for_file (struct variable *v, struct file *file);
    147148#define recursively_expand(v)   recursively_expand_for_file (v, NULL)
    148149
    149150/* variable.c */
    150 extern struct variable_set_list *create_new_variable_set PARAMS ((void));
    151 extern void free_variable_set PARAMS ((struct variable_set_list *));
    152 extern struct variable_set_list *push_new_variable_scope PARAMS ((void));
    153 extern void pop_variable_scope PARAMS ((void));
    154 extern void define_automatic_variables PARAMS ((void));
    155 extern void initialize_file_variables PARAMS ((struct file *file, int read));
    156 extern void print_file_variables PARAMS ((struct file *file));
    157 extern void print_variable_set PARAMS ((struct variable_set *set, char *prefix));
    158 extern void merge_variable_set_lists PARAMS ((struct variable_set_list **to_list, struct variable_set_list *from_list));
    159 extern struct variable *do_variable_definition PARAMS ((const struct floc *flocp, const char *name, char *value, enum variable_origin origin, enum variable_flavor flavor, int target_var));
    160 extern struct variable *parse_variable_definition PARAMS ((struct variable *v, char *line));
    161 extern struct variable *try_variable_definition PARAMS ((const struct floc *flocp, char *line, enum variable_origin origin, int target_var));
    162 extern void init_hash_global_variable_set PARAMS ((void));
    163 extern void hash_init_function_table PARAMS ((void));
    164 extern struct variable *lookup_variable PARAMS ((const char *name, unsigned int length));
    165 extern struct variable *lookup_variable_in_set PARAMS ((const char *name,
    166                                                         unsigned int length,
    167                                                         const struct variable_set *set));
     151struct variable_set_list *create_new_variable_set (void);
     152void free_variable_set (struct variable_set_list *);
     153struct variable_set_list *push_new_variable_scope (void);
     154void pop_variable_scope (void);
     155void define_automatic_variables (void);
     156void initialize_file_variables (struct file *file, int reading);
     157void print_file_variables (const struct file *file);
     158void print_variable_set (struct variable_set *set, char *prefix);
     159void merge_variable_set_lists (struct variable_set_list **to_list,
     160                               struct variable_set_list *from_list);
     161struct variable *do_variable_definition (const struct floc *flocp,
     162                                         const char *name, const char *value,
     163                                         enum variable_origin origin,
     164                                         enum variable_flavor flavor,
     165                                         int target_var);
     166struct variable *parse_variable_definition (struct variable *v, char *line);
     167struct variable *try_variable_definition (const struct floc *flocp, char *line,
     168                                          enum variable_origin origin,
     169                                          int target_var);
     170void init_hash_global_variable_set (void);
     171void hash_init_function_table (void);
     172struct variable *lookup_variable (const char *name, unsigned int length);
     173struct variable *lookup_variable_in_set (const char *name, unsigned int length,
     174                                         const struct variable_set *set);
    168175
    169176#ifdef CONFIG_WITH_VALUE_LENGTH
    170177
    171 extern struct variable *define_variable_in_set
    172     PARAMS ((const char *name, unsigned int length, char *value,
    173              unsigned int value_length, int duplicate_value,
    174              enum variable_origin origin, int recursive,
    175              struct variable_set *set, const struct floc *flocp));
     178struct variable *define_variable_in_set (const char *name, unsigned int length,
     179                                         const char *value,
     180                                         unsigned int value_length,
     181                                         int duplicate_value,
     182                                         enum variable_origin origin,
     183                                         int recursive,
     184                                         struct variable_set *set,
     185                                         const struct floc *flocp);
    176186
    177187/* Define a variable in the current variable set.  */
    178188
    179189#define define_variable(n,l,v,o,r) \
    180           define_variable_in_set((n),(l),(v), ~0U,1,(o),(r),\
     190          define_variable_in_set((n),(l),(v),~0U,1,(o),(r),\
    181191                                 current_variable_set_list->set,NILF)
    182192
     
    204214          define_variable_in_set((n),(l),(v),~0U,1,(o),(r),(f)->variables->set,NILF)
    205215
    206 #else
    207 
    208 extern struct variable *define_variable_in_set
    209     PARAMS ((const char *name, unsigned int length, char *value,
    210              enum variable_origin origin, int recursive,
    211              struct variable_set *set, const struct floc *flocp));
     216#else  /* !CONFIG_WITH_VALUE_LENGTH */
     217
     218struct variable *define_variable_in_set (const char *name, unsigned int length,
     219                                         const char *value,
     220                                         enum variable_origin origin,
     221                                         int recursive,
     222                                         struct variable_set *set,
     223                                         const struct floc *flocp);
    212224
    213225/* Define a variable in the current variable set.  */
     
    215227#define define_variable(n,l,v,o,r) \
    216228          define_variable_in_set((n),(l),(v),(o),(r),\
    217                                  current_variable_set_list->set,NILF)
     229                                 current_variable_set_list->set,NILF)           /* force merge conflict */
    218230
    219231/* Define a variable with a location in the current variable set.  */
     
    221233#define define_variable_loc(n,l,v,o,r,f) \
    222234          define_variable_in_set((n),(l),(v),(o),(r),\
    223                                  current_variable_set_list->set,(f))
     235                                 current_variable_set_list->set,(f))            /* force merge conflict */
    224236
    225237/* Define a variable with a location in the global variable set.  */
    226238
    227239#define define_variable_global(n,l,v,o,r,f) \
    228           define_variable_in_set((n),(l),(v),(o),(r),NULL,(f))
     240          define_variable_in_set((n),(l),(v),(o),(r),NULL,(f))                  /* force merge conflict */
    229241
    230242/* Define a variable in FILE's variable set.  */
    231243
    232244#define define_variable_for_file(n,l,v,o,r,f) \
    233           define_variable_in_set((n),(l),(v),(o),(r),(f)->variables->set,NILF)
    234 
    235 #endif
     245          define_variable_in_set((n),(l),(v),(o),(r),(f)->variables->set,NILF)  /* force merge conflict */
     246
     247#endif /* !CONFIG_WITH_VALUE_LENGTH */
    236248
    237249/* Warn that NAME is an undefined variable.  */
     
    244256                              }while(0)
    245257
    246 extern char **target_environment PARAMS ((struct file *file));
    247 
    248 extern struct pattern_var *create_pattern_var PARAMS ((char *target, char *suffix));
     258char **target_environment (struct file *file);
     259
     260struct pattern_var *create_pattern_var (const char *target,
     261                                        const char *suffix);
    249262
    250263extern int export_all_variables;
Note: See TracChangeset for help on using the changeset viewer.