Tachyon (current)  Current Main Branch
Data Structures | Macros | Typedefs | Functions
hash.h File Reference

Go to the source code of this file.

Data Structures

struct  rt_hash_t
 

Macros

#define HASH_FAIL   -1
 Return code when a hash key is not find, or there's no collision upon insertion. More...
 

Typedefs

typedef struct rt_hash_t rt_hash_t
 

Functions

void rt_hash_init (rt_hash_t *, int)
 
int rt_hash_lookup (rt_hash_t *, const char *)
 
int rt_hash_insert (rt_hash_t *, const char *, int)
 
int rt_hash_delete (rt_hash_t *, const char *)
 
void rt_hash_destroy (rt_hash_t *)
 
char * rt_hash_stats (rt_hash_t *)
 

Macro Definition Documentation

◆ HASH_FAIL

#define HASH_FAIL   -1

Return code when a hash key is not find, or there's no collision upon insertion.

Definition at line 30 of file hash.h.

Referenced by find_texture(), rt_hash_delete(), rt_hash_insert(), and rt_hash_lookup().

Typedef Documentation

◆ rt_hash_t

typedef struct rt_hash_t rt_hash_t

Function Documentation

◆ rt_hash_delete()

int rt_hash_delete ( rt_hash_t ,
const char *   
)

◆ rt_hash_destroy()

void rt_hash_destroy ( rt_hash_t )

Definition at line 218 of file hash.c.

References rt_hash_t::bucket, hash_node_t::next, and rt_hash_t::size.

Referenced by free_tex_table().

◆ rt_hash_init()

void rt_hash_init ( rt_hash_t ,
int   
)

◆ rt_hash_insert()

int rt_hash_insert ( rt_hash_t ,
const char *  ,
int   
)

◆ rt_hash_lookup()

int rt_hash_lookup ( rt_hash_t ,
const char *   
)

◆ rt_hash_stats()

char* rt_hash_stats ( rt_hash_t )

Definition at line 264 of file hash.c.

References alos(), rt_hash_t::entries, and rt_hash_t::size.