home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / gnu / make3_60.lzh / MAKE3_60 / VARIABLE.H < prev    next >
C/C++ Source or Header  |  1993-07-30  |  3KB  |  95 lines

  1. /* Copyright (C) 1988, 1989, 1990 Free Software Foundation, Inc.
  2. This file is part of GNU Make.
  3.  
  4. GNU Make is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 1, or (at your option)
  7. any later version.
  8.  
  9. GNU Make is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License
  15. along with GNU Make; see the file COPYING.  If not, write to
  16. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  17.  
  18. /* Codes in a variable definition saying where the definition came from.
  19.    Increasing numeric values signify less-overridable definitions.  */
  20. enum variable_origin
  21.   {
  22.     o_default,        /* Variable from the default set.  */
  23.     o_env,        /* Variable from environment.  */
  24.     o_file,        /* Variable given in a makefile.  */
  25.     o_env_override,    /* Variable from environment, if -e.  */
  26.     o_command,        /* Variable given by user.  */
  27.     o_override,     /* Variable from an `override' directive.  */
  28.     o_automatic,    /* Automatic variable -- cannot be set.  */
  29.     o_invalid        /* Core dump time.  */
  30.   };
  31.  
  32. /* Structure that represents one variable definition.
  33.    Each bucket of the hash table is a chain of these,
  34.    chained through `next'.  */
  35.  
  36. struct variable
  37.   {
  38.     struct variable *next;    /* Link in the chain.  */
  39.     char *name;            /* Variable name.  */
  40.     char *value;        /* Variable value.  */
  41.     enum variable_origin
  42.       origin ENUM_BITFIELD (3);    /* Variable origin.  */
  43.     unsigned int recursive:1;    /* Gets recursively re-evaluated.  */
  44.     unsigned int expanding:1;    /* Nonzero if currently being expanded.  */
  45.   };
  46.  
  47. /* Structure that represents a variable set.  */
  48.  
  49. struct variable_set
  50.   {
  51.     struct variable **table;    /* Hash table of variables.  */
  52.     unsigned int buckets;    /* Number of hash buckets in `table'.  */
  53.   };
  54.  
  55. /* Structure that represents a list of variable sets.  */
  56.  
  57. struct variable_set_list
  58.   {
  59.     struct variable_set_list *next;    /* Link in the chain.  */
  60.     struct variable_set *set;        /* Variable set.  */
  61.   };
  62.  
  63. extern struct variable_set_list *current_variable_set_list;
  64.  
  65.  
  66. extern char *variable_buffer_output ();
  67. extern char *initialize_variable_output ();
  68. extern char *save_variable_output ();
  69. extern void restore_variable_output ();
  70.  
  71. extern void push_new_variable_scope (), pop_variable_scope ();
  72.  
  73. extern int handle_function ();
  74.  
  75. extern char *variable_expand (), *allocated_variable_expand ();
  76. extern char *variable_expand_for_file ();
  77. extern char *allocated_variable_expand_for_file ();
  78. extern char *expand_argument ();
  79.  
  80. extern void define_automatic_variables ();
  81. extern void initialize_file_variables ();
  82. extern void print_file_variables ();
  83.  
  84. extern void merge_variable_set_lists ();
  85.  
  86. extern int try_variable_definition ();
  87.  
  88. extern struct variable *lookup_variable (), *define_variable ();
  89. extern struct variable *define_variable_for_file ();
  90.  
  91. extern int pattern_matches ();
  92. extern char *subst_expand (), *patsubst_expand ();
  93.  
  94. extern char **target_environment ();
  95.