php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
hash.h File Reference

Go to the source code of this file.

Data Structures

struct  lexbor_hash_entry
 
struct  lexbor_hash
 
struct  lexbor_hash_insert
 
struct  lexbor_hash_search
 

Macros

#define LEXBOR_HASH_SHORT_SIZE   16
 
#define LEXBOR_HASH_TABLE_MIN_SIZE   32
 

Typedefs

typedef struct lexbor_hash_search lexbor_hash_search_t
 
typedef struct lexbor_hash_insert lexbor_hash_insert_t
 
typedef struct lexbor_hash lexbor_hash_t
 
typedef struct lexbor_hash_entry lexbor_hash_entry_t
 
typedef uint32_t(* lexbor_hash_id_f) (const lxb_char_t *key, size_t size)
 
typedef lxb_status_t(* lexbor_hash_copy_f) (lexbor_hash_t *hash, lexbor_hash_entry_t *entry, const lxb_char_t *key, size_t size)
 
typedef bool(* lexbor_hash_cmp_f) (const lxb_char_t *first, const lxb_char_t *second, size_t size)
 

Functions

LXB_API lexbor_hash_tlexbor_hash_create (void)
 
LXB_API lxb_status_t lexbor_hash_init (lexbor_hash_t *hash, size_t table_size, size_t struct_size)
 
LXB_API void lexbor_hash_clean (lexbor_hash_t *hash)
 
LXB_API lexbor_hash_tlexbor_hash_destroy (lexbor_hash_t *hash, bool destroy_obj)
 
LXB_API voidlexbor_hash_insert (lexbor_hash_t *hash, const lexbor_hash_insert_t *insert, const lxb_char_t *key, size_t length)
 
LXB_API voidlexbor_hash_insert_by_entry (lexbor_hash_t *hash, lexbor_hash_entry_t *entry, const lexbor_hash_search_t *search, const lxb_char_t *key, size_t length)
 
LXB_API void lexbor_hash_remove (lexbor_hash_t *hash, const lexbor_hash_search_t *search, const lxb_char_t *key, size_t length)
 
LXB_API voidlexbor_hash_search (lexbor_hash_t *hash, const lexbor_hash_search_t *search, const lxb_char_t *key, size_t length)
 
LXB_API void lexbor_hash_remove_by_hash_id (lexbor_hash_t *hash, uint32_t hash_id, const lxb_char_t *key, size_t length, const lexbor_hash_cmp_f cmp_func)
 
LXB_API voidlexbor_hash_search_by_hash_id (lexbor_hash_t *hash, uint32_t hash_id, const lxb_char_t *key, size_t length, const lexbor_hash_cmp_f cmp_func)
 
LXB_API uint32_t lexbor_hash_make_id (const lxb_char_t *key, size_t length)
 
LXB_API uint32_t lexbor_hash_make_id_lower (const lxb_char_t *key, size_t length)
 
LXB_API uint32_t lexbor_hash_make_id_upper (const lxb_char_t *key, size_t length)
 
LXB_API lxb_status_t lexbor_hash_copy (lexbor_hash_t *hash, lexbor_hash_entry_t *entry, const lxb_char_t *key, size_t length)
 
LXB_API lxb_status_t lexbor_hash_copy_lower (lexbor_hash_t *hash, lexbor_hash_entry_t *entry, const lxb_char_t *key, size_t length)
 
LXB_API lxb_status_t lexbor_hash_copy_upper (lexbor_hash_t *hash, lexbor_hash_entry_t *entry, const lxb_char_t *key, size_t length)
 
lxb_inline lexbor_mraw_tlexbor_hash_mraw (const lexbor_hash_t *hash)
 
lxb_inline lxb_char_tlexbor_hash_entry_str (const lexbor_hash_entry_t *entry)
 
lxb_inline lxb_char_tlexbor_hash_entry_str_set (lexbor_hash_entry_t *entry, lxb_char_t *data, size_t length)
 
lxb_inline void lexbor_hash_entry_str_free (lexbor_hash_t *hash, lexbor_hash_entry_t *entry)
 
lxb_inline lexbor_hash_entry_tlexbor_hash_entry_create (lexbor_hash_t *hash)
 
lxb_inline lexbor_hash_entry_tlexbor_hash_entry_destroy (lexbor_hash_t *hash, lexbor_hash_entry_t *entry)
 
