2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.1 1994-09-12 08:02:07 quinn
18 #define IS_MAX_BLOCKTYPES 4
20 typedef unsigned int SYSNO; /* should be somewhere else */
21 typedef unsigned int ISAM_P;
24 * Description of a blocktype (part of an isam file)
26 typedef struct isam_blocktype
28 BFile bf; /* blocked file */
30 int max_keys_block; /* max num of keys per block */
31 int nice_keys_block; /* nice number of keys per block */
32 int max_keys; /* max number of keys per table */
36 * Handle to an open isam complex.
38 typedef struct isam_struct
40 isam_blocktype types[IS_MAX_BLOCKTYPES]; /* block_types used in this file */
41 int num_types; /* number of block types used */
43 int keysize; /* size of the keys (records) used */
44 int (*cmp)(const void *k1, const void *k2); /* compare function */
47 typedef struct ispt_struct
49 ISAM is; /* which file do we belong to? */
50 int ptr; /* current key offset */
52 struct ispt_struct *next; /* freelist */
55 #define IS_TYPE(x) ((x) & 3)) /* type part of position */
56 #define IS_BLOCK(x) ((x >> 2)) /* block # part of position */
60 *******************************************************************
66 ISAM is_open(const char *name, int writeflag);
71 int is_close(ISAM is);
74 * Locate a table of keys in an isam file. The ISPT is an individual
75 * position marker for that table.
77 ISPT is_position(ISAM is, ISAM_P pos);
82 void is_pt_free(ISPT ip);
85 * Read a key from a table.
87 int is_readkey(ISPT ip, void *buf);