WYRDTEK Home Features Reference Downloads About


struct es_sd is an opaque data structure representing a string dictionary. A string dictionary is a mapping from strings to integer identifiers, or string-ids in the range 1..N, where N is the number of strings in the dictionary.

A string is regarded as a variable length sequence of bytes. If such a sequence contains bytes with zero value, however, the user is restricted to the es_sd_add_v() and es_sd_getid_v() functions, as the es_sd_add() and es_sd_getid() functions assume null-terminated strings.

The object interface is as follows:
es_sd_new Construct a new string dictionary.
es_sd_delete Delete a string dictionary.
es_sd_add Add a null-terminated string.
es_sd_add_v Add a string of known length.
es_sd_getid Retrieve string-id from dictionary by null terminated string.
es_sd_getid_v Retrieve string-id from dictionary by a string of known length.
es_sd_getstr Retrieve null terminated string from dictionary by string-id.
es_sd_rebalance Rebalance memory usage of string dictionary.
es_sd_getmaxid Retrieve the maximum string-id in dictionary.
es_sd_getchunksize Retrieve memory allocation chunksize.

[Back To Reference]