mco_db_extend

Extend database memory.

Prototype

    MCO_RET mco_db_extend(/*IN*/ const char *dbname,
                        /*IN*/ void *mem,
                        /*IN*/ uint4 size);

Arguments

dbname
The name of the database to extend.
mem
The starting address of a block of memory.
size
The size, in bytes, of the block of memory.

Description

This function extends the amount of memory used by the database dbname.

Return Codes

MCO_S_OK
The database memory was extended successfully.
MCO_E_NOINSTANCE
The specified database is not opened.
MCO_ERR_TRN
A database transaction error occurred.

Example


    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;
        ...
        if ((rc = mco_runtime_start()) != MCO_S_OK)
            exit(-1);
        ...
        rc = mco_db_open_dev(dbname, simpledb_get_dictionary(), &dev, 1, &db_params);
        ...
        rc = mco_db_connect(dbname, &db);
        ...
        /* If low memory situation detected */
        rc = mco_db_extend(dbname, mem, size);
    }

Files

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