Main Page   Modules   Data Structures   File List   Data Fields   Related Pages   Examples  

Add to lists

Add new elements to SeDaBl list blocks. More...

Functions

int sedabl_add_block (sedabl_block *block, sedabl_block *val)
 Adds a list to a list block.

int sedabl_add_val (sedabl_block *block, const char *key, sedabl_val *sval)
 Convenience function to add a byte string value to a list block.

int sedabl_add_int (sedabl_block *block, const char *key, int intval)
 Convenience function to add an integer value to a list block.

int sedabl_add_float (sedabl_block *block, const char *key, double floatval)
 Convenience function to add a floating-point value to a block.

int sedabl_add_str (sedabl_block *block, const char *key, const char *strval)
 Convenience function to add a string value to a block.


Detailed Description

Add new elements to SeDaBl list blocks.

Routines to add new element values to SeDaBl list blocks. This group of functions are implemented and documented in add.c


Function Documentation

int sedabl_add_block sedabl_block   block,
sedabl_block   val
 

Adds a list to a list block.

Parameters:
block The block to add to
val The block to add. May be a value block or a list block.
Returns:
-1 on failure, index on success
See also:
sedabl_new_list
Note:
The block is added directly, by reference, without being copied first. This means that you should be careful what you do with the block after adding it using this function, because it * might, eg, disappear due to a call to sedabl_free
Examples:
sample2.c, sample3.c, and sample4.c.

int sedabl_add_val sedabl_block   block,
const char *    key,
sedabl_val   sval
 

Convenience function to add a byte string value to a list block.

Parameters:
block The block to add to
key If non-NULL, associates the given key with the new value
sval The byte string value to add, as a sedable_val. This is passed to sedabl_new_valblock, see that function's documentation for caveats.
Returns:
-1 on failure, index on success
Examples:
sample1.c, and sample2.c.

int sedabl_add_int sedabl_block   block,
const char *    key,
int    intval
 

Convenience function to add an integer value to a list block.

Parameters:
block The block to add to
key If non-NULL, associates the given key with the new value
intval The integer value to add
Returns:
-1 on failure, index on success
Integers are converted to strings using something like sprintf and stored as such. Use the sedabl_get_int convenience function to retrieve such values.
Examples:
sample1.c, and sample2.c.

int sedabl_add_float sedabl_block   block,
const char *    key,
double    floatval
 

Convenience function to add a floating-point value to a block.

Parameters:
block The block to add to
key If non-NULL, associates the given key with the new value
floatval The floating-point value to add
Returns:
-1 on failure, index on success
Floating-point values are converted to strings using something like sprintf and stored as such. Use the sedabl_get_float convenience function to retrieve such values.

int sedabl_add_str sedabl_block   block,
const char *    key,
const char *    strval
 

Convenience function to add a string value to a block.

Parameters:
block The block to add to
key If non-NULL, associates the given key with the new value
strval A pointer to the string value
Returns:
-1 on failure, index on success
Strings are stored as such. Use the sedabl_get_str convenience function to retrieve such values.
Examples:
sample1.c, sample2.c, sample3.c, and sample4.c.


Generated on Mon Sep 15 07:27:33 2003 for SeDaBl C API by doxygen1.3-rc3