home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / GNU / MAK358AS.ZIP / VARIABLE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-22  |  6.1 KB  |  178 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. /*
  19.  * MS-DOS port (c) 1990 by Thorsten Ohl <ohl@gnu.ai.mit.edu>
  20.  *
  21.  * To this port, the same copying conditions apply as to the
  22.  * original release.
  23.  *
  24.  * IMPORTANT:
  25.  * This file is not identical to the original GNU release!
  26.  * You should have received this code as patch to the official
  27.  * GNU release.
  28.  *
  29.  * MORE IMPORTANT:
  30.  * This port comes with ABSOLUTELY NO WARRANTY.
  31.  *
  32.  * $Header: e:/gnu/make/RCS/variable.h'v 3.58.0.2 90/07/17 03:32:57 tho Exp $
  33.  */
  34.  
  35. /* Codes in a variable definition saying where the definition came from.
  36.    Increasing numeric values signify less-overridable definitions.  */
  37. enum variable_origin
  38.   {
  39.     o_default,        /* Variable from the default set.  */
  40.     o_env,        /* Variable from environment.  */
  41.     o_file,        /* Variable given in a makefile.  */
  42.     o_env_override,    /* Variable from environment, if -e.  */
  43.     o_command,        /* Variable given by user.  */
  44.     o_override,     /* Variable from an `override' directive.  */
  45.     o_automatic,    /* Automatic variable -- cannot be set.  */
  46.     o_invalid        /* Core dump time.  */
  47.   };
  48.  
  49. /* Structure that represents one variable definition.
  50.    Each bucket of the hash table is a chain of these,
  51.    chained through `next'.  */
  52.  
  53. struct variable
  54.   {
  55.     struct variable *next;    /* Link in the chain.  */
  56.     char *name;            /* Variable name.  */
  57.     char *value;        /* Variable value.  */
  58.     enum variable_origin
  59.       origin ENUM_BITFIELD (3);    /* Variable origin.  */
  60.     unsigned int recursive:1;    /* Gets recursively re-evaluated.  */
  61.     unsigned int expanding:1;    /* Is currently expanding.  */
  62.   };
  63.  
  64. /* Structure that represents a variable set.  */
  65.  
  66. struct variable_set
  67.   {
  68.     struct variable **table;    /* Hash table of variables.  */
  69.     unsigned int buckets;    /* Number of hash buckets in `table'.  */
  70.   };
  71.  
  72. /* Structure that represents a list of variable sets.  */
  73.  
  74. struct variable_set_list
  75.   {
  76.     struct variable_set_list *next;    /* Link in the chain.  */
  77.     struct variable_set *set;        /* Variable set.  */
  78.   };
  79.  
  80. extern struct variable_set_list *current_variable_set_list;
  81.  
  82.  
  83. /* variable.c */
  84. extern  void print_variable_data_base (void);
  85.  
  86. #ifdef  MSDOS
  87. extern  char *variable_buffer_output (char *ptr, char *string,
  88.                       unsigned int length);
  89. extern  char *initialize_variable_output (void);
  90. extern  char *save_variable_output (void);
  91. extern  void restore_variable_output (char *save);
  92. #else /* not MSDOS */
  93. extern char *variable_buffer_output ();
  94. extern char *initialize_variable_output ();
  95. extern char *save_variable_output ();
  96. extern void restore_variable_output ();
  97. #endif /* not MSDOS */
  98.  
  99. #ifdef  MSDOS
  100. extern  void push_new_variable_scope (void);
  101. extern  void pop_variable_scope (void);
  102. #else /* not MSDOS */
  103. extern void push_new_variable_scope (), pop_variable_scope ();
  104. #endif /* not MSDOS */
  105.  
  106. #ifdef  MSDOS
  107. extern  int handle_function (char **op, char **stringp);
  108. #else /* not MSDOS */
  109. extern int handle_function ();
  110. #endif /* not MSDOS */
  111.   
  112. #ifdef  MSDOS
  113. extern  char *allocated_variable_expand (char *line);
  114. extern  char *allocated_var_exp_for_file (char *line, struct file *file);
  115. extern  char *expand_argument (char *str, char *end);
  116. extern  char *variable_expand (char *line);
  117. extern  char *variable_expand_for_file (char *line, struct file *file);
  118. #else /* not MSDOS */
  119. extern char *variable_expand (), *allocated_variable_expand ();
  120. extern char *variable_expand_for_file ();
  121. extern char *allocated_variable_expand_for_file ();
  122. extern char *expand_argument ();
  123. #endif /* not MSDOS */
  124.  
  125. #ifdef  MSDOS
  126. extern  void define_automatic_variables (void);
  127. extern  void initialize_file_variables (struct file *file);
  128. #else /* not MSDOS */
  129. extern void define_automatic_variables ();
  130. extern void initialize_file_variables ();
  131. #endif /* not MSDOS */
  132.  
  133. extern void print_file_variables ();
  134.  
  135. #ifdef MSDOS
  136. extern void merge_variable_set_lists (struct variable_set_list **setlist0,
  137.                       struct variable_set_list *setlist1);
  138. #else /* not MSDOS */
  139. extern void merge_variable_set_lists ();
  140. #endif /* not MSDOS */
  141.  
  142.  
  143. #ifdef  MSDOS
  144. extern  int try_variable_definition (char *line, enum variable_origin origin);
  145. #else /* not MSDOS */
  146. extern int try_variable_definition ();
  147. #endif /* not MSDOS */
  148.  
  149. #ifdef  MSDOS
  150. extern  struct variable *define_variable (char *name, unsigned int length,
  151.         char *value, enum variable_origin origin, int recursive);
  152. extern  struct variable *define_variable_for_file (char *name,
  153.         unsigned int length, char *value,
  154.         enum variable_origin origin, int recursive, struct file *file);
  155. extern  struct variable *lookup_variable (char *name, unsigned int length);
  156. #else /* not MSDOS */
  157. extern struct variable *lookup_variable (), *define_variable ();
  158. extern struct variable *define_variable_for_file ();
  159. #endif /* not MSDOS */
  160.  
  161. #ifdef  MSDOS
  162. extern int pattern_matches (char *pattern, char *percent, char *word);
  163. extern char *patsubst_expand (char *o, char *text, char *pattern,
  164.         char *replace, char *pattern_percent, char *replace_percent);
  165. extern char *subst_expand (char *o, char *text, char *subst, char *replace,
  166.         unsigned int slen, unsigned int rlen, int by_word,
  167.         int suffix_only);
  168. #else /* not MSDOS */
  169. extern int pattern_matches ();
  170. extern char *subst_expand (), *patsubst_expand ();
  171. #endif /* not MSDOS */
  172.  
  173. #ifdef  MSDOS
  174. extern  char **target_environment (struct file *file);
  175. #else /* not MSDOS */
  176. extern char **target_environment ();
  177. #endif /* not MSDOS */
  178.