GNU PROLOG with UTF8 support
Data Structures | Macros | Typedefs | Functions
hash.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "engine_pl.h"
Include dependency graph for hash.c:

Data Structures

struct  hash_node
 

Macros

#define HASH_STATIC_SIZE   3
 
#define Tbl_Size(t)   (((int *)(t))[0])
 
#define Elem_Size(t)   (((int *)(t))[1])
 
#define Nb_Elem(t)   (((int *)(t))[2])
 
#define Hsh_Table(t)   (((HashNode *) (t)) + HASH_STATIC_SIZE)
 
#define Hash_Function(k, size)   ((PlULong) (k) % (size))
 

Typedefs

typedef struct hash_nodeHashNode
 

Functions

static HashNodeHash_Locate (HashNode *t, int tbl_size, PlLong key)
 
char * Pl_Hash_Alloc_Table (int tbl_size, int elem_size)
 
char * Pl_Hash_Realloc_Table (char *tbl, int new_tbl_size)
 
void Pl_Hash_Free_Table (char *tbl)
 
void Pl_Hash_Delete_All (char *tbl)
 
char * Pl_Hash_Insert (char *tbl, char *elem, int replace)
 
char * Pl_Hash_Find (char *tbl, PlLong key)
 
char * Pl_Hash_Delete (char *tbl, PlLong key)
 
char * Pl_Hash_First (char *tbl, HashScan *scan)
 
char * Pl_Hash_Next (HashScan *scan)
 
int Pl_Hash_Table_Size (char *tbl)
 
int Pl_Hash_Nb_Elements (char *tbl)
 

Macro Definition Documentation

#define Elem_Size (   t)    (((int *)(t))[1])
#define Hash_Function (   k,
  size 
)    ((PlULong) (k) % (size))
#define HASH_STATIC_SIZE   3
#define Hsh_Table (   t)    (((HashNode *) (t)) + HASH_STATIC_SIZE)
#define Nb_Elem (   t)    (((int *)(t))[2])
#define Tbl_Size (   t)    (((int *)(t))[0])

Typedef Documentation

typedef struct hash_node* HashNode

Function Documentation

static HashNode * Hash_Locate ( HashNode t,
int  tbl_size,
PlLong  key 
)
static

Here is the caller graph for this function:

char* Pl_Hash_Alloc_Table ( int  tbl_size,
int  elem_size 
)

Here is the caller graph for this function:

char* Pl_Hash_Delete ( char *  tbl,
PlLong  key 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Pl_Hash_Delete_All ( char *  tbl)

Here is the caller graph for this function:

char* Pl_Hash_Find ( char *  tbl,
PlLong  key 
)

Here is the call graph for this function:

Here is the caller graph for this function:

char* Pl_Hash_First ( char *  tbl,
HashScan scan 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Pl_Hash_Free_Table ( char *  tbl)

Here is the caller graph for this function:

char* Pl_Hash_Insert ( char *  tbl,
char *  elem,
int  replace 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int Pl_Hash_Nb_Elements ( char *  tbl)

Here is the call graph for this function:

Here is the caller graph for this function:

char* Pl_Hash_Next ( HashScan scan)

Here is the caller graph for this function:

char* Pl_Hash_Realloc_Table ( char *  tbl,
int  new_tbl_size 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int Pl_Hash_Table_Size ( char *  tbl)

Here is the caller graph for this function: