Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

sobj_dict.c File Reference


Detailed Description

Fast simple object dictionaries.

This file implements a fast string to simple object mapping. These mappings can be used as separate objects (which are not simple object instances).

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include "sobject_p.h"

Include dependency graph for sobj_dict.c:

Include dependency graph

Data Structures

struct  sobj_dict_element
 Element of a simple object dictionary. More...
struct  sobj_dict
 Simple object dictionary. More...

Functions

void sobj_dict_init (struct sobj_dict *)
 Initialize an instance of a simple object dictionary.
void sobj_dict_deinit (struct sobj_dict *)
 De-initialize a simple object dictionary instance.
void sobj_dict_delete_callback (void *)
 Destructor callback function for simple object dictionaries.
sobj_dictnew_sobj_dict (void)
 Create a new (empty) dictionary object.
sobj_dictnew_sobj_dict_from_array (struct sobj *sobj)
 Create a new dictionary object from an array object.
sobj_dictnew_sobj_dict_from_vec (unsigned n, const char **key, struct sobj **value)
 Create a new dictionary object from a vector of key/value pairs.
sobj_dictnew_sobj_dict_from_dict (struct sobj_dict *sobj_dict)
 Create a new dictionary object from a dictionary.
sobj_dictsobj_dict_clone (struct sobj_dict *sobj_dict)
 Create a flat copy of a dictionary object.
bool sobj_dict_put (struct sobj_dict *sobj_dict, const char *key, struct sobj *value)
 Insert an object into a dictionary.
bool sobj_dict_put_unlocked (struct sobj_dict *sobj_dict, const char *key, struct sobj *value)
 Insert an object into a dictionary.
sobjsobj_dict_get (struct sobj_dict *sobj_dict, const char *key)
 Get an object from the dictionary.
sobjsobj_dict_get_unlocked (struct sobj_dict *sobj_dict, const char *key)
 Get an object from the dictionary.
bool sobj_dict_remove (struct sobj_dict *sobj_dict, const char *key)
 Remove an object from a dictionary.
bool sobj_dict_remove_unlocked (struct sobj_dict *sobj_dict, const char *key)
 Remove an object from a dictionary.
void sobj_dict_clear (struct sobj_dict *sobj_dict)
 Remove all objects from the dictionary.
void sobj_dict_clear_unlocked (struct sobj_dict *sobj_dict)
 Remove all objects from the dictionary.
int sobj_dict_count (const struct sobj_dict *sobj_dict)
 Return the number object objects bound by the dictionary.
int sobj_dict_elements (struct sobj_dict *sobj_dict, char ***key_vec, struct sobj ***value_vec)
 Get the elements bound in the dictionary.
int sobj_dict_elements_unlocked (const struct sobj_dict *sobj_dict, const char **key_vec, struct sobj **value_vec)
 Get the elements bound in the dictionary.
void sobj_dict_prealloc (struct sobj_dict *sobj_dict, int count)
 Preallocate storage.
void sobj_dict_prealloc_unlocked (struct sobj_dict *sobj_dict, int count)
 Preallocate storage.
sobjsobj_dict_as_array (struct sobj_dict *sobj_dict, const char *cn)
 Create an array object representing the dictionary data.
sobjsobj_dict_as_array_unlocked (struct sobj_dict *sobj_dict, const char *cn)
 Create an array object representing the dictionary data.
void sobj_dict_dump (const struct sobj_dict *sobj_dict)
 Dump a text representation of the object dictionary to the standard error stream.

Function Documentation

void sobj_dict_deinit struct sobj_dict sobj_dict  )  [static]
 

De-initialize a simple object dictionary instance.

Parameters:
sobj_dict The object dictionary.

void sobj_dict_delete_callback void *  self  )  [static]
 

Destructor callback function for simple object dictionaries.

A reference to this function is written to sobj_dict::del.

Parameters:
self Generic pointer to the simple object dictionary.

void sobj_dict_init struct sobj_dict sobj_dict  )  [static]
 

Initialize an instance of a simple object dictionary.

Parameters:
sobj_dict Pointer to an un-initialized simple object dictionary.


Generated on Sat Jul 23 16:05:05 2005 for sobject by  doxygen 1.3.9.1