mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-10 21:50:49 +02:00
Bash-5.3-alpha release
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* hashlib.h -- the data structures used in hashing in Bash. */
|
||||
|
||||
/* Copyright (C) 1993-2020 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993-2022 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -24,11 +24,7 @@
|
||||
#include "stdc.h"
|
||||
|
||||
#ifndef PTR_T
|
||||
# ifdef __STDC__
|
||||
# define PTR_T void *
|
||||
# else
|
||||
# define PTR_T char *
|
||||
# endif
|
||||
# define PTR_T void *
|
||||
#endif
|
||||
|
||||
typedef struct bucket_contents {
|
||||
@@ -45,26 +41,26 @@ typedef struct hash_table {
|
||||
int nentries; /* How many entries does this table have. */
|
||||
} HASH_TABLE;
|
||||
|
||||
typedef int hash_wfunc PARAMS((BUCKET_CONTENTS *));
|
||||
typedef int hash_wfunc (BUCKET_CONTENTS *);
|
||||
|
||||
/* Operations on tables as a whole */
|
||||
extern HASH_TABLE *hash_create PARAMS((int));
|
||||
extern HASH_TABLE *hash_copy PARAMS((HASH_TABLE *, sh_string_func_t *));
|
||||
extern void hash_flush PARAMS((HASH_TABLE *, sh_free_func_t *));
|
||||
extern void hash_dispose PARAMS((HASH_TABLE *));
|
||||
extern void hash_walk PARAMS((HASH_TABLE *, hash_wfunc *));
|
||||
extern HASH_TABLE *hash_create (int);
|
||||
extern HASH_TABLE *hash_copy (HASH_TABLE *, sh_string_func_t *);
|
||||
extern void hash_flush (HASH_TABLE *, sh_free_func_t *);
|
||||
extern void hash_dispose (HASH_TABLE *);
|
||||
extern void hash_walk (HASH_TABLE *, hash_wfunc *);
|
||||
|
||||
/* Operations to extract information from or pieces of tables */
|
||||
extern int hash_bucket PARAMS((const char *, HASH_TABLE *));
|
||||
extern int hash_size PARAMS((HASH_TABLE *));
|
||||
extern int hash_bucket (const char *, HASH_TABLE *);
|
||||
extern int hash_size (HASH_TABLE *);
|
||||
|
||||
/* Operations on hash table entries */
|
||||
extern BUCKET_CONTENTS *hash_search PARAMS((const char *, HASH_TABLE *, int));
|
||||
extern BUCKET_CONTENTS *hash_insert PARAMS((char *, HASH_TABLE *, int));
|
||||
extern BUCKET_CONTENTS *hash_remove PARAMS((const char *, HASH_TABLE *, int));
|
||||
extern BUCKET_CONTENTS *hash_search (const char *, HASH_TABLE *, int);
|
||||
extern BUCKET_CONTENTS *hash_insert (char *, HASH_TABLE *, int);
|
||||
extern BUCKET_CONTENTS *hash_remove (const char *, HASH_TABLE *, int);
|
||||
|
||||
/* Miscellaneous */
|
||||
extern unsigned int hash_string PARAMS((const char *));
|
||||
extern unsigned int hash_string (const char *);
|
||||
|
||||
/* Redefine the function as a macro for speed. */
|
||||
#define hash_items(bucket, table) \
|
||||
@@ -81,12 +77,4 @@ extern unsigned int hash_string PARAMS((const char *));
|
||||
#define HASH_NOSRCH 0x01
|
||||
#define HASH_CREATE 0x02
|
||||
|
||||
#if !defined (NULL)
|
||||
# if defined (__STDC__)
|
||||
# define NULL ((void *) 0)
|
||||
# else
|
||||
# define NULL 0x0
|
||||
# endif /* !__STDC__ */
|
||||
#endif /* !NULL */
|
||||
|
||||
#endif /* _HASHLIB_H */
|
||||
|
||||
Reference in New Issue
Block a user