mco_metadict_init

Initialize the meta-dictionary.

Prototype

    MCO_RET mco_metadict_init(    /*IN*/ mco_metadict_header_t * metadict,
                   /*IN*/ unsigned int size,
                   /*IN*/ unsigned int flags );

Arguments

metadict
The address of a mco_metadict_header_t structure to initialize.
size
The size in bytes.
flags
Flags. The flags parameter defines what happens during the initialization of the dictionary. Currently the only supported value is:

Description

This function initializes the meta-dictionary. It must be called before any of the UDA API functions are called. The meta-dictionary contains the header and the entry for each dictionary.

Return Codes

MCO_S_OK
The metadictionary was successfully initialized.
MCO_E_UDA_TOOMANY_ENTRIES
The metadictionary is full.
MCO_E_UDA_NAME_TOO_LONG
The dictionary name is too long.

Example

    Application snippet:

    const char * dbname = "SimpleDb";

    int main(int argc, char* argv[])
    {
        unsigned int size;
        mco_metadict_header_t *header;

        mco_metadict_size(10, &size); /* figure out the buffer size to
                             register 10 database dictionaries */
        ...

        header = (mco_metadict_header_t *) malloc(size);
        mco_metadict_init(header, size); /* initialize the metadict */
        ...
    }

Files

Header file:
mcouda.h
Source file:
mcouda.c
Library:
libmcouda.a