DIRIO.H C-5

NAME

dirio.h - include file for RMS structures

SYNOPSIS

#include <cbase/dirio.h>

DESCRIPTION

This include file contains symbolic definitions for all the data structures used by the RMSfile functions. Some of the functions within the RMSfile functions return pointers to these structures. See the comments in the text below.

CONTENTS

/*

* @(#)dirio.h 11.3

*/

#ifndef _DIRIO_

#define_DIRIO_

/* Return code definitions */

#define BAD (-1L)

/* value returned by dtacces() */

#define HD_SEQ 1 /* sequential file*/

#define HD_HASH 3 /* hashed file */

#define HD_IDX 5 /* indexed sequential file */

/* structure returned by dtfind() or dtfindn() */

#define FD_Z_NAME 16 /* max len of field name */

struct fd {

char fd_name[ FD_Z_NAME ]; /* field name */

short fd_type, /* ..type of element */

fd_size, /* ..size of all elements */

fd_off, /* ..offset of 1st element */

fd_iskey, /* ..field is a key field (YES/NO) */

fd_nelem, /* ..number of elements */

fd_esize, /* ..size of 1 element */

fd_isidx, /* ..field is indexed (YES/NO) */

fd_enumt, /* ..enumerated type */

fd_num, /* ..number (1, 2, 3, ...) */

fd_isalias; /* ..field is alias of other field */

};

#define _NOKEYS 8 /* maximum number of fields per key */

/* structure returned by dtfindk() */

struct kd {

short kd_keyn[_NOKEYS]; /* field numbers of key */

};

/* structure returned by dtfindi() */

struct nd {

char nd_keys[_NOKEYS][FD_Z_NAME]; /* field names in key */

};

/* structure passed to drlist() */

struct dr {

char dr_name[ FD_Z_NAME ]; /* field name */

short dr_type, /* ..type of element */

dr_size, /* ..size of all elements */

dr_nelem, /* ..number of elements */

dr_conv; /* ..type of conversion allowed */

};

typedef struct dr DR;

/* drlist conversion options */

#define DRNOCONV 0 /* no conversion allowed */

#define DRCONVPRE 1 /* convert, must preserve value */

#define DRCONVTRUNC 2 /* convert, possibly truncating value */

#ifndef DFILE

typedef long rno_t; /* record number type */

#define DFILE char /* structure returned by dopen() */

#define DICT char /* structure returned by dtopen() */

typedef struct fd FD;

#endif

DFILE *dopen(), *dlopen();

int drecsiz();

int derror();

char *derrmsg();

long dnrec();

long dblist();

long drlist();

rno_t dfind(), dfindn(), dfindp(), dfindl();

rno_t dfindk(), dfindnk(), dfindpk(), dfindlk();

rno_t dfindi(), dfindni(), dfindpi(), dfindli(), dfindfi();

rno_t dfindm(), dfindnm(), dfindpm(), dfindlm();

rno_t dinsert(), dupdate(), ddelete(), dsetpos();

rno_t dreadc(), dread(), dwrite();

int dclose();

DICT *dtopen(), *dtdict();

struct fd *dtfind(), *dtfindn();

struct kd *dtfindk();

struct nd *dtfindi();

int dtefld(), dtefldn();

int dtclose();

#endif /* _DIRIO_ */