home *** CD-ROM | disk | FTP | other *** search
- /*
- * indexer.h: tiny database index generation utility definitions
- *
- * Author: HIRAHO Satoshi
- * (C) 1989 Halca Computer Science Laboratory TM
- *
- * Edition History:
- * 1.1 89/07/14 Halca.Hirano creation for hterm set-up help system
- * 1.2 89/07/28 Halca.Hirano change command system
- * ---- V2.4.0 distribution ----
- *
- * Desctiprion:
- * Indexer generates index to pick up record from given key.
- * There are three components for indexer.
- *
- * Record text; This is a plain text file including keys and appropriate
- * records. e.g,
- *
- * comment
- * > key1
- * this is a text line. '>' means key.
- * And this is also test for key1.
- * < optional next key
- * comment
- * > key2
- * text lines for key2.
- * < optional next key
- * Lines beginning with # character in record are written to a file
- * after removed # character.
- *
- * Database file; This is generated by indexer from Record text.
- * Index information is included in head part of the file.
- *
- * header
- * records
- * index part (key and index to records)
- *
- * Library; indexlib.c is a access facility to Database file.
- * This is linked with users application program to use database.
- *
- */
-
- #define I_VERSION 2
- #define I_REVISION 1
-
- /*
- * compress or plain data switch
- */
- #define COMPRESS_DB
-
- /*
- * header part definition
- */
- struct _header {
- char header[80]; /* header string */
- int version; /* version number */
- int revision; /* revision number */
- short numIndex; /* number of index */
- long indexOffset; /* offset to index part */
- /* record part here */
- /* index part here */
- };
-
- /*
- * index part definition (simple binary-tree)
- */
- #define KEY_LEN 20
-
- typedef struct _index {
- char key[KEY_LEN]; /* key string */
- char nextKey[KEY_LEN]; /* next key string */
- long offset; /* file offset to the record */
- long size; /* size of the record */
- long right; /* to bigger key */
- long left; /* to smaller key */
- } Index;
-
- /*
- * text file definitions
- */
- #define KEY '>' /* '> key' key and start record */
- #define KEY_END '<' /* '<' end record */
- #define STRIP '#' /* strip if strip mode */
- #define KEY_PAREN2 '\"' /* key can be rounded with " */
- #define KEY_PAREN1 '\'' /* key can be rounded with ' */
- #define INCLUDE '@' /* include @file */
-
-
-