datanode Struct Reference

A node composed of a key-value pair, metadata, and child nodes. More...

Collaboration diagram for datanode:
[legend]

List of all members.

Public Attributes

struct datanodefirst_child
 Beginning of a linked list of child nodes or NULL.
char * key
 String to match during lookup and pathing.
struct datanodelast_child
 End of linked list; NULL iff first_child is NULL.
const char * meta
 Additional information about the node; managed extermally.
int mod_type
 The intended use of the node; managed externally.
struct datanodenext
 Pointer to a sibling node in containing linked list.
struct datanodeparent
 The node's parent; used in pathing and printing.
char * val
 The node's data; assumed string unless val_type negative.
int val_type
 The type of data stored at the node; managed externally.

Detailed Description

A node composed of a key-value pair, metadata, and child nodes.

Use datanode_init and datanode_lookup to create and obtain nodes.

Nodes are always stored in linked lists, hence the pointer to the next element. Strings key and val are assumed to be "owned" by the datanode and will be freed when it is destroyed; never set these to string constants. Other pointers specify the heirachy of nodes and are maintained internally.

Fields mod_type and val_type primarily serve as conveniences to external code. The datanode_read and datanode_write functions optionally map mod_type to and from a character, and all functions ignore the value stored at a node if val_type is negative (needed, for instance, if val is not a string). Both fields default to 0.

Field meta allows external code to denote, e.g., constraints for val. It is copied by reference and never freed, and thus may be set to constant or externally managed strings. Its intended use is for lists of nominal values, numeric bounds, and regexp matching.

See also:
datanode_init, datanode_lookup, datanode_read

Definition at line 71 of file datanode.h.


Member Data Documentation

Beginning of a linked list of child nodes or NULL.

Definition at line 83 of file datanode.h.

Referenced by datanode_copy(), datanode_destroy(), datanode_lookup_expert(), and datanode_write().

char * datanode::key

End of linked list; NULL iff first_child is NULL.

Definition at line 85 of file datanode.h.

Referenced by datanode_lookup_expert().

const char * datanode::meta

Additional information about the node; managed extermally.

Definition at line 77 of file datanode.h.

Referenced by datanode_copy().

The intended use of the node; managed externally.

Definition at line 73 of file datanode.h.

Referenced by datanode_copy(), datanode_read(), datanode_write(), and fx_copy_module().

Pointer to a sibling node in containing linked list.

Definition at line 87 of file datanode.h.

Referenced by datanode_copy(), datanode_destroy(), datanode_lookup_expert(), and datanode_write().

The node's parent; used in pathing and printing.

Definition at line 89 of file datanode.h.

Referenced by datanode_lookup_expert().

char * datanode::val

The node's data; assumed string unless val_type negative.

Definition at line 81 of file datanode.h.

Referenced by datanode_copy(), datanode_destroy(), datanode_read(), and datanode_write().

The type of data stored at the node; managed externally.

Definition at line 75 of file datanode.h.

Referenced by datanode_copy(), and datanode_write().


The documentation for this struct was generated from the following files:
Generated on Mon Jan 24 12:04:40 2011 for FASTlib by  doxygen 1.6.3