diff options
author | Paul Smith <psmith@gnu.org> | 2002-07-11 06:38:57 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2002-07-11 06:38:57 +0000 |
commit | 21cf8c64441103bf875a56b39f39397ecd51424e (patch) | |
tree | 24ff4cecaa8603feffa1ecf5ed82a4199a51d673 /variable.h | |
parent | 4d72c4c11e3aff65e9bb36e5fcf75f088b140049 (diff) | |
download | gunmake-21cf8c64441103bf875a56b39f39397ecd51424e.tar.gz |
Install Greg McGary's patches to port the id-utils hashing functions to
GNU make. Also he provides some other performance fixups after doing
some profiling of make on large makefiles.
Modify the test suite to allow the use of Valgrind to find memory problems.
Diffstat (limited to 'variable.h')
-rw-r--r-- | variable.h | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -1,5 +1,5 @@ /* Definitions for using variables in GNU Make. -Copyright (C) 1988, 1989, 1990, 1991, 1992 Free Software Foundation, Inc. +Copyright (C) 1988, 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc. This file is part of GNU Make. GNU Make is free software; you can redistribute it and/or modify @@ -17,6 +17,8 @@ along with GNU Make; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "hash.h" + /* Codes in a variable definition saying where the definition came from. Increasing numeric values signify less-overridable definitions. */ enum variable_origin @@ -50,8 +52,8 @@ enum variable_flavor struct variable { - struct variable *next; /* Link in the chain. */ char *name; /* Variable name. */ + int length; /* strlen (name) */ char *value; /* Variable value. */ struct floc fileinfo; /* Where the variable was defined. */ unsigned int recursive:1; /* Gets recursively re-evaluated. */ @@ -79,8 +81,7 @@ struct variable struct variable_set { - struct variable **table; /* Hash table of variables. */ - unsigned int buckets; /* Number of hash buckets in `table'. */ + struct hash_table table; /* Hash table of variables. */ }; /* Structure that represents a list of variable sets. */ @@ -128,7 +129,8 @@ extern void print_variable_set PARAMS ((struct variable_set *set, char *prefix)) extern void merge_variable_set_lists PARAMS ((struct variable_set_list **setlist0, struct variable_set_list *setlist1)); 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)); extern struct variable *try_variable_definition PARAMS ((const struct floc *flocp, char *line, enum variable_origin origin, int target_var)); - +extern void init_hash_global_variable_set PARAMS ((void)); +extern void hash_init_function_table PARAMS ((void)); extern struct variable *lookup_variable PARAMS ((const char *name, unsigned int length)); extern struct variable *lookup_variable_in_set PARAMS ((const char *name, unsigned int length, @@ -173,3 +175,6 @@ extern struct variable *define_variable_in_set extern char **target_environment PARAMS ((struct file *file)); extern int export_all_variables; + +#define MAKELEVEL_NAME "MAKELEVEL" +#define MAKELEVEL_LENGTH (sizeof (MAKELEVEL_NAME) - 1) |