# mco_dict_struct_name
RT

> Return the descriptor for the structure/class referred to by name.

### Prototype

        MCO_RET mco_dict_struct_name(	/*IN*/ mco_metadict_header_t * metadict,
                         /*IN*/ unsigned short dict_no,
                         /*IN*/ const char * name,
                         /*OUT*/ mco_dict_struct_info_t * struct_info );

### 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)
name | The name of the structure/class as defined in the schema
struct_info | The address of a `mco_dict_struct_info_t` variable to receive the structure/class descriptor

### Description

> This function returns the descriptor for the structure/class referred to by the index `dict_no` in the array `metadict->entries[]` and class/structure `name` (as defined in the schema ).

### Return Codes

MCO_S_OK | The structure/class descriptor was successfully returned
MCO_E_UDA_DICT_NOTFOUND | The dictionary is not registered
MCO_E_UDA_STRUCT_NOTFOUND | Invalid structure name

### Example

        Application snippet:

        const char * dbname = "SimpleDb";

        int main(int argc, char* argv[])
        {
            MCO_RET rc;
            unsigned int dict_no = 0;
            unsigned int count;
            mco_metadict_header_t *header;
            const char * name = "MyClass";
            mco_dict_struct_info_t struct_info;

            ...

            header = (mco_metadict_header_t *) malloc(size);
            mco_metadict_init(header, size); /* initialize the metadict */
            ...
            rc = mco_dict_struct_name(header, dict_no, name, &struct_info);

        }

### Files

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