Ignore:
Timestamp:
Sep 18, 2006, 1:49:49 AM (19 years ago)
Author:
bird
Message:

skip some unnecessary copies and allocations.

File:
1 edited

Legend:

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

    r530 r531  
    162162                                                        const struct variable_set *set));
    163163
     164#ifdef CONFIG_WITH_VALUE_LENGTH
     165
     166extern struct variable *define_variable_in_set
     167    PARAMS ((const char *name, unsigned int length, char *value,
     168             unsigned int value_length, int duplicate_value,
     169             enum variable_origin origin, int recursive,
     170             struct variable_set *set, const struct floc *flocp));
     171
     172/* Define a variable in the current variable set.  */
     173
     174#define define_variable(n,l,v,o,r) \
     175          define_variable_in_set((n),(l),(v), ~0U,1,(o),(r),\
     176                                 current_variable_set_list->set,NILF)
     177
     178#define define_variable_vl(n,l,v,vl,dv,o,r) \
     179          define_variable_in_set((n),(l),(v),(vl),(dv),(o),(r),\
     180                                 current_variable_set_list->set,NILF)
     181
     182/* Define a variable with a location in the current variable set.  */
     183
     184#define define_variable_loc(n,l,v,o,r,f) \
     185          define_variable_in_set((n),(l),(v),~0U,1,(o),(r),\
     186                                 current_variable_set_list->set,(f))
     187
     188/* Define a variable with a location in the global variable set.  */
     189
     190#define define_variable_global(n,l,v,o,r,f) \
     191          define_variable_in_set((n),(l),(v),~0U,1,(o),(r),NULL,(f))
     192
     193#define define_variable_vl_global(n,l,v,vl,dv,o,r,f) \
     194          define_variable_in_set((n),(l),(v),(vl),(dv),(o),(r),NULL,(f))
     195
     196/* Define a variable in FILE's variable set.  */
     197
     198#define define_variable_for_file(n,l,v,o,r,f) \
     199          define_variable_in_set((n),(l),(v),~0U,1,(o),(r),(f)->variables->set,NILF)
     200
     201#else
     202
    164203extern struct variable *define_variable_in_set
    165204    PARAMS ((const char *name, unsigned int length, char *value,
     
    188227#define define_variable_for_file(n,l,v,o,r,f) \
    189228          define_variable_in_set((n),(l),(v),(o),(r),(f)->variables->set,NILF)
     229
     230#endif
    190231
    191232/* Warn that NAME is an undefined variable.  */
Note: See TracChangeset for help on using the changeset viewer.