ajtable


Enum AjETableType

AJAX Table Type enumeration

Enumerated value(s)

Name
ajETableTypeUnknownno type set
ajETableTypeCharchar* type
ajETableTypeStrAJAX String (AjPStr) type
ajETableTypeIntAJAX integer (ajint) type
ajETableTypeUintAJAX unsigned integer (ajuint) type
ajETableTypeLongAJAX long integer (ajlong) type
ajETableTypeUlongAJAX unsigned long integer (ajulong) type
ajETableTypeUseruser-defined type
ajETableTypeMaxbeyond last defined value


Data type AjPTableNode

AJAX Table Node object.

Attributes

NameTypeDescription
Linkstruct AjSTableNode*Link top next AJAX Table Node
Keyvoid*Key data
Valuevoid*Value data


Data type AjPTable

Hash table object. Tables are key/value pairs with a simple hash function to provide rapid searching for keys.

Tables can hold any data type. Special functions are available for tables of AjPStr values, but these are in the ajstr library, and start with ajStrTable...

In general, these functions are the same but with different hash and comparison functions used. Alternative function names are provided in all cases to save remembering which calls need special cases.

Constructor(s)

NameDescription
ajTableNewCreates a table.

Destructor(s)

NameDescription
ajTableFreeDeallocates and clears a table.

Modifier(s)

NameDescription
ajTablePutAdds or updates a value for a given key.
ajTableMapCalls a function for each key/value in a table.
ajTableRemoveRemoves a key/value pair from a table, and returns the value.

Cast(s)

NameDescription
ajTableToarrayCreates an array to hold each key value pair in pairs of array elements. The last element is null.
ajTableGetReturns the value for a given key.
ajTableLengthReturns the number of keys in a table.

Output

NameDescription
ajTableTraceWrites debug messages to trace the contents of a table.

Attributes

NameTypeDescription
Fcmpajint functionKey compare function (0 for match, -1 or +1 if not matched)
Fhashajulong functionHash function
Fkeydelvoid functionKey destructor, or NULL if not an object
Fvaldelvoid functionValue destructor, or NULL if not an object
BucketsAjPTableNode*Buckets of AJAX Table Node objects
SizeajulongSize - number of hash buckets
LengthajulongNumber of entries
TimestampajuintTime stamp
UseajuintReference count
PaddingajuintPadding to alignment boundary
TypeAjETableTypeAJAX Table Type enumeration