2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.2 1994-09-14 13:10:35 quinn
10 * Revision 1.1 1994/09/12 08:02:07 quinn
21 #define IS_MAX_BLOCKTYPES 4
23 typedef unsigned int SYSNO; /* should be somewhere else */
24 typedef unsigned int ISAM_P;
27 * Description of a blocktype (part of an isam file)
29 typedef struct isam_blocktype
31 BFile bf; /* blocked file */
33 int first_block; /* position of first data block */
34 int max_keys_block; /* max num of keys per block */
35 int nice_keys_block; /* nice number of keys per block */
36 int max_keys; /* max number of keys per table */
37 int freelist; /* fist free block */
41 * Handle to an open isam complex.
43 typedef struct isam_struct
45 isam_blocktype types[IS_MAX_BLOCKTYPES]; /* block_types used in this file */
46 int num_types; /* number of block types used */
48 int keysize; /* size of the keys (records) used */
49 int (*cmp)(const void *k1, const void *k2); /* compare function */
52 typedef struct ispt_struct
54 ISAM is; /* which file do we belong to? */
55 int ptr; /* current key offset */
57 struct ispt_struct *next; /* freelist */
60 #define IS_TYPE(x) ((x) & 3)) /* type part of position */
61 #define IS_BLOCK(x) ((x >> 2)) /* block # part of position */
65 *******************************************************************
71 ISAM is_open(const char *name, int writeflag);
76 int is_close(ISAM is);
79 * Locate a table of keys in an isam file. The ISPT is an individual
80 * position marker for that table.
82 ISPT is_position(ISAM is, ISAM_P pos);
87 void is_pt_free(ISPT ip);
90 * Read a key from a table.
92 int is_readkey(ISPT ip, void *buf);