mco_db_databases

List all registered database names.

Prototype

    MCO_RET mco_db_databases(/*OUT*/ char *lpBuffer,
                   /*IN*/ mco_size32_t buffer_size,
                   /*IN*/ mco_counter32_t skip_first);

Arguments

lpBuffer
Buffer to receive database names.
buffer_size
Size of the buffer.
skip_first
Number of databases to skip over.

Description

This function returns a list of all database names registered in the system.

Return Codes

MCO_S_OK
The database names are successfully written to the buffer.
MCO_E_NOMEM
Not enough memory in the buffer for the database names.

Example

    Application snippet:

    const char *dbname = "SimpleDb";

    int main(int argc, char* argv[])
    {
        mco_db_h db;
        MCO_RET rc;
        mco_device_t dev;
        mco_db_params_t db_params;
        char name_buffer[1024];
        ...

        rc = mco_db_open_dev(dbname, simpledb_get_dictionary(), &dev, 1, &db_params);

        if (MCO_S_OK != rc)
        {
            rc = mco_db_connect(dbname, &db);
            ...
            rc = mco_db_databases(name_buffer, 1024, 0);

            printf("\n\n Database names:\n%s\n", name_buffer);
            ...
            rc = mco_db_disconnect(db);

            rc = mco_db_close(dbname);
            ...
        }
    }

Files

Header file:
mco.h
Source file:
mcortmt.c
Library:
libmcolib.a