* callback, and sends a message for the next chunk if necessary.
*/
static Tt_callback_action
-_ttdnd_continue_transfer(m,p)
- Tt_message m;
- Tt_pattern p;
+_ttdnd_continue_transfer(Tt_message m, Tt_pattern p)
{
Ttdnd_receive_data_func *receivefunc;
int sourceXid;
* from the user's send routine, and fills it into the message.
*/
static Tt_callback_action
-_ttdnd_get_contents_callback(m, p)
- Tt_message m;
- Tt_pattern p;
+_ttdnd_get_contents_callback(Tt_message m, Tt_pattern p)
{
int chunknumber;
int maxchunk;
* tt messages whenever the tt filedescriptor has input.
*/
void
-_ttdnd_receive()
+_ttdnd_receive(void)
{
Tt_message m;
m = tt_message_receive();
extern long *ismaxlong;
int
-_add1key(fcb, pkeydesc2, record, recnum, newkey)
- Fcb *fcb;
- Keydesc2 *pkeydesc2;
- char *record;
- Recno recnum;
- char *newkey;
+_add1key(Fcb *fcb, Keydesc2 *pkeydesc2, char *record, Recno recnum, char *newkey)
{
char keybuf[MAXKEYSIZE];
Btree *btree;
*/
int
-isaddindex(isfd, keydesc)
- int isfd;
- struct keydesc *keydesc;
+isaddindex(int isfd, struct keydesc *keydesc)
{
int _amaddindex();
register Fab *fab;
*/
int
-isaddprimary(isfd, keydesc)
- int isfd;
- struct keydesc *keydesc;
+isaddprimary(int isfd, struct keydesc *keydesc)
{
register Fab *fab;
int ret;
return (ret); /* Successful write */
}
-Static int _am_addprimary(fab, keydesc)
- register Fab *fab;
- struct keydesc *keydesc;
+Static int _am_addprimary(register Fab *fab, struct keydesc *keydesc)
{
return (_amaddprimary(&fab->isfhandle, keydesc, &fab->errcode));
}
* Allocate nbytes.
*/
-char *_ismalloc(nbytes)
- unsigned int nbytes;
+char *_ismalloc(unsigned int nbytes)
{
register char *p;
return (p);
}
-char *_isrealloc(oldaddr, nbytes)
- char *oldaddr;
- unsigned int nbytes;
+char *_isrealloc(char *oldaddr, unsigned int nbytes)
{
register char *p;
*/
char *
-_isallocstring(str)
- char *str;
+_isallocstring(char *str)
{
register char *p;
*/
void
-_isfreestring(str)
- char *str;
+_isfreestring(char *str)
{
assert(str != NULL);
free(str);
extern float ldfloat();
extern double lddbl();
extern short ldshort();
-extern int ldchar(), stchar(), stlong(), stint(), stdbl(), stfloat();
+extern int ldchar(), stchar(), stlong(), stdbl();
+extern int stint(short val, char *p);
+extern int stfloat(float f, char *p);
+
extern int iserrno; /* isam error number code */
extern long isrecnum; /* record number of last call */
char *data;
} Bytearray;
-extern Bytearray _bytearr_getempty(), _bytearr_dup(), _bytearr_new();
+extern Bytearray _bytearr_getempty(), _bytearr_dup();
+extern Bytearray _bytearr_new(u_short len, char *data);
extern void _bytearr_free();
/*ARGSUSED*/
int
-_amaddindex(isfhandle, keydesc, errcode)
- Bytearray *isfhandle;
- struct keydesc *keydesc;
- struct errcode *errcode;
+_amaddindex(Bytearray *isfhandle, struct keydesc *keydesc, struct errcode *errcode)
{
Fcb *fcb = NULL;
Keydesc2 keydesc2;
/*ARGSUSED*/
int
-_amaddprimary(isfhandle, keydesc, errcode)
- Bytearray *isfhandle;
- struct keydesc *keydesc;
- struct errcode *errcode;
+_amaddprimary(Bytearray *isfhandle, struct keydesc *keydesc, struct errcode *errcode)
{
Fcb *fcb = NULL;
Keydesc2 keydesc2;
* Check unique constraint, create duplicate serial numbers.
*/
-int _create_index(fcb, pkeydesc2)
- Fcb *fcb;
- Keydesc2 *pkeydesc2;
+int _create_index(Fcb *fcb, Keydesc2 *pkeydesc2)
{
Issort *srt;
int keylength = pkeydesc2->k2_len;
*/
Static void
-_readallrecords(fcb, srt, pkeydesc2)
- Fcb *fcb;
- Issort *srt;
- Keydesc2 *pkeydesc2;
+_readallrecords(Fcb *fcb, Issort *srt, Keydesc2 *pkeydesc2)
{
char record [ISMAXRECLEN];
char keybuf [MAXKEYSIZE];
*/
Static void
-_attach_dups_serial(srt, pkeydesc2)
- Issort *srt;
- Keydesc2 *pkeydesc2;
+_attach_dups_serial(Issort *srt, Keydesc2 *pkeydesc2)
{
int netkeylength = pkeydesc2->k2_len - RECNOSIZE - DUPIDSIZE;
char *curkey;
*/
Static Blkno
-_buildbtree(fcb, pkeydesc2, srt)
- Fcb *fcb;
- Keydesc2 *pkeydesc2;
- Issort *srt;
+_buildbtree(Fcb *fcb, Keydesc2 *pkeydesc2, Issort *srt)
{
Bufhdr *_allockpage();
int depth;
* Return 1 if there are duplicates in the sorted key object.
*/
-Static int _duplicate_exist(srt, keylength)
- Issort *srt;
- int keylength;
+Static int _duplicate_exist(Issort *srt, int keylength)
{
char *curkey;
char *lastkey = (char *) 0;
*/
int
-_amdelrec(isfhandle, recnum, errcode)
- Bytearray *isfhandle;
- Recno recnum;
- struct errcode *errcode;
+_amdelrec(Bytearray *isfhandle, Recno recnum, struct errcode *errcode)
{
Fcb *fcb = NULL;
char recbuf[ISMAXRECLEN];
*/
void
-_delkeys(fcb, record, recnum)
- register Fcb *fcb;
- char *record;
- Recno recnum;
+_delkeys(register Fcb *fcb, char *record, Recno recnum)
{
int nkeys = fcb->nkeys;
register int i;
*/
void
-_amseterrcode(errcode, is_errno)
- struct errcode *errcode;
- int is_errno;
+_amseterrcode(struct errcode *errcode, int is_errno)
{
register struct errstattab *p;
errcode->iserrno = is_errno;
*/
void
-_isam_entryhook()
+_isam_entryhook(void)
{
isdupl = 0; /* Reset duplicate indicator */
_setiserrno2(0, '0', '0');
*/
void
-_isam_exithook()
+_isam_exithook(void)
{
_isdisk_inval(); /* Invalidate all buffers */
}
/* ARGSUSED */
int
-_amopen(isfname, openmode, varflag, minlen, maxlen,
- isfhandle, curpos, errcode)
- char *isfname;
- enum openmode openmode;
- Bool *varflag;
- int *minlen, *maxlen;
- Bytearray *isfhandle;
- Bytearray *curpos;
- struct errcode *errcode;
+_amopen(char *isfname, enum openmode openmode, Bool *varflag,
+ int *minlen, int *maxlen, Bytearray *isfhandle,
+ Bytearray *curpos, struct errcode *errcode)
{
Fcb *fcb;
Bytearray isfhandle0;
#define FDNEEDED 3 /* Needs 3 UNIX fd to open a file*/
Fcb *
-_openfcb(isfhandle, errcode)
- Bytearray *isfhandle;
- struct errcode *errcode;
+_openfcb(Bytearray *isfhandle, struct errcode *errcode)
{
Fcb *fcb;
Bytearray *isfhandle2;
*/
char *
-_getisfname(isfhandle)
- Bytearray *isfhandle;
+_getisfname(Bytearray *isfhandle)
{
return (isfhandle->data);
}
*/
Bytearray
-_makeisfhandle(isfname)
- char *isfname;
+_makeisfhandle(char *isfname)
{
return (_bytearr_new((u_short)(strlen(isfname) + 1), isfname));
}
*/
int
-_amwrite(isfhandle, record, reclen, curpos, recnum, errcode)
- Bytearray *isfhandle;
- char *record;
- int reclen;
- Bytearray *curpos;
- Recno *recnum;
- struct errcode *errcode;
+_amwrite(Bytearray *isfhandle, char *record, int reclen,
+ Bytearray *curpos, Recno *recnum, struct errcode *errcode)
{
Fcb *fcb = NULL;
Recno recnum2;
* Returns ISOK, or EDUPS.
*/
-int _addkeys (fcb, record, recnum)
- register Fcb *fcb;
- char *record;
- Recno recnum;
+int _addkeys (register Fcb *fcb, char *record, Recno recnum)
{
int nkeys = fcb->nkeys;
register int i;
}
Static int
-_addkeys2 (fcb, record, recnum, curpos)
- Fcb *fcb;
- char *record;
- Recno recnum;
- Bytearray *curpos;
+_addkeys2 (Fcb *fcb, char *record, Recno recnum, Bytearray *curpos)
{
int nkeys = fcb->nkeys;
register int i;
*/
int
-_isapplmr(isfd, buffer)
- int isfd;
- char *buffer;
+_isapplmr(int isfd, char *buffer)
{
register Fab *fab;
Fcb *fcb = NULL;
*/
int
-_isapplmw(isfd, magicstring)
- int isfd;
- char *magicstring;
+_isapplmw(int isfd, char *magicstring)
{
register Fab *fab;
int ret;
*/
-char *_isbsearch (key,table,nelems,keylen,cmpf)
- char *key;
- char *table;
- int nelems;
- int keylen;
- int (*cmpf) ();
+char *_isbsearch (char *key, char *table, int nelems, int keylen, int (*cmpf) ())
{
register int len,l1,result; /* current length of array to search */
register char *p,*low;
*/
Btree *
- _isbtree_create(fcb, pkeydesc2)
-Fcb *fcb;
-Keydesc2 *pkeydesc2;
+ _isbtree_create(Fcb *fcb, Keydesc2 *pkeydesc2)
{
register Btree *p;
*/
void
-_isbtree_destroy(btree)
- register Btree *btree;
+_isbtree_destroy(register Btree *btree)
{
register int i;
*/
void
-_isbtree_search(btree, key)
- register Btree *btree;
-char *key; /* Search for this key */
+_isbtree_search( register Btree *btree, char *key)
{
Keydesc2 *pkeydesc2 = btree->keydesc2;
Blkno rootblkno = pkeydesc2->k2_rootnode;
*/
char *
-_isbtree_current(btree)
- register Btree *btree;
+_isbtree_current(register Btree *btree)
{
int curpos;
*/
char *
-_isbtree_next(btree)
- register Btree *btree;
+_isbtree_next(register Btree *btree)
{
int curpos;
int depth = btree->depth;
*/
int
-isbuild(isfname, recordlength, primkey, mode)
- char *isfname;
- int recordlength;
- struct keydesc *primkey;
- int mode;
+isbuild(char *isfname, int recordlength, struct keydesc *primkey, int mode)
{
Fab *fab;
Isfd isfd;
/* ARGSUSED */
static int
-_ambuild(isfname, openmode, varflag, minlen, maxlen, primkey,
- owner, group, umask, isfhandle, curpos, errcode)
- char *isfname;
- enum openmode openmode;
- Bool varflag;
- int minlen, maxlen;
- struct keydesc *primkey;
- int owner, group;
- Bytearray *isfhandle;
- Bytearray *curpos;
- struct errcode *errcode;
- int umask;
+_ambuild(char *isfname, enum openmode openmode, Bool varflag,
+ int minlen, int maxlen, struct keydesc *primkey,
+ int owner, int group, int umask,
+ Bytearray *isfhandle, Bytearray *curpos,
+ struct errcode *errcode)
+
{
Fcb *fcb = NULL;
Bytearray *isfhandle2;
*/
Bytearray
-_bytearr_getempty()
+_bytearr_getempty(void)
{
static Bytearray empty_bytearray = { 0, NULL};
*/
Bytearray
-_bytearr_new(len, data)
- u_short len;
- char *data;
+_bytearr_new(u_short len, char *data)
{
Bytearray bytearray;
*/
Bytearray
-_bytearr_dup(old)
- Bytearray *old;
+_bytearr_dup(Bytearray *old)
{
return (_bytearr_new(old->length, old->data));
}
*/
void
-_bytearr_free(barray)
- register Bytearray *barray;
+_bytearr_free(register Bytearray *barray)
{
if (barray->data)
free(barray->data);
*/
int
-_bytearr_cmp(l,r)
- register Bytearray *l, *r;
+_bytearr_cmp(register Bytearray *l, register Bytearray *r)
{
if (l->length == r->length)
return (memcmp(l->data, r->data, (int)l->length));
extern long *ismaxlong;
int
-_change1key(fcb, pkeydesc2, record, oldrecord, recnum, newkey)
- Fcb *fcb;
- Keydesc2 *pkeydesc2;
- char *record;
- char *oldrecord;
- Recno recnum;
- char *newkey;
+_change1key(Fcb *fcb, Keydesc2 *pkeydesc2, char *record,
+ char *oldrecord, Recno recnum, char *newkey)
{
char keybuf1[MAXKEYSIZE];
char keybuf2[MAXKEYSIZE];
*/
int
-isclose(isfd)
- int isfd;
+isclose(int isfd)
{
Fab *fab;
Fcb *fcb;
*/
int
-isgetcurpos(isfd, len, buf)
- int isfd;
- int *len;
- char **buf;
+isgetcurpos(int isfd, int *len, char **buf)
{
Fab *fab;
u_short total_len;
*/
int
-issetcurpos(isfd, buf)
- int isfd;
- char *buf;
+issetcurpos(int isfd, char *buf)
{
Fab *fab;
u_short len;
/* ldlong() - Load a long integer from a potentially unaligned address */
long
-ldlong(p)
- register char *p;
+ldlong(register char *p)
{
int i;
#if LONG_BIT == 64
/* stlong() - Store a long integer at a potentially unaligned address */
int
-stlong(val, p)
- register long val;
- register char *p;
+stlong(register long val, register char *p)
{
int i;
p += LONGSIZE;
/* ldint() - Load a short integer from a potentially unaligned address */
short
-ldint(p)
- register char *p;
+ldint(register char *p)
{
register unsigned int val;
/* ldunshort - load a unshort integer : for 64K record length */
u_short
-ldunshort(p)
- register char *p;
+ldunshort(register char *p)
{
register unsigned int val;
/* stint() - Store a short integer at a potentially unaligned address */
int
-stint(val, p)
- register short val;
- register char *p;
+stint(register short val, register char *p)
{
p += SHORTSIZE;
*--p = val & 255;
/* ldchar() - Load character field */
int
-ldchar(src, len, dst)
- char *src;
- register char *dst;
- int len;
+ldchar(char *src, int len, register char *dst)
{
register char *p;
}
int
-stchar(src, dst, len)
- register char *src;
- register char *dst;
- register int len;
+stchar(register char *src, register char *dst, register int len)
{
register char c;
/* ldchar2() - Load character field (C style, NULL padded) */
int
-ldchar2(src, len, dst)
- char *src;
- register char *dst;
- int len;
+ldchar2(char *src, int len, register char *dst)
{
register char *p;
}
int
-stchar2(src, dst, len)
- register char *src;
- register char *dst;
- register int len;
+stchar2(register char *src, register char *dst, register int len)
{
register char c;
/* ldfloat() - Load a float number from a potentially unaligned address */
float
-ldfloat(p)
- register char *p;
+ldfloat(register char *p)
{
union {
float fval;
/* stfloat() - Store a float number at a potentially unaligned address */
+/* f, Bug - it is passed as double */
int
-stfloat(f, p)
- float f; /* Bug - it is passed as double */
- register char *p;
+stfloat(float f, register char *p)
{
register unsigned val;
union {
/* ldbld() - Load a double float number from a potentially unaligned address */
double
-lddbl(p)
- register char *p;
+lddbl(register char *p)
{
double val;
/* stdbl() - Store a double float number at a potentially unaligned address */
int
-stdbl(val, p)
- double val;
- register char *p;
+stdbl(double val, register char *p)
{
memcpy ( p,(char *)&val, DOUBLESIZE);
return 0;
/* ldbld() - Load a double float number from a potentially unaligned address */
double
-lddbl(p)
- register char *p;
+lddbl(register char *p)
{
union {
double rval;
/* stdbl() - Store a double float number at a potentially unaligned address */
int
-stdbl(val, p)
- double val;
- register char *p;
+stdbl(double val, register char *p)
{
union {
double rval;
#include "isam_impl.h"
void
-_del1key(fcb, pkeydesc2, record, recnum)
- Fcb *fcb;
- Keydesc2 *pkeydesc2;
- char *record;
- Recno recnum;
+_del1key(Fcb *fcb, Keydesc2 *pkeydesc2, char *record, Recno recnum)
{
char keybuf[MAXKEYSIZE];
Btree *btree;
*/
int
-isdelcurr(isfd)
- int isfd;
+isdelcurr(int isfd)
{
int _am_delcurr();
register Fab *fab;
*/
static int
-_amdelcurr(isfhandle, curpos, recnum, errcode)
- Bytearray *isfhandle;
- Bytearray *curpos;
- Recno *recnum;
- struct errcode *errcode;
+_amdelcurr(Bytearray *isfhandle, Bytearray *curpos, Recno *recnum,
+ struct errcode *errcode)
{
Fcb *fcb = NULL;
Crp *crp;
*/
int
-isdelrec(isfd, recnum)
- int isfd;
- long recnum;
+isdelrec(int isfd, long recnum)
{
int _amdelrec();
register Fab *fab;
+/* unixfd, .rec, .ind., .var */
Bufhdr *
-_isdisk_fix(fcb, unixfd, blkno, mode)
- Fcb *fcb;
- int unixfd; /* .rec, .ind., .var */
- Blkno blkno;
- int mode;
+_isdisk_fix(Fcb *fcb, int unixfd, Blkno blkno, int mode)
{
register Bufhdr *p, *p2;
struct dlink *hashl;
}
void
-_isdisk_unfix (p)
- register Bufhdr *p;
+_isdisk_unfix (register Bufhdr *p)
{
if (!(p->isb_flags & ISB_FIXED))
assert(p->isb_flags & ISB_FIXED);
}
void
-_isdisk_commit1 (p)
- Bufhdr *p;
+_isdisk_commit1 (Bufhdr *p)
{
_commit1buffer(p);
}
void
-_isdisk_commit()
+_isdisk_commit(void)
{
register Bufhdr *p;
struct dlink *e;
}
void
-_isdisk_rollback()
+_isdisk_rollback(void)
{
register Bufhdr *p;
struct dlink *e;
}
Bufhdr *
-_isdisk_refix(p, newmode)
- Bufhdr *p;
- int newmode;
+_isdisk_refix(Bufhdr *p, int newmode)
{
Blkno blkno = p->isb_blkno;
Fcb *fcb = p->isb_fcb;
}
void
-_isdisk_sync()
+_isdisk_sync(void)
{
extern time_t _istimeget();
register Bufhdr *p;
}
void
-_isdisk_inval()
+_isdisk_inval(void)
{
extern time_t _istimeget();
register Bufhdr *p;
#if ISDEBUG
-_isdisk_dumphd()
+_isdisk_dumphd(void)
{
register Bufhdr *p;
int i;
p->isb_oldcopy?(p->isb_oldcopy - bufhdrs):-1);
}
-aclistdump(lh)
- struct dlink *lh;
+aclistdump(struct dlink *lh)
{
register Bufhdr *p;
struct dlink *e;
}
}
-flistdump(lh)
- struct dlink *lh;
+flistdump(struct dlink *lh)
{
register Bufhdr *p;
struct dlink *e;
/*------------------------ Local functions ---------------------------------*/
Static void
-_disk_init()
+_disk_init(void)
{
static Bool initialized = FALSE;
register int i;
/* _getavail() - get available buffer in disk */
Static Bufhdr *
-_getavail()
+_getavail(void)
{
register Bufhdr *p;
register struct dlink *q;
/* _findblock() - Find block in buffer pool */
Static Bufhdr *
-_findblock(fcb, unixfd, blkno)
- Fcb *fcb;
- int unixfd;
- Blkno blkno;
+_findblock(Fcb *fcb, int unixfd, Blkno blkno)
{
register Bufhdr *p;
struct dlink *lh, *e;
/* _commit1buffer() - Commit changes to buffer */
Static void
-_commit1buffer(p)
- register Bufhdr *p;
+_commit1buffer(register Bufhdr *p)
{
assert(p->isb_flags & ISB_WFIXED); /* Fixed for read buffers should */
/* go through _isdisk_unfix() */
/* _rollback1buffer() - Rollback changes to buffer */
Static void
-_rollback1buffer(p)
- register Bufhdr *p;
+_rollback1buffer(register Bufhdr *p)
{
register Bufhdr *p2;
/* _makenodata() - make buffer available with no data in it*/
Static void
-_makenodata(p)
- register Bufhdr *p;
+_makenodata(register Bufhdr *p)
{
assert(p->isb_flags & ISB_READ);
/* _flush1buffer() - flush buffer to disk */
Static void
-_flush1buffer(p)
- register Bufhdr *p;
+_flush1buffer(register Bufhdr *p)
{
assert(p->isb_flags & ISB_CHANGE);
#include "isam_impl.h"
/* _isdln_base_insert () - Insert element into list (at the front) -----------*/
-void _isdln_base_insert (base,l,e)
- register char *base;
- register struct dlink *l,*e;
+void _isdln_base_insert (register char *base, register struct dlink *l,
+ register struct dlink *e)
{
e->dln_forward = l->dln_forward;
l->dln_forward = (char *)e - base;
}
/* _isdln_base_append () - Append element to list (at the end) -------------*/
-void _isdln_base_append (base,l,e)
- register char *base;
- register struct dlink *l,*e;
+void _isdln_base_append (register char *base, register struct dlink *l,
+ register struct dlink *e)
{
e->dln_backward = l->dln_backward;
l->dln_backward = (char *)e - base;
}
/* _isdln_base_remove () - Remove element from list -------------------------*/
-void _isdln_base_remove (base,e)
- register char *base;
- register struct dlink *e;
+void _isdln_base_remove (register char *base, register struct dlink *e)
{
((struct dlink *)(base + e->dln_backward))->dln_forward = e->dln_forward;
((struct dlink *)(base + e->dln_forward))->dln_backward = e->dln_backward;
}
/* _isdln_base_first () - Return first element of the list -------------------*/
-struct dlink * _isdln_base_first(base,l)
- register char *base;
- register struct dlink *l;
+struct dlink * _isdln_base_first(register char *base, register struct dlink *l)
{
struct dlink *val = (struct dlink *)(base + l->dln_forward);
}
/* _isdln_base_next () - Return next element in the list --------------------*/
-struct dlink * _isdln_base_next(base,l)
- register char *base;
- register struct dlink *l;
+struct dlink * _isdln_base_next(register char *base, register struct dlink *l)
{
return (((struct dlink *)(base + l->dln_forward)));
}
/* _isdln_base_prev () - Return previous element in the list ----------------*/
-struct dlink * _isdln_base_prev(base,l)
- register char *base;
- register struct dlink *l;
+struct dlink * _isdln_base_prev(register char *base, register struct dlink *l)
{
return (((struct dlink *)(base + l->dln_backward)));
}
/* _isdln_base_makeempty () - Make head of empty list -----------------------*/
-void _isdln_base_makeempty(base,l)
- register char *base;
- register struct dlink *l;
+void _isdln_base_makeempty(register char *base, register struct dlink *l)
{
l->dln_forward = l->dln_backward = (char *)l - base;
}
/* _isdln_base_isempty () - Test if list is empty---------------------------*/
-int _isdln_base_isempty(base,l)
- register char *base;
- register struct dlink *l;
+int _isdln_base_isempty(register char *base, register struct dlink *l)
{
return (l->dln_forward == (char *)l - base &&
l->dln_backward == (char *)l - base);
*/
int
-iserase(isfname)
- char *isfname;
+iserase(char isfname)
{
Isfd isfd, isfd_nfs;
Fab *fab, *fab_nfs;
*/
static int
-_amerase(isfhandle, errcode)
- Bytearray *isfhandle;
- struct errcode *errcode;
+_amerase(Bytearray *isfhandle, struct errcode *errcode)
{
Fcb *fcb;
char *isfname = _getisfname(isfhandle);
Static void
-_unlink_datfile(isfname)
- char *isfname;
+_unlink_datfile(char *isfname)
{
char namebuf[MAXPATHLEN];
Static void
-_unlink_indfile(isfname)
- char *isfname;
+_unlink_indfile(char *isfname)
{
char namebuf[MAXPATHLEN];
Static void
-_unlink_varfile(isfname)
- char *isfname;
+_unlink_varfile(char *isfname)
{
char namebuf[MAXPATHLEN];
}
/* Set user specified fatal_error handler */
-int (*_isfatal_error_set_func(func))()
- int (*func)();
+int (*_isfatal_error_set_func(int(*func)()))()
{
int (*oldfunc)();
* Fab_new() creates an File access block (fab object) that is used
* for all subsequent operations in this file. Return a pointer to
* the fab object, or NULL in the case of an error.
+
+ * isfname, Local path on the host
+ * varlen, 0/1 flag
*/
Fab *
-_fab_new(isfname, openmode,
- varlen, minreclen, maxreclen)
- char *isfname; /* Local path on the host */
- enum openmode openmode;
- Bool varlen; /* 0/1 flag */
- int minreclen, maxreclen;
+_fab_new(char *isfname, enum openmode openmode, Bool varlen, int minreclen, int maxreclen)
{
register Fab *fab;
}
void
-_fab_destroy(fab)
- register Fab *fab;
+_fab_destroy(register Fab *fab)
{
assert(fab != NULL);
assert(fab->isfname != NULL);
*
* Return 0 if create is successful, or -1 if any error. In the case of
*an error, the errcode block is set.
+ *
+ * crdat, 0/1 flag
+ * crind, 0/1 flag
+ * crvar, 0/1 flag
*/
Fcb *
-_isfcb_create(isfname, crdat, crind, crvar, owner, group, u_mask, errcode)
- char *isfname;
- int crdat, crind, crvar; /* 0/1 flags */
- int owner, group;
- struct errcode *errcode;
- int u_mask;
+_isfcb_create(char *isfname, int crdat, int crind, int crvar,
+ int owner, int group, int u_mask, struct errcode *errcode)
{
register Fcb *fcb;
int dat_fd = -1;
*/
void
-_isfcb_setreclength(fcb, varflag, minreclen, maxreclen)
- register Fcb *fcb;
- Bool varflag;
- int minreclen, maxreclen;
+_isfcb_setreclength(register Fcb *fcb, Bool varflag, int minreclen, int maxreclen)
{
fcb->varflag = varflag;
fcb->minreclen = minreclen;
*/
Fcb *
-_isfcb_open(isfname, errcode)
- char *isfname;
- struct errcode *errcode;
+_isfcb_open(char *isfname, struct errcode *errcode)
{
register Fcb *fcb;
int dat_fd = -1;
*/
int
-_isfcb_nfds(fcb)
- register Fcb *fcb;
+_isfcb_nfds(register Fcb *fcb)
{
register int count = 0;
*/
void
-_isfcb_remove(fcb)
- register Fcb *fcb;
+_isfcb_remove(register Fcb *fcb)
{
if (fcb->datfd)
_remove_datfile(fcb->isfname);
*/
void
-_isfcb_close(fcb)
- register Fcb *fcb;
+_isfcb_close(register Fcb *fcb)
{
assert (fcb != NULL);
assert (fcb->isfname != NULL);
*/
int
-_isfcb_cntlpg_w(fcb)
- register Fcb *fcb;
+_isfcb_cntlpg_w(register Fcb *fcb)
{
char cntl_page[ISCNTLSIZE];
int dat_fd = fcb->datfd;
*/
int
-_isfcb_cntlpg_w2(fcb)
- register Fcb *fcb;
+_isfcb_cntlpg_w2(register Fcb *fcb)
{
char cntl_page[CP_VAREND_OFF+CP_VAREND_LEN];
int dat_fd = fcb->datfd;
*/
int
-_isfcb_cntlpg_r(fcb)
- register Fcb *fcb;
+_isfcb_cntlpg_r(register Fcb *fcb)
{
char cntl_page[ISCNTLSIZE];
int dat_fd = fcb->datfd;
*/
int
-_isfcb_cntlpg_r2(fcb)
- register Fcb *fcb;
+_isfcb_cntlpg_r2(register Fcb *fcb)
{
char cntl_page[CP_VAREND_OFF+CP_VAREND_LEN];
int dat_fd = fcb->datfd;
*/
Static int
-_create_datfile(isfname)
- char *isfname;
+_create_datfile(char *isfname)
{
int fd;
char namebuf[MAXPATHLEN];
*/
Static int
-_create_indfile(isfname)
- char *isfname;
+_create_indfile(char *isfname)
{
int fd;
char namebuf[MAXPATHLEN];
*/
Static int
-_create_varfile(isfname)
- char *isfname;
+_create_varfile(char *isfname)
{
int fd;
char namebuf[MAXPATHLEN];
*/
Static void
-_remove_datfile(isfname)
- char *isfname;
+_remove_datfile(char *isfname)
{
char namebuf[MAXPATHLEN];
*/
Static void
-_remove_indfile(isfname)
- char *isfname;
+_remove_indfile(char *isfname)
{
char namebuf[MAXPATHLEN];
*/
Static void
-_remove_varfile(isfname)
- char *isfname;
+_remove_varfile(char *isfname)
{
char namebuf[MAXPATHLEN];
*/
Static int
-_open_datfile(isfname, rdonly)
- char *isfname;
- Bool *rdonly;
+_open_datfile(char *isfname, Bool *rdonly)
{
char namebuf[MAXPATHLEN];
int ret;
*/
Static int
-_open_indfile(isfname, rdonly)
- char *isfname;
- Bool rdonly;
+_open_indfile(char *isfname, Bool rdonly)
{
int fd;
char namebuf[MAXPATHLEN];
*/
Static int
-_open_varfile(isfname, rdonly)
- char *isfname;
- Bool rdonly;
+_open_varfile(char *isfname, Bool rdonly)
{
int fd;
char namebuf[MAXPATHLEN];
}
int
-_check_isam_magic(fcb)
- Fcb *fcb;
+_check_isam_magic(Fcb *fcb)
{
char magicbuffer[CP_MAGIC_LEN];
*/
int
-_open2_indfile(fcb)
- Fcb *fcb;
+_open2_indfile(Fcb *fcb)
{
char namebuf[MAXPATHLEN];
struct stat buf;
*/
int
-_isfcb_primkeyadd(fcb, keydesc2)
- Fcb *fcb;
- Keydesc2 *keydesc2;
+_isfcb_primkeyadd(Fcb *fcb, Keydesc2 *keydesc2)
{
/*
* Assign keyid.
*/
int
-_isfcb_primkeydel(fcb)
- Fcb *fcb;
+_isfcb_primkeydel(Fcb *fcb)
{
if (FCB_NOPRIMARY_KEY(fcb))
return (EBADARG);
*/
int
-_isfcb_altkeyadd(fcb, keydesc2)
- Fcb *fcb;
- Keydesc2 *keydesc2;
+_isfcb_altkeyadd(Fcb *fcb, Keydesc2 *keydesc2)
{
assert (fcb->nkeys < MAXNKEYS);
*/
Keydesc2 *
-_isfcb_findkey(fcb, keydesc2)
- register Fcb *fcb;
- Keydesc2 *keydesc2;
+_isfcb_findkey(register Fcb *fcb, Keydesc2 *keydesc2)
{
int nkeys = fcb->nkeys;
register Keydesc2 *kp2;
*/
int
-_isfcb_altkeydel(fcb, keydesc2)
- register Fcb *fcb;
- Keydesc2 *keydesc2;
+_isfcb_altkeydel(register Fcb *fcb, Keydesc2 *keydesc2)
{
int nkeys = fcb->nkeys;
register int i, j;
/* compare key parts */
Static int
-_keypart2cmp(l,r)
- register struct keypart2 *l, *r;
+_keypart2cmp(register struct keypart2 *l, register struct keypart2 *r)
{
return !(l->kp2_type == r->kp2_type && l->kp2_start == r->kp2_start &&
l->kp2_leng == r->kp2_leng);
*/
Keydesc2 *
-_isfcb_indfindkey(fcb, keyid)
- register Fcb *fcb;
- int keyid;
+_isfcb_indfindkey(register Fcb *fcb, int keyid)
{
int nkeys = fcb->nkeys;
register Keydesc2 *keys = fcb->keys;
*/
int
-_watchfd_incr(n)
+_watchfd_incr(int n)
{
_in_use += n;
assert(_in_use <= _limit);
*/
int
-_watchfd_decr(n)
+_watchfd_decr(int n)
{
_in_use -= n;
assert(_in_use >= 0);
*/
int
-_watchfd_check()
+_watchfd_check(void)
{
return (_limit - _in_use);
}
*/
int
-_watchfd_max_set(n)
- int n;
+_watchfd_max_set(int n)
{
int oldlimit = _limit;
*/
int
-_watchfd_max_get()
+_watchfd_max_get(void)
{
return (_limit);
}
*/
Isfd
-_isfd_insert(fab)
- Fab *fab;
+_isfd_insert(Fab *fab)
{
register Isfd i;
*/
Fab *
-_isfd_find(isfd)
- register Isfd isfd;
+_isfd_find(register Isfd isfd)
{
if (isfd < 0 || isfd >= MAXISFD || isfdtab[isfd] == NULL)
return (NULL);
*/
void
-_isfd_delete(isfd)
- register Isfd isfd;
+_isfd_delete(register Isfd isfd)
{
if (isfd >= 0 && isfd < MAXISFD)
isfdtab[isfd] = NULL;
*/
void
-_cp_tofile(fcb, unixfd, data, pos, len)
- Fcb *fcb;
- int unixfd;
- char *data;
- long pos;
- int len;
+_cp_tofile(Fcb *fcb, int unixfd, char *data, long pos, int len)
{
int offset; /* Offset within a page */
Blkno blkno;
*/
void
-_cp_fromfile(fcb, unixfd, data, pos, len)
- Fcb *fcb;
- int unixfd;
- char *data;
- long pos;
- int len;
+_cp_fromfile(Fcb *fcb, int unixfd, char *data, long pos, int len)
{
int offset; /* Offset within a page */
Blkno blkno;
*/
Blkno
-_extend_file(fcb, unixfd, oldsize)
- Fcb *fcb;
- int unixfd;
- Blkno oldsize;
+_extend_file(Fcb *fcb, int unixfd, Blkno oldsize)
{
Bufhdr *bufhdr;
char buf[ISPAGESIZE];
*/
Static int
-_getoffset(pos)
- long pos;
+_getoffset(long pos)
{
return ((int)(pos % ISPAGESIZE));
}
*/
Static Blkno
-_getblkno(pos)
- long pos;
+_getblkno(long pos)
{
return ((int)(pos / ISPAGESIZE));
}
/*ARGSUSED*/
int
-_flrec_write(fcb, record, recnum, reclen)
- register Fcb *fcb;
- char *record;
- Recno *recnum;
- int reclen;
+_flrec_write(register Fcb *fcb, char *record, Recno *recnum, int reclen)
{
Recno recnum2;
long rec_position;
*/
int
-_flrec_read(fcb, record, recnum, reclen)
- register Fcb *fcb;
- char *record;
- Recno recnum;
- int *reclen;
+_flrec_read(register Fcb *fcb, char *record, Recno recnum, int *reclen)
{
long rec_position;
char delflag;
*/
long
-_fl_getpos(fcb, recnum)
- Fcb *fcb;
- Recno recnum;
+_fl_getpos(Fcb *fcb, Recno recnum)
{
return ((long)(ISCNTLSIZE + (fcb->minreclen + 1) * (recnum -1)));
}
/*ARGSUSED*/
int
-_flrec_rewrite(fcb, record, recnum, reclen)
- register Fcb *fcb;
- char *record;
- Recno recnum;
- int reclen;
+_flrec_rewrite(register Fcb *fcb, char *record, Recno recnum, int reclen)
{
long rec_position;
char delflag;
*/
int
-_flrec_delete(fcb, recnum)
- register Fcb *fcb;
- Recno recnum;
+_flrec_delete(register Fcb *fcb, Recno recnum)
{
long rec_position;
char delflag;
/*ARGSUSED*/
int
-_flrec_wrrec(fcb, record, recnum, reclen)
- register Fcb *fcb;
- char *record;
- Recno recnum;
- int reclen;
+_flrec_wrrec(register Fcb *fcb, char *record, Recno recnum, int reclen)
{
long rec_position;
char delflag;
*/
static void
-remove_from_chain(fcb, recnum)
- Fcb *fcb;
- Recno recnum;
+remove_from_chain(Fcb *fcb, Recno recnum)
{
char recnobuf1 [RECNOSIZE] , recnobuf2 [RECNOSIZE];
long pos1, pos2;
*/
void
-_makedat_isfname(isfname)
- char *isfname;
+_makedat_isfname(char *isfname)
{
/* Append .rec */
(void) strcat(isfname, DAT_SUFFIX);
*/
void
-_makeind_isfname(isfname)
- char *isfname;
+_makeind_isfname(char *isfname)
{
/* Append .ind */
(void) strcat(isfname, IND_SUFFIX);
*/
void
-_makevar_isfname(isfname)
- char *isfname;
+_makevar_isfname(char *isfname)
{
/* Append .var */
(void) strcat(isfname, VAR_SUFFIX);
*/
void
-_removelast(path)
- char *path;
+_removelast(char *path)
{
register char *p;
*/
char *
-_lastelement(path)
- char *path;
+_lastelement(char *path)
{
register char *p;
#include "isam_impl.h"
void
-stkey(pkeydesc2, p)
- Keydesc2 *pkeydesc2;
- char *p;
+stkey(Keydesc2 *pkeydesc2, char *p)
{
int i;
register struct keypart2 *ppart;
}
void
-ldkey(pkeydesc2,p)
- register struct keydesc2 *pkeydesc2;
- register char *p;
+ldkey(register struct keydesc2 *pkeydesc2, register char *p)
{
int i;
register struct keypart2 *ppart;
#define dibuf ((struct dictinfo *)buffer)
int
-isindexinfo(isfd, buffer, number)
- int isfd;
- struct keydesc *buffer;
- int number;
+isindexinfo(int isfd, struct keydesc *buffer, int number)
{
register Fab *fab;
int ret;
*/
Blkno
-_isindfreel_alloc(fcb)
- Fcb *fcb;
+_isindfreel_alloc(Fcb *fcb)
{
Bufhdr *pbhdr;
char *p;
*/
void
-_isindfreel_free(fcb, blkno)
- Fcb *fcb;
- Blkno blkno;
+_isindfreel_free(Fcb *fcb, Blkno blkno)
{
Bufhdr *pbhdr;
char *p;
*/
void
-_iskey_extract (pkeydesc2, recp, keyp)
- Keydesc2 * pkeydesc2;
- char *recp;
- char *keyp;
+_iskey_extract (Keydesc2 *pkeydesc2, char *recp, char *keyp)
{
register int i;
register struct keypart2 *ppart;
* _allockpage()
*
* Allocate an initialize new key page.
+ *
+ * blkno, Output parameter
*/
Bufhdr *
-_allockpage(fcb, capac, level, blkno)
- Fcb *fcb;
- int capac;
- int level;
- Blkno *blkno; /* Output parameter */
+_allockpage(Fcb *fcb, int capac, int level, Blkno *blkno)
{
Bufhdr *pbufhdr;
char *p;
/* getkeysperleaf() - Calculate number of keys per leaf node */
int
-getkeysperleaf (keylen)
- int keylen;
+getkeysperleaf (int keylen)
{
int n;
/* getkeyspernode() - Calculate number of keys per non-leaf node */
int
-getkeyspernode (keylen)
- int keylen;
+getkeyspernode (int keylen)
{
int n;
/* le_odd(n) - Get next lower or equal odd number */
int
-le_odd(n)
- int n;
+le_odd(int n)
{
return ((n - 1) | 1);
}
* _iskeycmp_set()
*
* Set key decriptor and number of parts for subsequent key comparison.s
+ * nparts, Use only so many parts
*/
void
-_iskeycmp_set (pkeydesc2, nparts)
- Keydesc2 *pkeydesc2;
- int nparts; /* Use only so many parts */
+_iskeycmp_set (Keydesc2 *pkeydesc2, int nparts)
{
_ncurtab = nparts;
_curtab = pkeydesc2->k2_part;
*/
int
-_iskeycmp(lkey, rkey)
- char *lkey, *rkey;
+_iskeycmp(char *lkey, char *rkey)
{
int i, ret;
register struct keypart2 *p;
*/
int
-_validate_keydesc(keydesc, minreclen)
- register struct keydesc *keydesc;
- int minreclen;
+_validate_keydesc(register struct keydesc *keydesc, int minreclen)
{
int nparts;
register int i;
*/
static int
-_check_typelen(type, length)
- int type;
- int length;
+_check_typelen(int type, int length)
{
switch (type) {
case INTTYPE:
*/
void
-_iskey_fillmax(pkeydesc2, keybuf)
- struct keydesc2 *pkeydesc2;
- register char *keybuf;
+_iskey_fillmax(struct keydesc2 *pkeydesc2, register char *keybuf)
{
register int i;
register struct keypart2 *ppart;
*/
void
-_iskey_fillmin(pkeydesc2, keybuf)
- struct keydesc2 *pkeydesc2;
- register char *keybuf;
+_iskey_fillmin(struct keydesc2 *pkeydesc2, register char *keybuf)
{
register int i;
register struct keypart2 *ppart;
*/
void
-_mngfcb_insert(fcb, isfhandle)
- Fcb *fcb;
- Bytearray *isfhandle;
+_mngfcb_insert(Fcb *fcb, Bytearray *isfhandle)
{
int hashval = _hashisfhandle(isfhandle);
register int ind;
*/
Fcb *
-_mngfcb_find(isfhandle)
- Bytearray *isfhandle;
+_mngfcb_find(Bytearray *isfhandle)
{
int hashval = _hashisfhandle(isfhandle);
register int ind;
*/
void
-_mngfcb_delete(isfhandle)
- Bytearray *isfhandle;
+_mngfcb_delete(Bytearray *isfhandle)
{
int hashval = _hashisfhandle(isfhandle);
register int ind;
*/
Bytearray *
-_mngfcb_victim()
+_mngfcb_victim(void)
{
int victim_ind = -1;
long victim_time = 0; /* Assign to shut up lint */
*/
Static int
-_hashisfhandle(isfhandle)
- Bytearray *isfhandle;
+_hashisfhandle(Bytearray *isfhandle)
{
register char *p;
register unsigned h, g;
*/
int
-isopen(isfname, mode)
- char *isfname;
- int mode;
+isopen(char *isfname, int mode)
{
Fab *fab;
Isfd isfd;
return ((int)isfd); /* Successful isopen() */
}
-Static int _am_open(fab)
- register Fab *fab;
+Static int _am_open(register Fab *fab)
{
return (_amopen(fab->isfname, fab->openmode, &fab->varlength,
&fab->minreclen, &fab->maxreclen, &fab->isfhandle,
*/
void
-_isseekpg(fd, pgno)
- int fd;
- Blkno pgno;
+_isseekpg(int fd, Blkno pgno)
{
long offset = pgno * ISPAGESIZE;
*/
void
-_isreadpg(fd, buf)
- int fd;
- char *buf;
+_isreadpg(int fd, char *buf)
{
if (read(fd, buf, ISPAGESIZE) != ISPAGESIZE)
_isfatal_error("read failed");
*/
void
-_iswritepg(fd, buf)
- int fd;
- char *buf;
+_iswritepg(int fd, char *buf)
{
if (write(fd, buf, ISPAGESIZE) != ISPAGESIZE)
_isfatal_error("write failed");
*/
enum openmode
-_getopenmode(mode)
- int mode;
+_getopenmode(int mode)
{
switch (mode & ISOPENMODE) {
case ISINPUT:
*/
enum readmode
-_getreadmode(mode)
- int mode;
+_getreadmode(int mode)
{
switch (mode & ISREADMODE) {
case ISFIRST:
*/
int
-isread(isfd, record, mode)
- int isfd;
- char *record;
- int mode;
+isread(int isfd, char *record, int mode)
{
register Fab *fab;
int reclen;
*/
static int
-_amread(isfhandle, record, reclen, readmode, curpos, recnum, errcode)
- Bytearray *isfhandle;
- enum readmode readmode;
- char *record;
- int *reclen;
- Bytearray *curpos;
- Recno *recnum;
- struct errcode *errcode;
+_amread(Bytearray *isfhandle, char *record, int *reclen,
+ enum readmode readmode, Bytearray *curpos, Recno *recnum,
+ struct errcode *errcode)
{
Fcb *fcb = NULL;
Recno recnum2;
*/
int
-isrename(oldname, newname)
- char *oldname, *newname;
+isrename(char *oldname, char *newname)
{
Isfd isfd, isfd2;
Fab *fab;
*/
Static void
-_removelast2(path)
- char *path;
+_removelast2(char *path)
{
register char *p;
static int
-_amrename(isfhandle, newname, errcode)
- Bytearray *isfhandle;
- char *newname;
- struct errcode *errcode;
+_amrename(Bytearray *isfhandle, char *newname, struct errcode *errcode)
{
Fcb *fcb;
char *isfname = _getisfname(isfhandle);
}
+/* newname, with no prefix */
Static void
-_rename_datfile(isfname, newname)
- char *isfname;
- char *newname; /* with no prefix */
+_rename_datfile(char *isfname, char *newname)
{
char namebuf[MAXPATHLEN];
char newbuf[MAXPATHLEN];
(void)rename(namebuf, newbuf);
}
+/* newname, with no prefix */
Static void
-_rename_indfile(isfname, newname)
- char *isfname;
- char *newname; /* with no prefix */
+_rename_indfile(char *isfname, char *newname)
{
char namebuf[MAXPATHLEN];
char newbuf[MAXPATHLEN];
(void)rename(namebuf, newbuf);
}
+/* newname, with no prefix */
Static void
-_rename_varfile(isfname, newname)
- char *isfname;
- char *newname; /* with no prefix */
+_rename_varfile(char *isfname, char *newname)
{
char namebuf[MAXPATHLEN];
char newbuf[MAXPATHLEN];
Static rp_readcntlpg();
static int isnoprintf(const char *, ...);
-isrepair(isfname, verbose)
- char *isfname;
- int verbose;
+isrepair(char *isfname, int verbose)
{
extern char *rp_readrecord_v(), *rp_readrecord_f();
char cntlpg[ISCNTLSIZE];
/* rp_readcntlpg() - Read the control page */
Static
-rp_readcntlpg(datfd, cntlpg)
- int datfd;
- char *cntlpg;
+rp_readcntlpg(int datfd, char *cntlpg)
{
if (read (datfd, cntlpg, ISCNTLSIZE) != ISCNTLSIZE)
return (ISERROR);
/* rp_readrecord_f() - Read a record from .rec file */
Static char *
-rp_readrecord_f(datfd, offset, reclen)
- int datfd;
- long offset;
- int reclen;
+rp_readrecord_f(int datfd, long offset, int reclen)
{
if (lseek(datfd, offset, 0) != offset)
return ((char *) NULL);
/* rp_readrecord_v() - Read a record from .rec file */
Static char *
-rp_readrecord_v(datfd, varfd, offset, minreclen, maxreclen)
- int datfd, varfd;
- long offset;
- int minreclen, maxreclen;
+rp_readrecord_v(int datfd, int varfd, long offset, int minreclen, int maxreclen)
{
long tailoff;
char frameheadbuf [2 * SHORTSIZE];
}
static int
-typeletter(type)
- int type;
+typeletter(int type)
{
switch (type) {
case INTTYPE:
*/
int
-isrewcurr(isfd, record)
- int isfd;
- char *record;
+isrewcurr(int isfd, char *record)
{
register Fab *fab;
int reclen;
*/
static int
-_amrewcurr(isfhandle, record, reclen, curpos, recnum, errcode)
- Bytearray *isfhandle;
- char *record;
- int reclen;
- Recno *recnum;
- Bytearray *curpos;
- struct errcode *errcode;
+_amrewcurr(Bytearray *isfhandle, char *record, int reclen,
+ Bytearray *curpos, Recno *recnum, struct errcode *errcode)
{
Fcb *fcb;
Crp *crp;
}
Static int
-_changekeys2(fcb, record, oldrecord, recnum, curpos)
- Fcb *fcb;
- char *record;
- char *oldrecord;
- Recno recnum;
- Bytearray *curpos;
+_changekeys2(Fcb *fcb, char *record, char *oldrecord,
+ Recno recnum, Bytearray *curpos)
{
int nkeys = fcb->nkeys;
register int i;
*/
int
-isrewrec(isfd, recnum, record)
- int isfd;
- long recnum;
- char *record;
+isrewrec(int isfd, long recnum, char *record)
{
register Fab *fab;
int reclen;
*/
static int
-_amrewrec(isfhandle, record, reclen, recnum, errcode)
- Bytearray *isfhandle;
- char *record;
- int reclen;
- Recno recnum;
- struct errcode *errcode;
+_amrewrec(Bytearray *isfhandle, char *record, int reclen, Recno recnum,
+ struct errcode *errcode)
{
Fcb *fcb;
char oldrecbuf[ISMAXRECLEN];
}
static int
-_changekeys (fcb, record, oldrecord, recnum)
- Fcb *fcb;
- char *record;
- char *oldrecord;
- Recno recnum;
+_changekeys (Fcb *fcb, char *record, char *oldrecord, Recno recnum)
{
int nkeys = fcb->nkeys;
register int i;
static sigset_t allsignals;
-_issignals_cntl(opt)
- int opt; /* 1 will enable masking */
- /* 0 will disable masking */
+/* opt, 1 will enable masking, 0 will disable masking */
+_issignals_cntl(int opt)
{
int oldmask = do_mask;
*/
Issort *
-_issort_create(reclen,nrecs,compfunc)
- int reclen;
- int nrecs;
- int (*compfunc)();
+_issort_create(int reclen, int nrecs, int (*compfunc)())
{
Issort *p;
*/
void
-_issort_destroy(srt)
- Issort *srt;
+_issort_destroy(Issort *srt)
{
assert(srt->ist_array != (char *) 0);
*/
void
-_issort_insert(srt,record)
- register Issort *srt;
- char *record;
+_issort_insert(register Issort *srt, char *record)
{
assert(srt->ist_nrecs < srt->ist_allocrecs);
*/
void
-_issort_sort(srt)
- Issort *srt;
+_issort_sort(Issort *srt)
{
if (srt->ist_nrecs > 1)
qsort(srt->ist_array,srt->ist_nrecs,srt->ist_reclength,srt->ist_compf);
*/
void
-_issort_rewind(srt)
- Issort *srt;
+_issort_rewind(Issort *srt)
{
srt->ist_currec = 0;
}
*/
char *
-_issort_read(srt)
- register Issort *srt;
+_issort_read(register Issort *srt)
{
return((srt->ist_currec < srt->ist_nrecs) ?
(srt->ist_array + srt->ist_currec++ * srt->ist_reclength) :
*/
int
-isstart(isfd, keydesc, length, record, mode)
- int isfd;
- struct keydesc *keydesc;
- int length;
- char *record;
- int mode;
+isstart(int isfd, struct keydesc *keydesc, int length, char *record,
+ int mode)
{
register Fab *fab;
int reclen;
/* ARGSUSED */
static int
-_amstart(isfhandle, record, reclen, readmode,
- keydesc, keylen, curpos, recnum, errcode)
- Bytearray *isfhandle;
- enum readmode readmode;
- char *record;
- int *reclen;
- Bytearray *curpos;
- Recno *recnum;
- struct errcode *errcode;
- struct keydesc *keydesc;
- int keylen;
+_amstart(Bytearray *isfhandle, char *record, int *reclen,
+ enum readmode readmode, struct keydesc *keydesc, int keylen,
+ Bytearray *curpos, Recno *recnum, struct errcode *errcode)
{
Fcb *fcb;
Recno recnum2;
*/
int
-issync()
+issync(void)
{
return iscntl(ALLISFD, ISCNTL_FSYNC);
}
*/
int
-isfsync(isfd)
- int isfd;
+isfsync(int isfd)
{
return iscntl(isfd, ISCNTL_FSYNC);
}
-_issync()
+int _issync(void)
{
int i;
return (ISOK);
}
-_isfsync(isfd)
- int isfd;
+int _isfsync(int isfd)
{
register Fab *fab;
Fcb *fcb;
/*ARGSUSED*/
int
-_vlrec_write(fcb, record, recnum, reclen)
- register Fcb *fcb;
- char *record;
- Recno *recnum;
- int reclen;
+_vlrec_write(register Fcb *fcb, char *record, Recno *recnum, int reclen)
{
Recno recnum2;
long rec_position;
*/
int
-_vlrec_read(fcb, record, recnum, reclen)
- register Fcb *fcb;
- char *record;
- Recno recnum;
- int *reclen;
+_vlrec_read(register Fcb *fcb, char *record, Recno recnum, int *reclen)
{
long rec_position;
long tailoff;
*/
long
-_vl_getpos(fcb, recnum)
- Fcb *fcb;
- Recno recnum;
+_vl_getpos(Fcb *fcb, Recno recnum)
{
return ((long)(ISCNTLSIZE + (fcb->minreclen + LONGSIZE) * (recnum -1)));
}
/*ARGSUSED*/
int
-_vlrec_rewrite(fcb, record, recnum, reclen)
- register Fcb *fcb;
- char *record;
- Recno recnum;
- int reclen;
+_vlrec_rewrite(register Fcb *fcb, char *record, Recno recnum, int reclen)
{
long rec_position;
long tailoff;
*/
int
-_vlrec_delete(fcb, recnum)
- register Fcb *fcb;
- Recno recnum;
+_vlrec_delete(register Fcb *fcb, Recno recnum)
{
long rec_position;
long tailoff;
/*ARGSUSED*/
int
-_vlrec_wrrec(fcb, record, recnum, reclen)
- register Fcb *fcb;
- char *record;
- Recno recnum;
- int reclen;
+_vlrec_wrrec(register Fcb *fcb, char *record, Recno recnum, int reclen)
{
long rec_position;
long tailoff;
*/
static void
-remove_from_chain2(fcb, recnum)
- Fcb *fcb;
- Recno recnum;
+remove_from_chain2(Fcb *fcb, Recno recnum)
{
char recnobuf1 [RECNOSIZE] , recnobuf2 [RECNOSIZE];
long pos1, pos2;
/* Insert tail into .var file. Return offset in .var file */
-long _istail_insert(fcb, tailp, taillen)
- Fcb *fcb;
- char *tailp;
- int taillen;
+long _istail_insert(Fcb *fcb, char *tailp, int taillen)
{
char frameheadbuf [2 * SHORTSIZE];
int framelen;
/* Remove tail from .var file */
/* ARGSUSED */
-Static void _istail_delete(fcb, offset)
- Fcb *fcb;
- long offset;
+Static void _istail_delete(Fcb *fcb, long offset)
{
/*
* Don't do anything in NetISAM 1.0. The tails are lost, the space
/* Read tail from .var file */
-Static _istail_read(fcb, offset, buffer)
- Fcb *fcb;
- long offset;
- char *buffer;
+Static _istail_read(Fcb *fcb, long offset, char *buffer)
{
char frameheadbuf [2 * SHORTSIZE];
int taillen;
/* Rewrite tail. Returns -1 if the new tail is longer than the original frame */
-int _istail_modify(fcb, offset, tailp, taillen)
- Fcb *fcb;
- long offset;
- int taillen;
- char *tailp;
+int _istail_modify(Fcb *fcb, long offset, char *tailp, int taillen)
{
char frameheadbuf [2 * SHORTSIZE];
int framelen;
*/
int
-iswrite(isfd, record)
- int isfd;
- char *record;
+iswrite(int isfd, char *record)
{
int _am_write();
register Fab *fab;
}
-Static int _am_write(fab, record, reclen, curpos, recnum)
- register Fab *fab;
- char *record;
- int reclen;
- Bytearray *curpos;
- Recno *recnum;
+Static int _am_write(register Fab *fab, char *record, int reclen,
+ Bytearray *curpos, Recno *recnum)
{
return (_amwrite(&fab->isfhandle, record, reclen,
curpos, recnum, &fab->errcode));
*/
int
-iswrrec(isfd, recnum, record)
- int isfd;
- long recnum;
- char *record;
+iswrrec(int isfd, long recnum, char *record)
{
register Fab *fab;
int reclen;
*/
static int
-_amwrrec(isfhandle, record, reclen, recnum, errcode)
- Bytearray *isfhandle;
- char *record;
- int reclen;
- Recno recnum;
- struct errcode *errcode;
+_amwrrec(Bytearray *isfhandle, char *record, int reclen, Recno recnum,
+ struct errcode *errcode)
{
Fcb *fcb = NULL;
int err;