lxb_inline size_t lexbor_hash_entries_count (lexbor_hash_t *hash)
 

Variables

LXB_EXTERN const lexbor_hash_insert_tlexbor_hash_insert_raw
 
LXB_EXTERN const lexbor_hash_insert_tlexbor_hash_insert_lower
 
LXB_EXTERN const lexbor_hash_insert_tlexbor_hash_insert_upper
 
LXB_EXTERN const lexbor_hash_search_tlexbor_hash_search_raw
 
LXB_EXTERN const lexbor_hash_search_tlexbor_hash_search_lower
 
LXB_EXTERN const lexbor_hash_search_tlexbor_hash_search_upper
 

Macro Definition Documentation

◆ LEXBOR_HASH_SHORT_SIZE

#define LEXBOR_HASH_SHORT_SIZE   16

Definition at line 18 of file hash.h.

◆ LEXBOR_HASH_TABLE_MIN_SIZE

#define LEXBOR_HASH_TABLE_MIN_SIZE   32

Definition at line 19 of file hash.h.

Typedef Documentation

◆ lexbor_hash_cmp_f

typedef bool(* lexbor_hash_cmp_f) (const lxb_char_t *first, const lxb_char_t *second, size_t size)

Definition at line 51 of file hash.h.

◆ lexbor_hash_copy_f

typedef lxb_status_t(* lexbor_hash_copy_f) (lexbor_hash_t *hash, lexbor_hash_entry_t *entry, const lxb_char_t *key, size_t size)

Definition at line 47 of file hash.h.

◆ lexbor_hash_entry_t

Definition at line 42 of file hash.h.

◆ lexbor_hash_id_f

typedef uint32_t(* lexbor_hash_id_f) (const lxb_char_t *key, size_t size)

Definition at line 44 of file hash.h.

◆ lexbor_hash_insert_t

Definition at line 23 of file hash.h.

◆ lexbor_hash_search_t

Definition at line 22 of file hash.h.

◆ lexbor_hash_t

typedef struct lexbor_hash lexbor_hash_t

Definition at line 41 of file hash.h.

Function Documentation

◆ lexbor_hash_clean()

LXB_API void lexbor_hash_clean ( lexbor_hash_t * hash)

Definition at line 160 of file hash.c.

◆ lexbor_hash_copy()

LXB_API lxb_status_t lexbor_hash_copy ( lexbor_hash_t * hash,
lexbor_hash_entry_t * entry,
const lxb_char_t * key,
size_t length )

Definition at line 400 of file hash.c.

◆ lexbor_hash_copy_lower()

LXB_API lxb_status_t lexbor_hash_copy_lower ( lexbor_hash_t * hash,
lexbor_hash_entry_t * entry,
const lxb_char_t * key,
size_t length )

Definition at line 425 of file hash.c.

◆ lexbor_hash_copy_upper()

LXB_API lxb_status_t lexbor_hash_copy_upper ( lexbor_hash_t * hash,
lexbor_hash_entry_t * entry,
const lxb_char_t * key,
size_t length )

Definition at line 452 of file hash.c.

◆ lexbor_hash_create()

LXB_API lexbor_hash_t * lexbor_hash_create ( void )

Definition at line 114 of file hash.c.

◆ lexbor_hash_destroy()

LXB_API lexbor_hash_t * lexbor_hash_destroy ( lexbor_hash_t * hash,
bool destroy_obj )

Definition at line 168 of file hash.c.

◆ lexbor_hash_entries_count()

lxb_inline size_t lexbor_hash_entries_count ( lexbor_hash_t * hash)

Definition at line 208 of file hash.h.

◆ lexbor_hash_entry_create()

lxb_inline lexbor_hash_entry_t * lexbor_hash_entry_create ( lexbor_hash_t * hash)

Definition at line 196 of file hash.h.

◆ lexbor_hash_entry_destroy()

lxb_inline lexbor_hash_entry_t * lexbor_hash_entry_destroy ( lexbor_hash_t * hash,
lexbor_hash_entry_t * entry )

Definition at line 202 of file hash.h.

◆ lexbor_hash_entry_str()

lxb_inline lxb_char_t * lexbor_hash_entry_str ( const lexbor_hash_entry_t * entry)

