Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- C/Database Toolchest Library - name: <b>imkindex</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Name:       imkindex

Purpose:    makes a new index for a database

Prototype:  int imkindex(Db_Obj   *db,
                         char     *index_name,
                         char     *keyfields[]);

Header:     isam.h

Inputs:     db          - database handle
            index       - name for new index
            keyfields   - array of pointers to field names for new index

Description:
        imkindex makes a new index in the database db.  The index is
        named index_name.  The index_name is a nul-terminated string
        of ASCII characters, and may contain any character except a nul.  The
        key for the index consists of fields in the order of the
        keyfields.  All existing records in the database and all
        subsequently added records are automatically indexed in the new index.

        keyfields is an argv-style array of pointer to character strings
        that name the fields, in order, that make up a key for the index.
        Each element of the array is the name of the next key field.  The last
        element of keyfields must be the NULL pointer.

        If there are already many records in the database, imkindex may
        take a little while.  You can call iprogress to set up a function
        to be called by imkindex to display a message after each record
        is processed.

        imkindex leaves the file cursor (current record pointer) at BOI
        (beginning of index).

Returns:
        OK or ERROR

EXAMPLE:  see icreate_db example

See Also: icreate_db iprogress

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson