Sound Design Toolkit  078
Physically informed sound synthesis for everyday sounds
SDTStructs.h: Common data structures

Typedefs

typedef struct SDTHashmap SDTHashmap
 Opaque data structure for a hashmap object.
 
typedef struct SDTHashmap SDTHashmap
 Opaque data structure for a hashmap object.
 

Functions

SDTHashmapSDTHashmap_new (int size)
 Object constructor. More...
 
void SDTHashmap_free (SDTHashmap *x)
 Object destructor. More...
 
void * SDTHashmap_get (SDTHashmap *x, char *key)
 Looks for an entry with the given key in the hashmap. More...
 
int SDTHashmap_put (SDTHashmap *x, char *key, void *value)
 Inserts a key/value pair in the hashmap. More...
 
int SDTHashmap_del (SDTHashmap *x, char *key)
 Deletes a key/value pair from the hashmap. More...
 
void SDTHashmap_clear (SDTHashmap *x)
 Deletes all the entries in the hashmap.
 

Detailed Description

Function Documentation

int SDTHashmap_del ( SDTHashmap x,
char *  key 
)

Deletes a key/value pair from the hashmap.

Parameters
[in]keyKey to look for in the hashmap
Returns
0 if deletion is succesful, 1 otherwise (e.g. key not found)
void SDTHashmap_free ( SDTHashmap x)

Object destructor.

Parameters
[in]xpointer to the instance to destroy
void * SDTHashmap_get ( SDTHashmap x,
char *  key 
)

Looks for an entry with the given key in the hashmap.

Parameters
[in]keyKey to look for in the hashmap
Returns
Value associated to the key if found, NULL otherwise
SDTHashmap * SDTHashmap_new ( int  size)

Object constructor.

Parameters
[in]sizeNumber of bins in the hashmap
Returns
Pointer to the new instance
int SDTHashmap_put ( SDTHashmap x,
char *  key,
void *  value 
)

Inserts a key/value pair in the hashmap.

Parameters
[in]keyKey to associate to the value
[in]valueValue to insert in the hashmap
Returns
0 if insertion is succesful, 1 otherwise (e.g. key already present)