PLplot 5.15.0
Loading...
Searching...
No Matches
hash.c File Reference
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include "hash.h"
#include "math.h"

Go to the source code of this file.

Classes

struct  ht_bucket
 
struct  hashtable
 

Macros

#define INT_PER_DOUBLE   2
 

Typedefs

typedef struct ht_bucket ht_bucket
 

Functions

int d1eq (void *key1, void *key2)
 
hashtableht_create (int size, ht_keycp cp, ht_keyeq eq, ht_key2hash hash)
 
void ht_destroy (hashtable *table)
 
void * ht_insert (hashtable *table, void *key, void *data)
 
void * ht_find (hashtable *table, void *key)
 
void * ht_delete (hashtable *table, void *key)
 
void ht_process (hashtable *table, void(*func)(void *))
 
static unsigned int strhash (void *key)
 
static void * strcp (void *key)
 
static int streq (void *key1, void *key2)
 
static unsigned int d1hash (void *key)
 
static void * d1cp (void *key)
 
static unsigned int d2hash (void *key)
 
static void * d2cp (void *key)
 
static int d2eq (void *key1, void *key2)
 
hashtableht_create_d1 (int size)
 
hashtableht_create_d2 (int size)
 
hashtableht_create_str (int size)
 

Macro Definition Documentation

◆ INT_PER_DOUBLE

#define INT_PER_DOUBLE   2

Definition at line 22 of file hash.c.

Typedef Documentation

◆ ht_bucket

typedef struct ht_bucket ht_bucket

Function Documentation

◆ d1cp()

static void * d1cp ( void * key)
static

Definition at line 346 of file hash.c.

◆ d1eq()

int d1eq ( void * key1,
void * key2 )

Definition at line 355 of file hash.c.

◆ d1hash()

static unsigned int d1hash ( void * key)
static

Definition at line 335 of file hash.c.

◆ d2cp()

static void * d2cp ( void * key)
static

Definition at line 381 of file hash.c.

◆ d2eq()

static int d2eq ( void * key1,
void * key2 )
static

Definition at line 391 of file hash.c.

◆ d2hash()

static unsigned int d2hash ( void * key)
static

Definition at line 366 of file hash.c.

◆ ht_create()

hashtable * ht_create ( int size,
ht_keycp cp,
ht_keyeq eq,
ht_key2hash hash )

Definition at line 54 of file hash.c.

◆ ht_create_d1()

hashtable * ht_create_d1 ( int size)

Definition at line 396 of file hash.c.

◆ ht_create_d2()

hashtable * ht_create_d2 ( int size)

Definition at line 401 of file hash.c.

◆ ht_create_str()

hashtable * ht_create_str ( int size)

Definition at line 406 of file hash.c.

◆ ht_delete()

void * ht_delete ( hashtable * table,
void * key )

Definition at line 233 of file hash.c.

◆ ht_destroy()

void ht_destroy ( hashtable * table)

Definition at line 102 of file hash.c.

◆ ht_find()

void * ht_find ( hashtable * table,
void * key )

Definition at line 210 of file hash.c.

◆ ht_insert()

void * ht_insert ( hashtable * table,
void * key,
void * data )

Definition at line 135 of file hash.c.

◆ ht_process()

void ht_process ( hashtable * table,
void(*)(void *) func )

Definition at line 290 of file hash.c.

◆ strcp()

static void * strcp ( void * key)
static

Definition at line 323 of file hash.c.

◆ streq()

static int streq ( void * key1,
void * key2 )
static

Definition at line 328 of file hash.c.

◆ strhash()

static unsigned int strhash ( void * key)
static

Definition at line 308 of file hash.c.