mco_dict_struct_count

Return the number of structures/classes for a dictionary.

Prototype

    MCO_RET mco_dict_struct_count(	/*IN*/ mco_metadict_header_t * metadict,
                      /*IN*/ unsigned short dict_no,
                      /*OUT*/ unsigned short * count );

Arguments

metadict
The address of an initialized mco_metadict_header_t structure.
dict_no
The number of the dictionary (must be between 0 and mco_metadict_count() - 1).
count
The address of a variable to receive the number of structures/classes.

Description

This function returns the number of structures/classes for the dictionary referred to by the index dict_no in the array metadict->entries[].

Return Codes

MCO_S_OK
The count was successfully returned.
MCO_E_UDA_DICT_NOTFOUND
The dictionary is not registered.

Example

    Application snippet:

    const char * dbname = "SimpleDb";

    int main(int argc, char* argv[])
    {
        MCO_RET rc;
     unsigned short dict_no = 0;
     unsigned short count;
        mco_metadict_header_t *header;

        ...

        header = (mco_metadict_header_t *) malloc(size);
        mco_metadict_init(header, size); /* initialize the metadict */
        ...
        rc = mco_dict_struct_count(header, dict_no, &count);

        ...
    }

Files

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