mkidx



Summary

#include <dataman/sort.h>

mkidx(argc,argv);

int argc;
char **argv;

Description

This function is used to initialize sort routines that generate new indices. It is normally the first procedure called in a sort program. The arguments, argc, and argv, are the arguments to the main() procedure. It also defines the usage of the sort program as being:

    sort_prog [-len -h host -r root] idx_name file_1 [file_2 ...]

where sort_prog is the name of the sort program, len is the maximum key length allowed in the index. If not specified, the default len is 20, and the maximum length is 32. All keys are padded with nulls to the maximum key length. Idx_name is the name of the index to be created. The host argument will override the DSERVHOST environment variable, if set, to specify which host to connect to. The root argument will override the ROOT variable which specifies the database root directory. File_1 through file_n are the file names of the files to be included in the index. Mkidx creates an empty index, and reads the first record of the first work file into memory. If idx_name already existed, all previous data is lost, as the index is re-created.

Example

    #include <dataman/sort.h>

    main(int argc, char *argv[])
    {

        mkidx(argc,argv);    /* init sort process */
          ...                /* do sort procedure */
    }

«previous  next»