Definition at line 161 of file hash.h.

◆ lexbor_hash_entry_str_free()

lxb_inline void lexbor_hash_entry_str_free ( lexbor_hash_t * hash,
lexbor_hash_entry_t * entry )

Definition at line 186 of file hash.h.

◆ lexbor_hash_entry_str_set()

lxb_inline lxb_char_t * lexbor_hash_entry_str_set ( lexbor_hash_entry_t * entry,
lxb_char_t * data,
size_t length )

Definition at line 171 of file hash.h.

◆ lexbor_hash_init()

LXB_API lxb_status_t lexbor_hash_init ( lexbor_hash_t * hash,
size_t table_size,
size_t struct_size )

Definition at line 120 of file hash.c.

◆ lexbor_hash_insert()

LXB_API void * lexbor_hash_insert ( lexbor_hash_t * hash,
const lexbor_hash_insert_t * insert,
const lxb_char_t * key,
size_t length )

Definition at line 186 of file hash.c.

◆ lexbor_hash_insert_by_entry()

LXB_API void * lexbor_hash_insert_by_entry ( lexbor_hash_t * hash,
lexbor_hash_entry_t * entry,
const lexbor_hash_search_t * search,
const lxb_char_t * key,
size_t length )

Definition at line 226 of file hash.c.

◆ lexbor_hash_make_id()

LXB_API uint32_t lexbor_hash_make_id ( const lxb_char_t * key,
size_t length )

Definition at line 343 of file hash.c.

◆ lexbor_hash_make_id_lower()

LXB_API uint32_t lexbor_hash_make_id_lower ( const lxb_char_t * key,
size_t length )

Definition at line 362 of file hash.c.

◆ lexbor_hash_make_id_upper()

LXB_API uint32_t lexbor_hash_make_id_upper ( const lxb_char_t * key,
size_t length )

Definition at line 381 of file hash.c.

◆ lexbor_hash_mraw()

lxb_inline lexbor_mraw_t * lexbor_hash_mraw ( const lexbor_hash_t * hash)

Definition at line 155 of file hash.h.

◆ lexbor_hash_remove()

LXB_API void lexbor_hash_remove ( lexbor_hash_t * hash,
const lexbor_hash_search_t * search,
const lxb_char_t * key,
size_t length )

Definition at line 266 of file hash.c.

◆ lexbor_hash_remove_by_hash_id()

LXB_API void lexbor_hash_remove_by_hash_id ( lexbor_hash_t * hash,
uint32_t hash_id,
const lxb_char_t * key,
size_t length,
const lexbor_hash_cmp_f cmp_func )

Definition at line 282 of file hash.c.

◆ lexbor_hash_search()

LXB_API void * lexbor_hash_search ( lexbor_hash_t * hash,
const lexbor_hash_search_t * search,
const lxb_char_t * key,
size_t length )

Definition at line 274 of file hash.c.

◆ lexbor_hash_search_by_hash_id()

LXB_API void * lexbor_hash_search_by_hash_id ( lexbor_hash_t * hash,
uint32_t hash_id,
const lxb_char_t * key,
size_t length,
const lexbor_hash_cmp_f cmp_func )

Definition at line 320 of file hash.c.

Variable Documentation

◆ lexbor_hash_insert_lower

LXB_EXTERN const lexbor_hash_insert_t* lexbor_hash_insert_lower

Definition at line 27 of file hash.h.

◆ lexbor_hash_insert_raw

LXB_EXTERN const lexbor_hash_insert_t* lexbor_hash_insert_raw

Definition at line 26 of file hash.h.

◆ lexbor_hash_insert_upper

LXB_EXTERN const lexbor_hash_insert_t* lexbor_hash_insert_upper

Definition at line 28 of file hash.h.

◆ lexbor_hash_search_lower

LXB_EXTERN const lexbor_hash_search_t* lexbor_hash_search_lower

Definition at line 31 of file hash.h.

◆ lexbor_hash_search_raw

LXB_EXTERN const lexbor_hash_search_t* lexbor_hash_search_raw

Definition at line 30 of file hash.h.

◆ lexbor_hash_search_upper

LXB_EXTERN const lexbor_hash_search_t* lexbor_hash_search_upper

Definition at line 32 of file hash.h.