WYRDTEK Home Features Reference Downloads About


Reference/es_mbc_addfldstr

Syntax

int es_mbc_addfldstr( struct es_mbc *cls, const char *fieldnm, unsigned fldsize );

Arguments

struct es_mbc *cls A database class.
const char *fieldnm Field name.
unsigend fldsize Width of field in bytes, not to exceed 128.

Return Codes

ES_ERROR_NONE Success. No errors.
ES_ERROR_UNKNOWNFIELD Field name does not exist in class definition.
ES_ERROR_INVALIDFIELDTYPE Field is not of type ES_FLDTYPE_STR.
ES_ERROR_INVALIDFIELDSIZE Field exceeds 128 bytes in size.

Description

es_mbc_addfldstr defines the size of a fixed-width user-defined field. Field sizes cannot exceed 128 bytes in size. Field sizes default to the word-size of the machine. The API may choose to increase the field size a little for reasons of efficiency of fetch and update (in a similar way that a compiler might choose to change the size of a declared struct in C).

Fixed-width user-defined fields are an efficiency saving in cases where a collection of values are likely always to be fetched or updated together.

[Back To Reference] [Back To Reference/es_mbc]