CUBRID Engine
latest
|
#include "config.h"
#include <stdlib.h>
#include "util_func.h"
#include "misc_string.h"
#include "esql_hash.h"
#include "esql_misc.h"
#include "memory_alloc.h"
Go to the source code of this file.
Classes | |
struct | bucket |
struct | hash_tab_impl |
Typedefs | |
typedef struct bucket | BUCKET |
typedef struct hash_tab_impl | HASH_TAB_IMPL |
Enumerations | |
enum | { MSG_INTERNAL_ERROR = 1, MSG_TABLE_OVERFLOW = 2 } |
Functions | |
static void | es_write_log (const char *fname, const char *msg) |
static int | es_symcmp (const void *p1, const void *p2) |
static void | es_ht_free_table (HASH_TAB *table, HT_FREE_FN free_fn) |
static void * | es_ht_add_symbol (HASH_TAB *table, void *sym) |
static void | es_ht_remove_symbol (HASH_TAB *table, void *sym) |
static void * | es_ht_find_symbol (HASH_TAB *table, void *sym) |
static void * | es_ht_next_symbol (HASH_TAB *tbl, void *last_sym) |
static int | es_ht_print_table (HASH_TAB *table, void(*print)(BUCKET *, void *), void *param, int sort) |
static int | es_ht_get_symbol_count (HASH_TAB *table) |
void * | es_ht_alloc_new_symbol (int size) |
void | es_ht_free_symbol (void *sym) |
HASH_TAB * | es_ht_make_table (unsigned maxsym, HT_HASH_FN hash_function, HT_CMP_FN cmp_function) |
Variables | |
static HT_CMP_FN | es_User_cmp |
Definition at line 35 of file esql_hash.c.
typedef struct hash_tab_impl HASH_TAB_IMPL |
Definition at line 42 of file esql_hash.c.
anonymous enum |
Enumerator | |
---|---|
MSG_INTERNAL_ERROR | |
MSG_TABLE_OVERFLOW |
Definition at line 53 of file esql_hash.c.
|
static |
Definition at line 144 of file esql_hash.c.
References hash_tab_impl::hash, if(), bucket::next, hash_tab_impl::numsyms, p, bucket::prev, hash_tab_impl::size, and hash_tab_impl::table.
Referenced by es_ht_make_table().
void* es_ht_alloc_new_symbol | ( | int | size | ) |
Definition at line 351 of file esql_hash.c.
References NULL, and pp_malloc().
Referenced by pp_new_cursor(), pp_new_stmt(), pp_new_structdef(), and pp_new_symbol().
|
static |
Definition at line 199 of file esql_hash.c.
References hash_tab_impl::cmp, hash_tab_impl::hash, bucket::next, NULL, p, hash_tab_impl::size, hash_tab_impl::table, and while().
Referenced by es_ht_make_table().
void es_ht_free_symbol | ( | void * | sym | ) |
Definition at line 369 of file esql_hash.c.
References free_and_init.
Referenced by pp_discard_structdef(), pp_discard_symbol(), pp_free_cursor(), pp_free_stmt(), and pp_symbol_finish().
|
static |
Definition at line 113 of file esql_hash.c.
References free_and_init, i, bucket::next, NULL, hash_tab_impl::size, and hash_tab_impl::table.
Referenced by es_ht_make_table().
|
static |
Definition at line 338 of file esql_hash.c.
References hash_tab_impl::numsyms.
Referenced by es_ht_make_table().
HASH_TAB* es_ht_make_table | ( | unsigned | maxsym, |
HT_HASH_FN | hash_function, | ||
HT_CMP_FN | cmp_function | ||
) |
Definition at line 383 of file esql_hash.c.
References hash_tab_s::add_symbol, hash_tab_impl::cmp, es_ht_add_symbol(), es_ht_find_symbol(), es_ht_free_table(), es_ht_get_symbol_count(), es_ht_next_symbol(), es_ht_print_table(), es_ht_remove_symbol(), hash_tab_s::find_symbol, hash_tab_s::free_table, hash_tab_s::get_symbol_count, hash_tab_impl::hash, hash_tab_impl::ifs, hash_tab_s::next_symbol, hash_tab_impl::numsyms, p, pp_malloc(), hash_tab_s::print_table, hash_tab_s::remove_symbol, and hash_tab_impl::size.
Referenced by pp_cursor_init(), and pp_new_symtab().
|
static |
Definition at line 229 of file esql_hash.c.
References hash_tab_impl::cmp, bucket::next, and NULL.
Referenced by es_ht_make_table().
|
static |
Definition at line 261 of file esql_hash.c.
References hash_tab_impl::cmp, es_symcmp(), es_User_cmp, es_write_log(), EX_HASH_SET, free_and_init, i, MSG_TABLE_OVERFLOW, bucket::next, NULL, hash_tab_impl::numsyms, pp_get_msg(), pp_malloc(), hash_tab_impl::size, and hash_tab_impl::table.
Referenced by es_ht_make_table().
|
static |
Definition at line 174 of file esql_hash.c.
References if(), bucket::next, hash_tab_impl::numsyms, and bucket::prev.
Referenced by es_ht_make_table().
Definition at line 100 of file esql_hash.c.
References es_User_cmp.
Referenced by es_ht_print_table().
Definition at line 81 of file esql_hash.c.
References EX_HASH_SET, free_and_init, MSG_INTERNAL_ERROR, pp_get_msg(), and pp_strdup().
Referenced by es_ht_print_table().
|
static |
Definition at line 61 of file esql_hash.c.
Referenced by es_ht_print_table(), and es_symcmp().