mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
* lib/hash.h, lib/hash.c (__P): Renamed to PARAMS; canonical definition used.
This commit is contained in:
@@ -24,8 +24,8 @@
|
||||
#include "system.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
static void hash_rehash __P((struct hash_table* ht));
|
||||
static unsigned long round_up_2 __P((unsigned long rough));
|
||||
static void hash_rehash PARAMS((struct hash_table* ht));
|
||||
static unsigned long round_up_2 PARAMS((unsigned long rough));
|
||||
|
||||
/* Implement double hashing with open addressing. The table size is
|
||||
always a power of two. The secondary (`increment') hash function
|
||||
|
||||
52
lib/hash.h
52
lib/hash.h
@@ -21,15 +21,17 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
|
||||
#define __P(args) args
|
||||
#else
|
||||
#define __P(args) ()
|
||||
#endif /* GCC. */
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || defined __STDC__
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef unsigned long (*hash_func_t) __P((void const *key));
|
||||
typedef int (*hash_cmp_func_t) __P((void const *x, void const *y));
|
||||
typedef void (*hash_map_func_t) __P((void const *item));
|
||||
typedef unsigned long (*hash_func_t) PARAMS((void const *key));
|
||||
typedef int (*hash_cmp_func_t) PARAMS((void const *x, void const *y));
|
||||
typedef void (*hash_map_func_t) PARAMS((void const *item));
|
||||
|
||||
struct hash_table
|
||||
{
|
||||
@@ -45,24 +47,24 @@ struct hash_table
|
||||
hash_cmp_func_t ht_compare; /* comparison function */
|
||||
};
|
||||
|
||||
typedef int (*qsort_cmp_t) __P((void const *, void const *));
|
||||
typedef int (*qsort_cmp_t) PARAMS((void const *, void const *));
|
||||
|
||||
void hash_init __P((struct hash_table *ht, unsigned long size,
|
||||
hash_func_t hash_1, hash_func_t hash_2, hash_cmp_func_t hash_cmp));
|
||||
void hash_load __P((struct hash_table *ht, void *item_table,
|
||||
unsigned long cardinality, unsigned long size));
|
||||
void **hash_find_slot __P((struct hash_table *ht, void const *key));
|
||||
void *hash_find_item __P((struct hash_table *ht, void const *key));
|
||||
const void *hash_insert __P((struct hash_table *ht, void *item));
|
||||
const void *hash_insert_at __P((struct hash_table *ht, void *item, void const *slot));
|
||||
const void *hash_delete __P((struct hash_table *ht, void const *item));
|
||||
const void *hash_delete_at __P((struct hash_table *ht, void const *slot));
|
||||
void hash_delete_items __P((struct hash_table *ht));
|
||||
void hash_free_items __P((struct hash_table *ht));
|
||||
void hash_free __P((struct hash_table *ht, int free_items));
|
||||
void hash_map __P((struct hash_table *ht, hash_map_func_t map));
|
||||
void hash_print_stats __P((struct hash_table *ht, FILE *out_FILE));
|
||||
void **hash_dump __P((struct hash_table *ht, void **vector_0, qsort_cmp_t compare));
|
||||
void hash_init PARAMS((struct hash_table *ht, unsigned long size,
|
||||
hash_func_t hash_1, hash_func_t hash_2, hash_cmp_func_t hash_cmp));
|
||||
void hash_load PARAMS((struct hash_table *ht, void *item_table,
|
||||
unsigned long cardinality, unsigned long size));
|
||||
void **hash_find_slot PARAMS((struct hash_table *ht, void const *key));
|
||||
void *hash_find_item PARAMS((struct hash_table *ht, void const *key));
|
||||
const void *hash_insert PARAMS((struct hash_table *ht, void *item));
|
||||
const void *hash_insert_at PARAMS((struct hash_table *ht, void *item, void const *slot));
|
||||
const void *hash_delete PARAMS((struct hash_table *ht, void const *item));
|
||||
const void *hash_delete_at PARAMS((struct hash_table *ht, void const *slot));
|
||||
void hash_delete_items PARAMS((struct hash_table *ht));
|
||||
void hash_free_items PARAMS((struct hash_table *ht));
|
||||
void hash_free PARAMS((struct hash_table *ht, int free_items));
|
||||
void hash_map PARAMS((struct hash_table *ht, hash_map_func_t map));
|
||||
void hash_print_stats PARAMS((struct hash_table *ht, FILE *out_FILE));
|
||||
void **hash_dump PARAMS((struct hash_table *ht, void **vector_0, qsort_cmp_t compare));
|
||||
|
||||
extern void *hash_deleted_item;
|
||||
#define HASH_VACANT(item) \
|
||||
|
||||
Reference in New Issue
Block a user