1 |
/* Macro table manager for Bison, |
/* Macro table manager for Bison, |
2 |
Copyright 1984, 1989, 2000 Free Software Foundation, Inc. |
Copyright 2001 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of Bison, the GNU Compiler Compiler. |
This file is part of Bison, the GNU Compiler Compiler. |
5 |
|
|
32 |
static unsigned long |
static unsigned long |
33 |
mhash1 (const void *item) |
mhash1 (const void *item) |
34 |
{ |
{ |
35 |
return_STRING_HASH_1 (((muscle_entry_t *) item)->key); |
return_STRING_HASH_1 (((const muscle_entry_t *) item)->key); |
36 |
} |
} |
37 |
|
|
38 |
static unsigned long |
static unsigned long |
39 |
mhash2 (const void *item) |
mhash2 (const void *item) |
40 |
{ |
{ |
41 |
return_STRING_HASH_2 (((muscle_entry_t *) item)->key); |
return_STRING_HASH_2 (((const muscle_entry_t *) item)->key); |
42 |
} |
} |
43 |
|
|
44 |
static int |
static int |
45 |
mcmp (const void *x, const void *y) |
mcmp (const void *x, const void *y) |
46 |
{ |
{ |
47 |
return strcmp (((muscle_entry_t*) x)->key, ((muscle_entry_t *) y)->key); |
return strcmp (((const muscle_entry_t*) x)->key, |
48 |
|
((const muscle_entry_t *) y)->key); |
49 |
} |
} |
50 |
|
|
51 |
void |
void |
106 |
muscle_insert ("name", "Parser"); |
muscle_insert ("name", "Parser"); |
107 |
} |
} |
108 |
|
|
109 |
void |
void |
110 |
muscle_insert (const char *key, const char *value) |
muscle_insert (const char *key, const char *value) |
111 |
{ |
{ |
112 |
muscle_entry_t *pair = XMALLOC (muscle_entry_t, 1); |
muscle_entry_t *pair = XMALLOC (muscle_entry_t, 1); |