1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

libtt: Change to ANSI function definitions

This commit is contained in:
Peter Howkins 2018-06-28 04:06:47 +01:00
parent 6b09b19351
commit 020d592338
62 changed files with 275 additions and 706 deletions

View file

@ -172,9 +172,7 @@ _ttdnd_get_contents(
* callback, and sends a message for the next chunk if necessary. * callback, and sends a message for the next chunk if necessary.
*/ */
static Tt_callback_action static Tt_callback_action
_ttdnd_continue_transfer(m,p) _ttdnd_continue_transfer(Tt_message m, Tt_pattern p)
Tt_message m;
Tt_pattern p;
{ {
Ttdnd_receive_data_func *receivefunc; Ttdnd_receive_data_func *receivefunc;
int sourceXid; int sourceXid;
@ -233,9 +231,7 @@ _ttdnd_continue_transfer(m,p)
* from the user's send routine, and fills it into the message. * from the user's send routine, and fills it into the message.
*/ */
static Tt_callback_action static Tt_callback_action
_ttdnd_get_contents_callback(m, p) _ttdnd_get_contents_callback(Tt_message m, Tt_pattern p)
Tt_message m;
Tt_pattern p;
{ {
int chunknumber; int chunknumber;
int maxchunk; int maxchunk;
@ -282,7 +278,7 @@ _ttdnd_get_contents_callback(m, p)
* tt messages whenever the tt filedescriptor has input. * tt messages whenever the tt filedescriptor has input.
*/ */
void void
_ttdnd_receive() _ttdnd_receive(void)
{ {
Tt_message m; Tt_message m;
m = tt_message_receive(); m = tt_message_receive();

View file

@ -46,12 +46,7 @@
extern long *ismaxlong; extern long *ismaxlong;
int int
_add1key(fcb, pkeydesc2, record, recnum, newkey) _add1key(Fcb *fcb, Keydesc2 *pkeydesc2, char *record, Recno recnum, char *newkey)
Fcb *fcb;
Keydesc2 *pkeydesc2;
char *record;
Recno recnum;
char *newkey;
{ {
char keybuf[MAXKEYSIZE]; char keybuf[MAXKEYSIZE];
Btree *btree; Btree *btree;

View file

@ -59,9 +59,7 @@ static char sccsid[] = "@(#)isaddindex.c 1.8 89/07/17 Copyr 1988 Sun Micro";
*/ */
int int
isaddindex(isfd, keydesc) isaddindex(int isfd, struct keydesc *keydesc)
int isfd;
struct keydesc *keydesc;
{ {
int _amaddindex(); int _amaddindex();
register Fab *fab; register Fab *fab;

View file

@ -65,9 +65,7 @@ Static int _am_addprimary();
*/ */
int int
isaddprimary(isfd, keydesc) isaddprimary(int isfd, struct keydesc *keydesc)
int isfd;
struct keydesc *keydesc;
{ {
register Fab *fab; register Fab *fab;
int ret; int ret;
@ -94,9 +92,7 @@ isaddprimary(isfd, keydesc)
return (ret); /* Successful write */ return (ret); /* Successful write */
} }
Static int _am_addprimary(fab, keydesc) Static int _am_addprimary(register Fab *fab, struct keydesc *keydesc)
register Fab *fab;
struct keydesc *keydesc;
{ {
return (_amaddprimary(&fab->isfhandle, keydesc, &fab->errcode)); return (_amaddprimary(&fab->isfhandle, keydesc, &fab->errcode));
} }

View file

@ -56,8 +56,7 @@ extern char *strdup();
* Allocate nbytes. * Allocate nbytes.
*/ */
char *_ismalloc(nbytes) char *_ismalloc(unsigned int nbytes)
unsigned int nbytes;
{ {
register char *p; register char *p;
@ -67,9 +66,7 @@ char *_ismalloc(nbytes)
return (p); return (p);
} }
char *_isrealloc(oldaddr, nbytes) char *_isrealloc(char *oldaddr, unsigned int nbytes)
char *oldaddr;
unsigned int nbytes;
{ {
register char *p; register char *p;
@ -87,8 +84,7 @@ char *_isrealloc(oldaddr, nbytes)
*/ */
char * char *
_isallocstring(str) _isallocstring(char *str)
char *str;
{ {
register char *p; register char *p;
@ -105,8 +101,7 @@ _isallocstring(str)
*/ */
void void
_isfreestring(str) _isfreestring(char *str)
char *str;
{ {
assert(str != NULL); assert(str != NULL);
free(str); free(str);

View file

@ -57,7 +57,10 @@ extern long ldlong();
extern float ldfloat(); extern float ldfloat();
extern double lddbl(); extern double lddbl();
extern short ldshort(); 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 int iserrno; /* isam error number code */
extern long isrecnum; /* record number of last call */ extern long isrecnum; /* record number of last call */

View file

@ -162,7 +162,8 @@ typedef struct bytearray {
char *data; char *data;
} Bytearray; } 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(); extern void _bytearr_free();

View file

@ -68,10 +68,7 @@ static void checkavailfd(void);
/*ARGSUSED*/ /*ARGSUSED*/
int int
_amaddindex(isfhandle, keydesc, errcode) _amaddindex(Bytearray *isfhandle, struct keydesc *keydesc, struct errcode *errcode)
Bytearray *isfhandle;
struct keydesc *keydesc;
struct errcode *errcode;
{ {
Fcb *fcb = NULL; Fcb *fcb = NULL;
Keydesc2 keydesc2; Keydesc2 keydesc2;
@ -195,10 +192,7 @@ _amaddindex(isfhandle, keydesc, errcode)
/*ARGSUSED*/ /*ARGSUSED*/
int int
_amaddprimary(isfhandle, keydesc, errcode) _amaddprimary(Bytearray *isfhandle, struct keydesc *keydesc, struct errcode *errcode)
Bytearray *isfhandle;
struct keydesc *keydesc;
struct errcode *errcode;
{ {
Fcb *fcb = NULL; Fcb *fcb = NULL;
Keydesc2 keydesc2; Keydesc2 keydesc2;
@ -319,9 +313,7 @@ _amaddprimary(isfhandle, keydesc, errcode)
* Check unique constraint, create duplicate serial numbers. * Check unique constraint, create duplicate serial numbers.
*/ */
int _create_index(fcb, pkeydesc2) int _create_index(Fcb *fcb, Keydesc2 *pkeydesc2)
Fcb *fcb;
Keydesc2 *pkeydesc2;
{ {
Issort *srt; Issort *srt;
int keylength = pkeydesc2->k2_len; int keylength = pkeydesc2->k2_len;
@ -391,10 +383,7 @@ int _create_index(fcb, pkeydesc2)
*/ */
Static void Static void
_readallrecords(fcb, srt, pkeydesc2) _readallrecords(Fcb *fcb, Issort *srt, Keydesc2 *pkeydesc2)
Fcb *fcb;
Issort *srt;
Keydesc2 *pkeydesc2;
{ {
char record [ISMAXRECLEN]; char record [ISMAXRECLEN];
char keybuf [MAXKEYSIZE]; char keybuf [MAXKEYSIZE];
@ -436,9 +425,7 @@ _readallrecords(fcb, srt, pkeydesc2)
*/ */
Static void Static void
_attach_dups_serial(srt, pkeydesc2) _attach_dups_serial(Issort *srt, Keydesc2 *pkeydesc2)
Issort *srt;
Keydesc2 *pkeydesc2;
{ {
int netkeylength = pkeydesc2->k2_len - RECNOSIZE - DUPIDSIZE; int netkeylength = pkeydesc2->k2_len - RECNOSIZE - DUPIDSIZE;
char *curkey; char *curkey;
@ -471,10 +458,7 @@ _attach_dups_serial(srt, pkeydesc2)
*/ */
Static Blkno Static Blkno
_buildbtree(fcb, pkeydesc2, srt) _buildbtree(Fcb *fcb, Keydesc2 *pkeydesc2, Issort *srt)
Fcb *fcb;
Keydesc2 *pkeydesc2;
Issort *srt;
{ {
Bufhdr *_allockpage(); Bufhdr *_allockpage();
int depth; int depth;
@ -628,9 +612,7 @@ _buildbtree(fcb, pkeydesc2, srt)
* Return 1 if there are duplicates in the sorted key object. * Return 1 if there are duplicates in the sorted key object.
*/ */
Static int _duplicate_exist(srt, keylength) Static int _duplicate_exist(Issort *srt, int keylength)
Issort *srt;
int keylength;
{ {
char *curkey; char *curkey;
char *lastkey = (char *) 0; char *lastkey = (char *) 0;

View file

@ -60,10 +60,7 @@ void _delkeys();
*/ */
int int
_amdelrec(isfhandle, recnum, errcode) _amdelrec(Bytearray *isfhandle, Recno recnum, struct errcode *errcode)
Bytearray *isfhandle;
Recno recnum;
struct errcode *errcode;
{ {
Fcb *fcb = NULL; Fcb *fcb = NULL;
char recbuf[ISMAXRECLEN]; char recbuf[ISMAXRECLEN];
@ -145,10 +142,7 @@ _amdelrec(isfhandle, recnum, errcode)
*/ */
void void
_delkeys(fcb, record, recnum) _delkeys(register Fcb *fcb, char *record, Recno recnum)
register Fcb *fcb;
char *record;
Recno recnum;
{ {
int nkeys = fcb->nkeys; int nkeys = fcb->nkeys;
register int i; register int i;

View file

@ -86,9 +86,7 @@ static struct errstattab {
*/ */
void void
_amseterrcode(errcode, is_errno) _amseterrcode(struct errcode *errcode, int is_errno)
struct errcode *errcode;
int is_errno;
{ {
register struct errstattab *p; register struct errstattab *p;
errcode->iserrno = is_errno; errcode->iserrno = is_errno;

View file

@ -50,7 +50,7 @@ extern struct dlink *pavail;
*/ */
void void
_isam_entryhook() _isam_entryhook(void)
{ {
isdupl = 0; /* Reset duplicate indicator */ isdupl = 0; /* Reset duplicate indicator */
_setiserrno2(0, '0', '0'); _setiserrno2(0, '0', '0');
@ -62,7 +62,7 @@ _isam_entryhook()
*/ */
void void
_isam_exithook() _isam_exithook(void)
{ {
_isdisk_inval(); /* Invalidate all buffers */ _isdisk_inval(); /* Invalidate all buffers */
} }

View file

@ -65,15 +65,9 @@ static char sccsid[] = "@(#)isamopen.c 1.10 89/07/17 Copyr 1988 Sun Micro";
/* ARGSUSED */ /* ARGSUSED */
int int
_amopen(isfname, openmode, varflag, minlen, maxlen, _amopen(char *isfname, enum openmode openmode, Bool *varflag,
isfhandle, curpos, errcode) int *minlen, int *maxlen, Bytearray *isfhandle,
char *isfname; Bytearray *curpos, struct errcode *errcode)
enum openmode openmode;
Bool *varflag;
int *minlen, *maxlen;
Bytearray *isfhandle;
Bytearray *curpos;
struct errcode *errcode;
{ {
Fcb *fcb; Fcb *fcb;
Bytearray isfhandle0; Bytearray isfhandle0;
@ -182,9 +176,7 @@ _amopen(isfname, openmode, varflag, minlen, maxlen,
#define FDNEEDED 3 /* Needs 3 UNIX fd to open a file*/ #define FDNEEDED 3 /* Needs 3 UNIX fd to open a file*/
Fcb * Fcb *
_openfcb(isfhandle, errcode) _openfcb(Bytearray *isfhandle, struct errcode *errcode)
Bytearray *isfhandle;
struct errcode *errcode;
{ {
Fcb *fcb; Fcb *fcb;
Bytearray *isfhandle2; Bytearray *isfhandle2;
@ -300,8 +292,7 @@ _openfcb(isfhandle, errcode)
*/ */
char * char *
_getisfname(isfhandle) _getisfname(Bytearray *isfhandle)
Bytearray *isfhandle;
{ {
return (isfhandle->data); return (isfhandle->data);
} }
@ -314,8 +305,7 @@ _getisfname(isfhandle)
*/ */
Bytearray Bytearray
_makeisfhandle(isfname) _makeisfhandle(char *isfname)
char *isfname;
{ {
return (_bytearr_new((u_short)(strlen(isfname) + 1), isfname)); return (_bytearr_new((u_short)(strlen(isfname) + 1), isfname));
} }

View file

@ -66,13 +66,8 @@ extern long *ismaxlong;
*/ */
int int
_amwrite(isfhandle, record, reclen, curpos, recnum, errcode) _amwrite(Bytearray *isfhandle, char *record, int reclen,
Bytearray *isfhandle; Bytearray *curpos, Recno *recnum, struct errcode *errcode)
char *record;
int reclen;
Bytearray *curpos;
Recno *recnum;
struct errcode *errcode;
{ {
Fcb *fcb = NULL; Fcb *fcb = NULL;
Recno recnum2; Recno recnum2;
@ -166,10 +161,7 @@ _amwrite(isfhandle, record, reclen, curpos, recnum, errcode)
* Returns ISOK, or EDUPS. * Returns ISOK, or EDUPS.
*/ */
int _addkeys (fcb, record, recnum) int _addkeys (register Fcb *fcb, char *record, Recno recnum)
register Fcb *fcb;
char *record;
Recno recnum;
{ {
int nkeys = fcb->nkeys; int nkeys = fcb->nkeys;
register int i; register int i;
@ -185,11 +177,7 @@ int _addkeys (fcb, record, recnum)
} }
Static int Static int
_addkeys2 (fcb, record, recnum, curpos) _addkeys2 (Fcb *fcb, char *record, Recno recnum, Bytearray *curpos)
Fcb *fcb;
char *record;
Recno recnum;
Bytearray *curpos;
{ {
int nkeys = fcb->nkeys; int nkeys = fcb->nkeys;
register int i; register int i;

View file

@ -55,9 +55,7 @@ static char sccsid[] = "@(#)isapplmr.c 1.5 89/07/17 Copyr 1988 Sun Micro";
*/ */
int int
_isapplmr(isfd, buffer) _isapplmr(int isfd, char *buffer)
int isfd;
char *buffer;
{ {
register Fab *fab; register Fab *fab;
Fcb *fcb = NULL; Fcb *fcb = NULL;

View file

@ -54,9 +54,7 @@ static char sccsid[] = "@(#)isapplmw.c 1.5 89/07/17 Copyr 1988 Sun Micro";
*/ */
int int
_isapplmw(isfd, magicstring) _isapplmw(int isfd, char *magicstring)
int isfd;
char *magicstring;
{ {
register Fab *fab; register Fab *fab;
int ret; int ret;

View file

@ -45,12 +45,7 @@ static char sccsid[] = "@(#)isbsearch.c 1.3 89/07/17 Copyr 1988 Sun Micro";
*/ */
char *_isbsearch (key,table,nelems,keylen,cmpf) char *_isbsearch (char *key, char *table, int nelems, int keylen, int (*cmpf) ())
char *key;
char *table;
int nelems;
int keylen;
int (*cmpf) ();
{ {
register int len,l1,result; /* current length of array to search */ register int len,l1,result; /* current length of array to search */
register char *p,*low; register char *p,*low;

View file

@ -53,9 +53,7 @@ extern int _iskeycmp();
*/ */
Btree * Btree *
_isbtree_create(fcb, pkeydesc2) _isbtree_create(Fcb *fcb, Keydesc2 *pkeydesc2)
Fcb *fcb;
Keydesc2 *pkeydesc2;
{ {
register Btree *p; register Btree *p;
@ -76,8 +74,7 @@ Keydesc2 *pkeydesc2;
*/ */
void void
_isbtree_destroy(btree) _isbtree_destroy(register Btree *btree)
register Btree *btree;
{ {
register int i; register int i;
@ -95,9 +92,7 @@ _isbtree_destroy(btree)
*/ */
void void
_isbtree_search(btree, key) _isbtree_search( register Btree *btree, char *key)
register Btree *btree;
char *key; /* Search for this key */
{ {
Keydesc2 *pkeydesc2 = btree->keydesc2; Keydesc2 *pkeydesc2 = btree->keydesc2;
Blkno rootblkno = pkeydesc2->k2_rootnode; Blkno rootblkno = pkeydesc2->k2_rootnode;
@ -149,8 +144,7 @@ char *key; /* Search for this key */
*/ */
char * char *
_isbtree_current(btree) _isbtree_current(register Btree *btree)
register Btree *btree;
{ {
int curpos; int curpos;
@ -169,8 +163,7 @@ _isbtree_current(btree)
*/ */
char * char *
_isbtree_next(btree) _isbtree_next(register Btree *btree)
register Btree *btree;
{ {
int curpos; int curpos;
int depth = btree->depth; int depth = btree->depth;

View file

@ -81,11 +81,7 @@ static int _ambuild();
*/ */
int int
isbuild(isfname, recordlength, primkey, mode) isbuild(char *isfname, int recordlength, struct keydesc *primkey, int mode)
char *isfname;
int recordlength;
struct keydesc *primkey;
int mode;
{ {
Fab *fab; Fab *fab;
Isfd isfd; Isfd isfd;
@ -191,18 +187,12 @@ isbuild(isfname, recordlength, primkey, mode)
/* ARGSUSED */ /* ARGSUSED */
static int static int
_ambuild(isfname, openmode, varflag, minlen, maxlen, primkey, _ambuild(char *isfname, enum openmode openmode, Bool varflag,
owner, group, umask, isfhandle, curpos, errcode) int minlen, int maxlen, struct keydesc *primkey,
char *isfname; int owner, int group, int umask,
enum openmode openmode; Bytearray *isfhandle, Bytearray *curpos,
Bool varflag; struct errcode *errcode)
int minlen, maxlen;
struct keydesc *primkey;
int owner, group;
Bytearray *isfhandle;
Bytearray *curpos;
struct errcode *errcode;
int umask;
{ {
Fcb *fcb = NULL; Fcb *fcb = NULL;
Bytearray *isfhandle2; Bytearray *isfhandle2;

View file

@ -51,7 +51,7 @@ static char sccsid[] = "@(#)isbytearray.c 1.3 89/07/17 Copyr 1988 Sun Micro";
*/ */
Bytearray Bytearray
_bytearr_getempty() _bytearr_getempty(void)
{ {
static Bytearray empty_bytearray = { 0, NULL}; static Bytearray empty_bytearray = { 0, NULL};
@ -65,9 +65,7 @@ _bytearr_getempty()
*/ */
Bytearray Bytearray
_bytearr_new(len, data) _bytearr_new(u_short len, char *data)
u_short len;
char *data;
{ {
Bytearray bytearray; Bytearray bytearray;
@ -85,8 +83,7 @@ _bytearr_new(len, data)
*/ */
Bytearray Bytearray
_bytearr_dup(old) _bytearr_dup(Bytearray *old)
Bytearray *old;
{ {
return (_bytearr_new(old->length, old->data)); return (_bytearr_new(old->length, old->data));
} }
@ -98,8 +95,7 @@ _bytearr_dup(old)
*/ */
void void
_bytearr_free(barray) _bytearr_free(register Bytearray *barray)
register Bytearray *barray;
{ {
if (barray->data) if (barray->data)
free(barray->data); free(barray->data);
@ -115,8 +111,7 @@ _bytearr_free(barray)
*/ */
int int
_bytearr_cmp(l,r) _bytearr_cmp(register Bytearray *l, register Bytearray *r)
register Bytearray *l, *r;
{ {
if (l->length == r->length) if (l->length == r->length)
return (memcmp(l->data, r->data, (int)l->length)); return (memcmp(l->data, r->data, (int)l->length));

View file

@ -46,13 +46,8 @@ static char sccsid[] = "@(#)ischange1key.c 1.3 89/07/17 Copyr 1988 Sun Micro";
extern long *ismaxlong; extern long *ismaxlong;
int int
_change1key(fcb, pkeydesc2, record, oldrecord, recnum, newkey) _change1key(Fcb *fcb, Keydesc2 *pkeydesc2, char *record,
Fcb *fcb; char *oldrecord, Recno recnum, char *newkey)
Keydesc2 *pkeydesc2;
char *record;
char *oldrecord;
Recno recnum;
char *newkey;
{ {
char keybuf1[MAXKEYSIZE]; char keybuf1[MAXKEYSIZE];
char keybuf2[MAXKEYSIZE]; char keybuf2[MAXKEYSIZE];

View file

@ -57,8 +57,7 @@ static char sccsid[] = "@(#)isclose.c 1.8 89/07/17 Copyr 1988 Sun Micro";
*/ */
int int
isclose(isfd) isclose(int isfd)
int isfd;
{ {
Fab *fab; Fab *fab;
Fcb *fcb; Fcb *fcb;

View file

@ -53,10 +53,7 @@ static char sccsid[] = "@(#)iscurpos.c 1.5 89/07/17 Copyr 1988 Sun Micro";
*/ */
int int
isgetcurpos(isfd, len, buf) isgetcurpos(int isfd, int *len, char **buf)
int isfd;
int *len;
char **buf;
{ {
Fab *fab; Fab *fab;
u_short total_len; u_short total_len;
@ -94,9 +91,7 @@ isgetcurpos(isfd, len, buf)
*/ */
int int
issetcurpos(isfd, buf) issetcurpos(int isfd, char *buf)
int isfd;
char *buf;
{ {
Fab *fab; Fab *fab;
u_short len; u_short len;

View file

@ -53,8 +53,7 @@ static char sccsid[] = "@(#)isdatconv.c 1.5 89/07/17 Copyr 1988 Sun Micro";
/* ldlong() - Load a long integer from a potentially unaligned address */ /* ldlong() - Load a long integer from a potentially unaligned address */
long long
ldlong(p) ldlong(register char *p)
register char *p;
{ {
int i; int i;
#if LONG_BIT == 64 #if LONG_BIT == 64
@ -73,9 +72,7 @@ ldlong(p)
/* stlong() - Store a long integer at a potentially unaligned address */ /* stlong() - Store a long integer at a potentially unaligned address */
int int
stlong(val, p) stlong(register long val, register char *p)
register long val;
register char *p;
{ {
int i; int i;
p += LONGSIZE; p += LONGSIZE;
@ -89,8 +86,7 @@ stlong(val, p)
/* ldint() - Load a short integer from a potentially unaligned address */ /* ldint() - Load a short integer from a potentially unaligned address */
short short
ldint(p) ldint(register char *p)
register char *p;
{ {
register unsigned int val; register unsigned int val;
@ -104,8 +100,7 @@ ldint(p)
/* ldunshort - load a unshort integer : for 64K record length */ /* ldunshort - load a unshort integer : for 64K record length */
u_short u_short
ldunshort(p) ldunshort(register char *p)
register char *p;
{ {
register unsigned int val; register unsigned int val;
@ -118,9 +113,7 @@ ldunshort(p)
/* stint() - Store a short integer at a potentially unaligned address */ /* stint() - Store a short integer at a potentially unaligned address */
int int
stint(val, p) stint(register short val, register char *p)
register short val;
register char *p;
{ {
p += SHORTSIZE; p += SHORTSIZE;
*--p = val & 255; *--p = val & 255;
@ -132,10 +125,7 @@ stint(val, p)
/* ldchar() - Load character field */ /* ldchar() - Load character field */
int int
ldchar(src, len, dst) ldchar(char *src, int len, register char *dst)
char *src;
register char *dst;
int len;
{ {
register char *p; register char *p;
@ -158,10 +148,7 @@ ldchar(src, len, dst)
} }
int int
stchar(src, dst, len) stchar(register char *src, register char *dst, register int len)
register char *src;
register char *dst;
register int len;
{ {
register char c; register char c;
@ -184,10 +171,7 @@ stchar(src, dst, len)
/* ldchar2() - Load character field (C style, NULL padded) */ /* ldchar2() - Load character field (C style, NULL padded) */
int int
ldchar2(src, len, dst) ldchar2(char *src, int len, register char *dst)
char *src;
register char *dst;
int len;
{ {
register char *p; register char *p;
@ -201,10 +185,7 @@ ldchar2(src, len, dst)
} }
int int
stchar2(src, dst, len) stchar2(register char *src, register char *dst, register int len)
register char *src;
register char *dst;
register int len;
{ {
register char c; register char c;
@ -227,8 +208,7 @@ stchar2(src, dst, len)
/* ldfloat() - Load a float number from a potentially unaligned address */ /* ldfloat() - Load a float number from a potentially unaligned address */
float float
ldfloat(p) ldfloat(register char *p)
register char *p;
{ {
union { union {
float fval; float fval;
@ -247,10 +227,9 @@ ldfloat(p)
/* stfloat() - Store a float number at a potentially unaligned address */ /* stfloat() - Store a float number at a potentially unaligned address */
/* f, Bug - it is passed as double */
int int
stfloat(f, p) stfloat(float f, register char *p)
float f; /* Bug - it is passed as double */
register char *p;
{ {
register unsigned val; register unsigned val;
union { union {
@ -275,8 +254,7 @@ stfloat(f, p)
/* ldbld() - Load a double float number from a potentially unaligned address */ /* ldbld() - Load a double float number from a potentially unaligned address */
double double
lddbl(p) lddbl(register char *p)
register char *p;
{ {
double val; double val;
@ -287,9 +265,7 @@ lddbl(p)
/* stdbl() - Store a double float number at a potentially unaligned address */ /* stdbl() - Store a double float number at a potentially unaligned address */
int int
stdbl(val, p) stdbl(double val, register char *p)
double val;
register char *p;
{ {
memcpy ( p,(char *)&val, DOUBLESIZE); memcpy ( p,(char *)&val, DOUBLESIZE);
return 0; return 0;
@ -300,8 +276,7 @@ stdbl(val, p)
/* ldbld() - Load a double float number from a potentially unaligned address */ /* ldbld() - Load a double float number from a potentially unaligned address */
double double
lddbl(p) lddbl(register char *p)
register char *p;
{ {
union { union {
double rval; double rval;
@ -322,9 +297,7 @@ lddbl(p)
/* stdbl() - Store a double float number at a potentially unaligned address */ /* stdbl() - Store a double float number at a potentially unaligned address */
int int
stdbl(val, p) stdbl(double val, register char *p)
double val;
register char *p;
{ {
union { union {
double rval; double rval;

View file

@ -44,11 +44,7 @@ static char sccsid[] = "@(#)isdel1key.c 1.3 89/07/17 Copyr 1988 Sun Micro";
#include "isam_impl.h" #include "isam_impl.h"
void void
_del1key(fcb, pkeydesc2, record, recnum) _del1key(Fcb *fcb, Keydesc2 *pkeydesc2, char *record, Recno recnum)
Fcb *fcb;
Keydesc2 *pkeydesc2;
char *record;
Recno recnum;
{ {
char keybuf[MAXKEYSIZE]; char keybuf[MAXKEYSIZE];
Btree *btree; Btree *btree;

View file

@ -65,8 +65,7 @@ static int _amdelcurr();
*/ */
int int
isdelcurr(isfd) isdelcurr(int isfd)
int isfd;
{ {
int _am_delcurr(); int _am_delcurr();
register Fab *fab; register Fab *fab;
@ -115,11 +114,8 @@ isdelcurr(isfd)
*/ */
static int static int
_amdelcurr(isfhandle, curpos, recnum, errcode) _amdelcurr(Bytearray *isfhandle, Bytearray *curpos, Recno *recnum,
Bytearray *isfhandle; struct errcode *errcode)
Bytearray *curpos;
Recno *recnum;
struct errcode *errcode;
{ {
Fcb *fcb = NULL; Fcb *fcb = NULL;
Crp *crp; Crp *crp;

View file

@ -63,9 +63,7 @@ static char sccsid[] = "@(#)isdelrec.c 1.8 89/07/17 Copyr 1988 Sun Micro";
*/ */
int int
isdelrec(isfd, recnum) isdelrec(int isfd, long recnum)
int isfd;
long recnum;
{ {
int _amdelrec(); int _amdelrec();
register Fab *fab; register Fab *fab;

View file

@ -94,12 +94,9 @@ static int maxavailn; /* Stop flushing when
/* unixfd, .rec, .ind., .var */
Bufhdr * Bufhdr *
_isdisk_fix(fcb, unixfd, blkno, mode) _isdisk_fix(Fcb *fcb, int unixfd, Blkno blkno, int mode)
Fcb *fcb;
int unixfd; /* .rec, .ind., .var */
Blkno blkno;
int mode;
{ {
register Bufhdr *p, *p2; register Bufhdr *p, *p2;
struct dlink *hashl; struct dlink *hashl;
@ -199,8 +196,7 @@ _isdisk_fix(fcb, unixfd, blkno, mode)
} }
void void
_isdisk_unfix (p) _isdisk_unfix (register Bufhdr *p)
register Bufhdr *p;
{ {
if (!(p->isb_flags & ISB_FIXED)) if (!(p->isb_flags & ISB_FIXED))
assert(p->isb_flags & ISB_FIXED); assert(p->isb_flags & ISB_FIXED);
@ -221,14 +217,13 @@ _isdisk_unfix (p)
} }
void void
_isdisk_commit1 (p) _isdisk_commit1 (Bufhdr *p)
Bufhdr *p;
{ {
_commit1buffer(p); _commit1buffer(p);
} }
void void
_isdisk_commit() _isdisk_commit(void)
{ {
register Bufhdr *p; register Bufhdr *p;
struct dlink *e; struct dlink *e;
@ -241,7 +236,7 @@ _isdisk_commit()
} }
void void
_isdisk_rollback() _isdisk_rollback(void)
{ {
register Bufhdr *p; register Bufhdr *p;
struct dlink *e; struct dlink *e;
@ -257,9 +252,7 @@ _isdisk_rollback()
} }
Bufhdr * Bufhdr *
_isdisk_refix(p, newmode) _isdisk_refix(Bufhdr *p, int newmode)
Bufhdr *p;
int newmode;
{ {
Blkno blkno = p->isb_blkno; Blkno blkno = p->isb_blkno;
Fcb *fcb = p->isb_fcb; Fcb *fcb = p->isb_fcb;
@ -276,7 +269,7 @@ _isdisk_refix(p, newmode)
} }
void void
_isdisk_sync() _isdisk_sync(void)
{ {
extern time_t _istimeget(); extern time_t _istimeget();
register Bufhdr *p; register Bufhdr *p;
@ -291,7 +284,7 @@ _isdisk_sync()
} }
void void
_isdisk_inval() _isdisk_inval(void)
{ {
extern time_t _istimeget(); extern time_t _istimeget();
register Bufhdr *p; register Bufhdr *p;
@ -318,7 +311,7 @@ _isdisk_inval()
#if ISDEBUG #if ISDEBUG
_isdisk_dumphd() _isdisk_dumphd(void)
{ {
register Bufhdr *p; register Bufhdr *p;
int i; int i;
@ -332,8 +325,7 @@ _isdisk_dumphd()
p->isb_oldcopy?(p->isb_oldcopy - bufhdrs):-1); p->isb_oldcopy?(p->isb_oldcopy - bufhdrs):-1);
} }
aclistdump(lh) aclistdump(struct dlink *lh)
struct dlink *lh;
{ {
register Bufhdr *p; register Bufhdr *p;
struct dlink *e; struct dlink *e;
@ -347,8 +339,7 @@ aclistdump(lh)
} }
} }
flistdump(lh) flistdump(struct dlink *lh)
struct dlink *lh;
{ {
register Bufhdr *p; register Bufhdr *p;
struct dlink *e; struct dlink *e;
@ -368,7 +359,7 @@ flistdump(lh)
/*------------------------ Local functions ---------------------------------*/ /*------------------------ Local functions ---------------------------------*/
Static void Static void
_disk_init() _disk_init(void)
{ {
static Bool initialized = FALSE; static Bool initialized = FALSE;
register int i; register int i;
@ -403,7 +394,7 @@ _disk_init()
/* _getavail() - get available buffer in disk */ /* _getavail() - get available buffer in disk */
Static Bufhdr * Static Bufhdr *
_getavail() _getavail(void)
{ {
register Bufhdr *p; register Bufhdr *p;
register struct dlink *q; register struct dlink *q;
@ -424,10 +415,7 @@ _getavail()
/* _findblock() - Find block in buffer pool */ /* _findblock() - Find block in buffer pool */
Static Bufhdr * Static Bufhdr *
_findblock(fcb, unixfd, blkno) _findblock(Fcb *fcb, int unixfd, Blkno blkno)
Fcb *fcb;
int unixfd;
Blkno blkno;
{ {
register Bufhdr *p; register Bufhdr *p;
struct dlink *lh, *e; struct dlink *lh, *e;
@ -449,8 +437,7 @@ _findblock(fcb, unixfd, blkno)
/* _commit1buffer() - Commit changes to buffer */ /* _commit1buffer() - Commit changes to buffer */
Static void Static void
_commit1buffer(p) _commit1buffer(register Bufhdr *p)
register Bufhdr *p;
{ {
assert(p->isb_flags & ISB_WFIXED); /* Fixed for read buffers should */ assert(p->isb_flags & ISB_WFIXED); /* Fixed for read buffers should */
/* go through _isdisk_unfix() */ /* go through _isdisk_unfix() */
@ -470,8 +457,7 @@ _commit1buffer(p)
/* _rollback1buffer() - Rollback changes to buffer */ /* _rollback1buffer() - Rollback changes to buffer */
Static void Static void
_rollback1buffer(p) _rollback1buffer(register Bufhdr *p)
register Bufhdr *p;
{ {
register Bufhdr *p2; register Bufhdr *p2;
@ -501,8 +487,7 @@ _rollback1buffer(p)
/* _makenodata() - make buffer available with no data in it*/ /* _makenodata() - make buffer available with no data in it*/
Static void Static void
_makenodata(p) _makenodata(register Bufhdr *p)
register Bufhdr *p;
{ {
assert(p->isb_flags & ISB_READ); assert(p->isb_flags & ISB_READ);
@ -513,8 +498,7 @@ _makenodata(p)
/* _flush1buffer() - flush buffer to disk */ /* _flush1buffer() - flush buffer to disk */
Static void Static void
_flush1buffer(p) _flush1buffer(register Bufhdr *p)
register Bufhdr *p;
{ {
assert(p->isb_flags & ISB_CHANGE); assert(p->isb_flags & ISB_CHANGE);

View file

@ -43,9 +43,8 @@
#include "isam_impl.h" #include "isam_impl.h"
/* _isdln_base_insert () - Insert element into list (at the front) -----------*/ /* _isdln_base_insert () - Insert element into list (at the front) -----------*/
void _isdln_base_insert (base,l,e) void _isdln_base_insert (register char *base, register struct dlink *l,
register char *base; register struct dlink *e)
register struct dlink *l,*e;
{ {
e->dln_forward = l->dln_forward; e->dln_forward = l->dln_forward;
l->dln_forward = (char *)e - base; l->dln_forward = (char *)e - base;
@ -55,9 +54,8 @@ void _isdln_base_insert (base,l,e)
} }
/* _isdln_base_append () - Append element to list (at the end) -------------*/ /* _isdln_base_append () - Append element to list (at the end) -------------*/
void _isdln_base_append (base,l,e) void _isdln_base_append (register char *base, register struct dlink *l,
register char *base; register struct dlink *e)
register struct dlink *l,*e;
{ {
e->dln_backward = l->dln_backward; e->dln_backward = l->dln_backward;
l->dln_backward = (char *)e - base; l->dln_backward = (char *)e - base;
@ -67,18 +65,14 @@ void _isdln_base_append (base,l,e)
} }
/* _isdln_base_remove () - Remove element from list -------------------------*/ /* _isdln_base_remove () - Remove element from list -------------------------*/
void _isdln_base_remove (base,e) void _isdln_base_remove (register char *base, register struct dlink *e)
register char *base;
register struct dlink *e;
{ {
((struct dlink *)(base + e->dln_backward))->dln_forward = e->dln_forward; ((struct dlink *)(base + e->dln_backward))->dln_forward = e->dln_forward;
((struct dlink *)(base + e->dln_forward))->dln_backward = e->dln_backward; ((struct dlink *)(base + e->dln_forward))->dln_backward = e->dln_backward;
} }
/* _isdln_base_first () - Return first element of the list -------------------*/ /* _isdln_base_first () - Return first element of the list -------------------*/
struct dlink * _isdln_base_first(base,l) struct dlink * _isdln_base_first(register char *base, register struct dlink *l)
register char *base;
register struct dlink *l;
{ {
struct dlink *val = (struct dlink *)(base + l->dln_forward); struct dlink *val = (struct dlink *)(base + l->dln_forward);
@ -92,33 +86,25 @@ struct dlink * _isdln_base_first(base,l)
} }
/* _isdln_base_next () - Return next element in the list --------------------*/ /* _isdln_base_next () - Return next element in the list --------------------*/
struct dlink * _isdln_base_next(base,l) struct dlink * _isdln_base_next(register char *base, register struct dlink *l)
register char *base;
register struct dlink *l;
{ {
return (((struct dlink *)(base + l->dln_forward))); return (((struct dlink *)(base + l->dln_forward)));
} }
/* _isdln_base_prev () - Return previous element in the list ----------------*/ /* _isdln_base_prev () - Return previous element in the list ----------------*/
struct dlink * _isdln_base_prev(base,l) struct dlink * _isdln_base_prev(register char *base, register struct dlink *l)
register char *base;
register struct dlink *l;
{ {
return (((struct dlink *)(base + l->dln_backward))); return (((struct dlink *)(base + l->dln_backward)));
} }
/* _isdln_base_makeempty () - Make head of empty list -----------------------*/ /* _isdln_base_makeempty () - Make head of empty list -----------------------*/
void _isdln_base_makeempty(base,l) void _isdln_base_makeempty(register char *base, register struct dlink *l)
register char *base;
register struct dlink *l;
{ {
l->dln_forward = l->dln_backward = (char *)l - base; l->dln_forward = l->dln_backward = (char *)l - base;
} }
/* _isdln_base_isempty () - Test if list is empty---------------------------*/ /* _isdln_base_isempty () - Test if list is empty---------------------------*/
int _isdln_base_isempty(base,l) int _isdln_base_isempty(register char *base, register struct dlink *l)
register char *base;
register struct dlink *l;
{ {
return (l->dln_forward == (char *)l - base && return (l->dln_forward == (char *)l - base &&
l->dln_backward == (char *)l - base); l->dln_backward == (char *)l - base);

View file

@ -65,8 +65,7 @@ static int _amerase();
*/ */
int int
iserase(isfname) iserase(char isfname)
char *isfname;
{ {
Isfd isfd, isfd_nfs; Isfd isfd, isfd_nfs;
Fab *fab, *fab_nfs; Fab *fab, *fab_nfs;
@ -113,9 +112,7 @@ iserase(isfname)
*/ */
static int static int
_amerase(isfhandle, errcode) _amerase(Bytearray *isfhandle, struct errcode *errcode)
Bytearray *isfhandle;
struct errcode *errcode;
{ {
Fcb *fcb; Fcb *fcb;
char *isfname = _getisfname(isfhandle); char *isfname = _getisfname(isfhandle);
@ -154,8 +151,7 @@ _amerase(isfhandle, errcode)
Static void Static void
_unlink_datfile(isfname) _unlink_datfile(char *isfname)
char *isfname;
{ {
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];
@ -167,8 +163,7 @@ _unlink_datfile(isfname)
Static void Static void
_unlink_indfile(isfname) _unlink_indfile(char *isfname)
char *isfname;
{ {
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];
@ -180,8 +175,7 @@ _unlink_indfile(isfname)
Static void Static void
_unlink_varfile(isfname) _unlink_varfile(char *isfname)
char *isfname;
{ {
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];

View file

@ -116,8 +116,7 @@ _isam_warning(char *msg)
} }
/* Set user specified fatal_error handler */ /* Set user specified fatal_error handler */
int (*_isfatal_error_set_func(func))() int (*_isfatal_error_set_func(int(*func)()))()
int (*func)();
{ {
int (*oldfunc)(); int (*oldfunc)();

View file

@ -50,15 +50,13 @@ static char sccsid[] = "@(#)isfab.c 1.8 89/07/17 Copyr 1988 Sun Micro";
* Fab_new() creates an File access block (fab object) that is used * Fab_new() creates an File access block (fab object) that is used
* for all subsequent operations in this file. Return a pointer to * for all subsequent operations in this file. Return a pointer to
* the fab object, or NULL in the case of an error. * the fab object, or NULL in the case of an error.
* isfname, Local path on the host
* varlen, 0/1 flag
*/ */
Fab * Fab *
_fab_new(isfname, openmode, _fab_new(char *isfname, enum openmode openmode, Bool varlen, int minreclen, int maxreclen)
varlen, minreclen, maxreclen)
char *isfname; /* Local path on the host */
enum openmode openmode;
Bool varlen; /* 0/1 flag */
int minreclen, maxreclen;
{ {
register Fab *fab; register Fab *fab;
@ -88,8 +86,7 @@ _fab_new(isfname, openmode,
} }
void void
_fab_destroy(fab) _fab_destroy(register Fab *fab)
register Fab *fab;
{ {
assert(fab != NULL); assert(fab != NULL);
assert(fab->isfname != NULL); assert(fab->isfname != NULL);

View file

@ -56,15 +56,15 @@ Static int _open_datfile(), _open_indfile(), _open_varfile();
* *
* Return 0 if create is successful, or -1 if any error. In the case of * Return 0 if create is successful, or -1 if any error. In the case of
*an error, the errcode block is set. *an error, the errcode block is set.
*
* crdat, 0/1 flag
* crind, 0/1 flag
* crvar, 0/1 flag
*/ */
Fcb * Fcb *
_isfcb_create(isfname, crdat, crind, crvar, owner, group, u_mask, errcode) _isfcb_create(char *isfname, int crdat, int crind, int crvar,
char *isfname; int owner, int group, int u_mask, struct errcode *errcode)
int crdat, crind, crvar; /* 0/1 flags */
int owner, group;
struct errcode *errcode;
int u_mask;
{ {
register Fcb *fcb; register Fcb *fcb;
int dat_fd = -1; int dat_fd = -1;
@ -156,10 +156,7 @@ _isfcb_create(isfname, crdat, crind, crvar, owner, group, u_mask, errcode)
*/ */
void void
_isfcb_setreclength(fcb, varflag, minreclen, maxreclen) _isfcb_setreclength(register Fcb *fcb, Bool varflag, int minreclen, int maxreclen)
register Fcb *fcb;
Bool varflag;
int minreclen, maxreclen;
{ {
fcb->varflag = varflag; fcb->varflag = varflag;
fcb->minreclen = minreclen; fcb->minreclen = minreclen;
@ -183,9 +180,7 @@ _isfcb_setreclength(fcb, varflag, minreclen, maxreclen)
*/ */
Fcb * Fcb *
_isfcb_open(isfname, errcode) _isfcb_open(char *isfname, struct errcode *errcode)
char *isfname;
struct errcode *errcode;
{ {
register Fcb *fcb; register Fcb *fcb;
int dat_fd = -1; int dat_fd = -1;
@ -242,8 +237,7 @@ _isfcb_open(isfname, errcode)
*/ */
int int
_isfcb_nfds(fcb) _isfcb_nfds(register Fcb *fcb)
register Fcb *fcb;
{ {
register int count = 0; register int count = 0;
@ -267,8 +261,7 @@ _isfcb_nfds(fcb)
*/ */
void void
_isfcb_remove(fcb) _isfcb_remove(register Fcb *fcb)
register Fcb *fcb;
{ {
if (fcb->datfd) if (fcb->datfd)
_remove_datfile(fcb->isfname); _remove_datfile(fcb->isfname);
@ -287,8 +280,7 @@ _isfcb_remove(fcb)
*/ */
void void
_isfcb_close(fcb) _isfcb_close(register Fcb *fcb)
register Fcb *fcb;
{ {
assert (fcb != NULL); assert (fcb != NULL);
assert (fcb->isfname != NULL); assert (fcb->isfname != NULL);
@ -312,8 +304,7 @@ _isfcb_close(fcb)
*/ */
int int
_isfcb_cntlpg_w(fcb) _isfcb_cntlpg_w(register Fcb *fcb)
register Fcb *fcb;
{ {
char cntl_page[ISCNTLSIZE]; char cntl_page[ISCNTLSIZE];
int dat_fd = fcb->datfd; int dat_fd = fcb->datfd;
@ -402,8 +393,7 @@ _isfcb_cntlpg_w(fcb)
*/ */
int int
_isfcb_cntlpg_w2(fcb) _isfcb_cntlpg_w2(register Fcb *fcb)
register Fcb *fcb;
{ {
char cntl_page[CP_VAREND_OFF+CP_VAREND_LEN]; char cntl_page[CP_VAREND_OFF+CP_VAREND_LEN];
int dat_fd = fcb->datfd; int dat_fd = fcb->datfd;
@ -462,8 +452,7 @@ _isfcb_cntlpg_w2(fcb)
*/ */
int int
_isfcb_cntlpg_r(fcb) _isfcb_cntlpg_r(register Fcb *fcb)
register Fcb *fcb;
{ {
char cntl_page[ISCNTLSIZE]; char cntl_page[ISCNTLSIZE];
int dat_fd = fcb->datfd; int dat_fd = fcb->datfd;
@ -563,8 +552,7 @@ _isfcb_cntlpg_r(fcb)
*/ */
int int
_isfcb_cntlpg_r2(fcb) _isfcb_cntlpg_r2(register Fcb *fcb)
register Fcb *fcb;
{ {
char cntl_page[CP_VAREND_OFF+CP_VAREND_LEN]; char cntl_page[CP_VAREND_OFF+CP_VAREND_LEN];
int dat_fd = fcb->datfd; int dat_fd = fcb->datfd;
@ -637,8 +625,7 @@ _isfcb_cntlpg_r2(fcb)
*/ */
Static int Static int
_create_datfile(isfname) _create_datfile(char *isfname)
char *isfname;
{ {
int fd; int fd;
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];
@ -664,8 +651,7 @@ _create_datfile(isfname)
*/ */
Static int Static int
_create_indfile(isfname) _create_indfile(char *isfname)
char *isfname;
{ {
int fd; int fd;
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];
@ -691,8 +677,7 @@ _create_indfile(isfname)
*/ */
Static int Static int
_create_varfile(isfname) _create_varfile(char *isfname)
char *isfname;
{ {
int fd; int fd;
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];
@ -719,8 +704,7 @@ _create_varfile(isfname)
*/ */
Static void Static void
_remove_datfile(isfname) _remove_datfile(char *isfname)
char *isfname;
{ {
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];
@ -737,8 +721,7 @@ _remove_datfile(isfname)
*/ */
Static void Static void
_remove_indfile(isfname) _remove_indfile(char *isfname)
char *isfname;
{ {
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];
@ -755,8 +738,7 @@ _remove_indfile(isfname)
*/ */
Static void Static void
_remove_varfile(isfname) _remove_varfile(char *isfname)
char *isfname;
{ {
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];
@ -774,9 +756,7 @@ _remove_varfile(isfname)
*/ */
Static int Static int
_open_datfile(isfname, rdonly) _open_datfile(char *isfname, Bool *rdonly)
char *isfname;
Bool *rdonly;
{ {
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];
int ret; int ret;
@ -813,9 +793,7 @@ _open_datfile(isfname, rdonly)
*/ */
Static int Static int
_open_indfile(isfname, rdonly) _open_indfile(char *isfname, Bool rdonly)
char *isfname;
Bool rdonly;
{ {
int fd; int fd;
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];
@ -841,9 +819,7 @@ _open_indfile(isfname, rdonly)
*/ */
Static int Static int
_open_varfile(isfname, rdonly) _open_varfile(char *isfname, Bool rdonly)
char *isfname;
Bool rdonly;
{ {
int fd; int fd;
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];
@ -863,8 +839,7 @@ _open_varfile(isfname, rdonly)
} }
int int
_check_isam_magic(fcb) _check_isam_magic(Fcb *fcb)
Fcb *fcb;
{ {
char magicbuffer[CP_MAGIC_LEN]; char magicbuffer[CP_MAGIC_LEN];
@ -888,8 +863,7 @@ _check_isam_magic(fcb)
*/ */
int int
_open2_indfile(fcb) _open2_indfile(Fcb *fcb)
Fcb *fcb;
{ {
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];
struct stat buf; struct stat buf;

View file

@ -52,9 +52,7 @@ Static int _keypart2cmp();
*/ */
int int
_isfcb_primkeyadd(fcb, keydesc2) _isfcb_primkeyadd(Fcb *fcb, Keydesc2 *keydesc2)
Fcb *fcb;
Keydesc2 *keydesc2;
{ {
/* /*
* Assign keyid. * Assign keyid.
@ -74,8 +72,7 @@ _isfcb_primkeyadd(fcb, keydesc2)
*/ */
int int
_isfcb_primkeydel(fcb) _isfcb_primkeydel(Fcb *fcb)
Fcb *fcb;
{ {
if (FCB_NOPRIMARY_KEY(fcb)) if (FCB_NOPRIMARY_KEY(fcb))
return (EBADARG); return (EBADARG);
@ -93,9 +90,7 @@ _isfcb_primkeydel(fcb)
*/ */
int int
_isfcb_altkeyadd(fcb, keydesc2) _isfcb_altkeyadd(Fcb *fcb, Keydesc2 *keydesc2)
Fcb *fcb;
Keydesc2 *keydesc2;
{ {
assert (fcb->nkeys < MAXNKEYS); assert (fcb->nkeys < MAXNKEYS);
@ -126,9 +121,7 @@ _isfcb_altkeyadd(fcb, keydesc2)
*/ */
Keydesc2 * Keydesc2 *
_isfcb_findkey(fcb, keydesc2) _isfcb_findkey(register Fcb *fcb, Keydesc2 *keydesc2)
register Fcb *fcb;
Keydesc2 *keydesc2;
{ {
int nkeys = fcb->nkeys; int nkeys = fcb->nkeys;
register Keydesc2 *kp2; register Keydesc2 *kp2;
@ -162,9 +155,7 @@ _isfcb_findkey(fcb, keydesc2)
*/ */
int int
_isfcb_altkeydel(fcb, keydesc2) _isfcb_altkeydel(register Fcb *fcb, Keydesc2 *keydesc2)
register Fcb *fcb;
Keydesc2 *keydesc2;
{ {
int nkeys = fcb->nkeys; int nkeys = fcb->nkeys;
register int i, j; register int i, j;
@ -209,8 +200,7 @@ _isfcb_altkeydel(fcb, keydesc2)
/* compare key parts */ /* compare key parts */
Static int Static int
_keypart2cmp(l,r) _keypart2cmp(register struct keypart2 *l, register struct keypart2 *r)
register struct keypart2 *l, *r;
{ {
return !(l->kp2_type == r->kp2_type && l->kp2_start == r->kp2_start && return !(l->kp2_type == r->kp2_type && l->kp2_start == r->kp2_start &&
l->kp2_leng == r->kp2_leng); l->kp2_leng == r->kp2_leng);
@ -224,9 +214,7 @@ _keypart2cmp(l,r)
*/ */
Keydesc2 * Keydesc2 *
_isfcb_indfindkey(fcb, keyid) _isfcb_indfindkey(register Fcb *fcb, int keyid)
register Fcb *fcb;
int keyid;
{ {
int nkeys = fcb->nkeys; int nkeys = fcb->nkeys;
register Keydesc2 *keys = fcb->keys; register Keydesc2 *keys = fcb->keys;

View file

@ -68,7 +68,7 @@ static int _in_use = 0; /* Current number of
*/ */
int int
_watchfd_incr(n) _watchfd_incr(int n)
{ {
_in_use += n; _in_use += n;
assert(_in_use <= _limit); assert(_in_use <= _limit);
@ -85,7 +85,7 @@ _watchfd_incr(n)
*/ */
int int
_watchfd_decr(n) _watchfd_decr(int n)
{ {
_in_use -= n; _in_use -= n;
assert(_in_use >= 0); assert(_in_use >= 0);
@ -100,7 +100,7 @@ _watchfd_decr(n)
*/ */
int int
_watchfd_check() _watchfd_check(void)
{ {
return (_limit - _in_use); return (_limit - _in_use);
} }
@ -113,8 +113,7 @@ _watchfd_check()
*/ */
int int
_watchfd_max_set(n) _watchfd_max_set(int n)
int n;
{ {
int oldlimit = _limit; int oldlimit = _limit;
@ -143,7 +142,7 @@ _watchfd_max_set(n)
*/ */
int int
_watchfd_max_get() _watchfd_max_get(void)
{ {
return (_limit); return (_limit);
} }

View file

@ -55,8 +55,7 @@ static Fab *isfdtab[MAXISFD]; /* Table of pointers */
*/ */
Isfd Isfd
_isfd_insert(fab) _isfd_insert(Fab *fab)
Fab *fab;
{ {
register Isfd i; register Isfd i;
@ -82,8 +81,7 @@ _isfd_insert(fab)
*/ */
Fab * Fab *
_isfd_find(isfd) _isfd_find(register Isfd isfd)
register Isfd isfd;
{ {
if (isfd < 0 || isfd >= MAXISFD || isfdtab[isfd] == NULL) if (isfd < 0 || isfd >= MAXISFD || isfdtab[isfd] == NULL)
return (NULL); return (NULL);
@ -98,8 +96,7 @@ _isfd_find(isfd)
*/ */
void void
_isfd_delete(isfd) _isfd_delete(register Isfd isfd)
register Isfd isfd;
{ {
if (isfd >= 0 && isfd < MAXISFD) if (isfd >= 0 && isfd < MAXISFD)
isfdtab[isfd] = NULL; isfdtab[isfd] = NULL;

View file

@ -54,12 +54,7 @@ static Blkno _getblkno();
*/ */
void void
_cp_tofile(fcb, unixfd, data, pos, len) _cp_tofile(Fcb *fcb, int unixfd, char *data, long pos, int len)
Fcb *fcb;
int unixfd;
char *data;
long pos;
int len;
{ {
int offset; /* Offset within a page */ int offset; /* Offset within a page */
Blkno blkno; Blkno blkno;
@ -93,12 +88,7 @@ _cp_tofile(fcb, unixfd, data, pos, len)
*/ */
void void
_cp_fromfile(fcb, unixfd, data, pos, len) _cp_fromfile(Fcb *fcb, int unixfd, char *data, long pos, int len)
Fcb *fcb;
int unixfd;
char *data;
long pos;
int len;
{ {
int offset; /* Offset within a page */ int offset; /* Offset within a page */
Blkno blkno; Blkno blkno;
@ -130,10 +120,7 @@ _cp_fromfile(fcb, unixfd, data, pos, len)
*/ */
Blkno Blkno
_extend_file(fcb, unixfd, oldsize) _extend_file(Fcb *fcb, int unixfd, Blkno oldsize)
Fcb *fcb;
int unixfd;
Blkno oldsize;
{ {
Bufhdr *bufhdr; Bufhdr *bufhdr;
char buf[ISPAGESIZE]; char buf[ISPAGESIZE];
@ -158,8 +145,7 @@ _extend_file(fcb, unixfd, oldsize)
*/ */
Static int Static int
_getoffset(pos) _getoffset(long pos)
long pos;
{ {
return ((int)(pos % ISPAGESIZE)); return ((int)(pos % ISPAGESIZE));
} }
@ -171,8 +157,7 @@ _getoffset(pos)
*/ */
Static Blkno Static Blkno
_getblkno(pos) _getblkno(long pos)
long pos;
{ {
return ((int)(pos / ISPAGESIZE)); return ((int)(pos / ISPAGESIZE));
} }

View file

@ -64,11 +64,7 @@ static void remove_from_chain(); /* used by _flrec_wrrec() */
/*ARGSUSED*/ /*ARGSUSED*/
int int
_flrec_write(fcb, record, recnum, reclen) _flrec_write(register Fcb *fcb, char *record, Recno *recnum, int reclen)
register Fcb *fcb;
char *record;
Recno *recnum;
int reclen;
{ {
Recno recnum2; Recno recnum2;
long rec_position; long rec_position;
@ -131,11 +127,7 @@ _flrec_write(fcb, record, recnum, reclen)
*/ */
int int
_flrec_read(fcb, record, recnum, reclen) _flrec_read(register Fcb *fcb, char *record, Recno recnum, int *reclen)
register Fcb *fcb;
char *record;
Recno recnum;
int *reclen;
{ {
long rec_position; long rec_position;
char delflag; char delflag;
@ -173,9 +165,7 @@ _flrec_read(fcb, record, recnum, reclen)
*/ */
long long
_fl_getpos(fcb, recnum) _fl_getpos(Fcb *fcb, Recno recnum)
Fcb *fcb;
Recno recnum;
{ {
return ((long)(ISCNTLSIZE + (fcb->minreclen + 1) * (recnum -1))); return ((long)(ISCNTLSIZE + (fcb->minreclen + 1) * (recnum -1)));
} }
@ -196,11 +186,7 @@ _fl_getpos(fcb, recnum)
/*ARGSUSED*/ /*ARGSUSED*/
int int
_flrec_rewrite(fcb, record, recnum, reclen) _flrec_rewrite(register Fcb *fcb, char *record, Recno recnum, int reclen)
register Fcb *fcb;
char *record;
Recno recnum;
int reclen;
{ {
long rec_position; long rec_position;
char delflag; char delflag;
@ -242,9 +228,7 @@ _flrec_rewrite(fcb, record, recnum, reclen)
*/ */
int int
_flrec_delete(fcb, recnum) _flrec_delete(register Fcb *fcb, Recno recnum)
register Fcb *fcb;
Recno recnum;
{ {
long rec_position; long rec_position;
char delflag; char delflag;
@ -301,11 +285,7 @@ _flrec_delete(fcb, recnum)
/*ARGSUSED*/ /*ARGSUSED*/
int int
_flrec_wrrec(fcb, record, recnum, reclen) _flrec_wrrec(register Fcb *fcb, char *record, Recno recnum, int reclen)
register Fcb *fcb;
char *record;
Recno recnum;
int reclen;
{ {
long rec_position; long rec_position;
char delflag; char delflag;
@ -392,9 +372,7 @@ _flrec_wrrec(fcb, record, recnum, reclen)
*/ */
static void static void
remove_from_chain(fcb, recnum) remove_from_chain(Fcb *fcb, Recno recnum)
Fcb *fcb;
Recno recnum;
{ {
char recnobuf1 [RECNOSIZE] , recnobuf2 [RECNOSIZE]; char recnobuf1 [RECNOSIZE] , recnobuf2 [RECNOSIZE];
long pos1, pos2; long pos1, pos2;

View file

@ -54,8 +54,7 @@ char *_lastelement();
*/ */
void void
_makedat_isfname(isfname) _makedat_isfname(char *isfname)
char *isfname;
{ {
/* Append .rec */ /* Append .rec */
(void) strcat(isfname, DAT_SUFFIX); (void) strcat(isfname, DAT_SUFFIX);
@ -69,8 +68,7 @@ _makedat_isfname(isfname)
*/ */
void void
_makeind_isfname(isfname) _makeind_isfname(char *isfname)
char *isfname;
{ {
/* Append .ind */ /* Append .ind */
(void) strcat(isfname, IND_SUFFIX); (void) strcat(isfname, IND_SUFFIX);
@ -84,8 +82,7 @@ _makeind_isfname(isfname)
*/ */
void void
_makevar_isfname(isfname) _makevar_isfname(char *isfname)
char *isfname;
{ {
/* Append .var */ /* Append .var */
(void) strcat(isfname, VAR_SUFFIX); (void) strcat(isfname, VAR_SUFFIX);
@ -99,8 +96,7 @@ _makevar_isfname(isfname)
*/ */
void void
_removelast(path) _removelast(char *path)
char *path;
{ {
register char *p; register char *p;
@ -116,8 +112,7 @@ _removelast(path)
*/ */
char * char *
_lastelement(path) _lastelement(char *path)
char *path;
{ {
register char *p; register char *p;

View file

@ -42,9 +42,7 @@ static char sccsid[] = "@(#)isindexconv.c 1.3 89/07/17 Copyr 1988 Sun Micro";
#include "isam_impl.h" #include "isam_impl.h"
void void
stkey(pkeydesc2, p) stkey(Keydesc2 *pkeydesc2, char *p)
Keydesc2 *pkeydesc2;
char *p;
{ {
int i; int i;
register struct keypart2 *ppart; register struct keypart2 *ppart;
@ -82,9 +80,7 @@ stkey(pkeydesc2, p)
} }
void void
ldkey(pkeydesc2,p) ldkey(register struct keydesc2 *pkeydesc2, register char *p)
register struct keydesc2 *pkeydesc2;
register char *p;
{ {
int i; int i;
register struct keypart2 *ppart; register struct keypart2 *ppart;

View file

@ -61,10 +61,7 @@ static char sccsid[] = "@(#)isindexinfo.c 1.2 91/05/16 Copyr 1988 Sun Micro";
#define dibuf ((struct dictinfo *)buffer) #define dibuf ((struct dictinfo *)buffer)
int int
isindexinfo(isfd, buffer, number) isindexinfo(int isfd, struct keydesc *buffer, int number)
int isfd;
struct keydesc *buffer;
int number;
{ {
register Fab *fab; register Fab *fab;
int ret; int ret;

View file

@ -51,8 +51,7 @@ extern Bufhdr *_isdisk_fix();
*/ */
Blkno Blkno
_isindfreel_alloc(fcb) _isindfreel_alloc(Fcb *fcb)
Fcb *fcb;
{ {
Bufhdr *pbhdr; Bufhdr *pbhdr;
char *p; char *p;
@ -97,9 +96,7 @@ _isindfreel_alloc(fcb)
*/ */
void void
_isindfreel_free(fcb, blkno) _isindfreel_free(Fcb *fcb, Blkno blkno)
Fcb *fcb;
Blkno blkno;
{ {
Bufhdr *pbhdr; Bufhdr *pbhdr;
char *p; char *p;

View file

@ -51,10 +51,7 @@ Blkno _isgetfreekpage();
*/ */
void void
_iskey_extract (pkeydesc2, recp, keyp) _iskey_extract (Keydesc2 *pkeydesc2, char *recp, char *keyp)
Keydesc2 * pkeydesc2;
char *recp;
char *keyp;
{ {
register int i; register int i;
register struct keypart2 *ppart; register struct keypart2 *ppart;
@ -86,14 +83,12 @@ _iskey_extract (pkeydesc2, recp, keyp)
* _allockpage() * _allockpage()
* *
* Allocate an initialize new key page. * Allocate an initialize new key page.
*
* blkno, Output parameter
*/ */
Bufhdr * Bufhdr *
_allockpage(fcb, capac, level, blkno) _allockpage(Fcb *fcb, int capac, int level, Blkno *blkno)
Fcb *fcb;
int capac;
int level;
Blkno *blkno; /* Output parameter */
{ {
Bufhdr *pbufhdr; Bufhdr *pbufhdr;
char *p; char *p;

View file

@ -44,8 +44,7 @@ static char sccsid[] = "@(#)iskeycalc.c 1.3 89/07/17 Copyr 1988 Sun Micro";
/* getkeysperleaf() - Calculate number of keys per leaf node */ /* getkeysperleaf() - Calculate number of keys per leaf node */
int int
getkeysperleaf (keylen) getkeysperleaf (int keylen)
int keylen;
{ {
int n; int n;
@ -56,8 +55,7 @@ getkeysperleaf (keylen)
/* getkeyspernode() - Calculate number of keys per non-leaf node */ /* getkeyspernode() - Calculate number of keys per non-leaf node */
int int
getkeyspernode (keylen) getkeyspernode (int keylen)
int keylen;
{ {
int n; int n;
@ -69,8 +67,7 @@ getkeyspernode (keylen)
/* le_odd(n) - Get next lower or equal odd number */ /* le_odd(n) - Get next lower or equal odd number */
int int
le_odd(n) le_odd(int n)
int n;
{ {
return ((n - 1) | 1); return ((n - 1) | 1);
} }

View file

@ -50,12 +50,11 @@ static int _ncurtab; /* Number of entries */
* _iskeycmp_set() * _iskeycmp_set()
* *
* Set key decriptor and number of parts for subsequent key comparison.s * Set key decriptor and number of parts for subsequent key comparison.s
* nparts, Use only so many parts
*/ */
void void
_iskeycmp_set (pkeydesc2, nparts) _iskeycmp_set (Keydesc2 *pkeydesc2, int nparts)
Keydesc2 *pkeydesc2;
int nparts; /* Use only so many parts */
{ {
_ncurtab = nparts; _ncurtab = nparts;
_curtab = pkeydesc2->k2_part; _curtab = pkeydesc2->k2_part;
@ -69,8 +68,7 @@ _iskeycmp_set (pkeydesc2, nparts)
*/ */
int int
_iskeycmp(lkey, rkey) _iskeycmp(char *lkey, char *rkey)
char *lkey, *rkey;
{ {
int i, ret; int i, ret;
register struct keypart2 *p; register struct keypart2 *p;

View file

@ -54,9 +54,7 @@ static int _check_typelen();
*/ */
int int
_validate_keydesc(keydesc, minreclen) _validate_keydesc(register struct keydesc *keydesc, int minreclen)
register struct keydesc *keydesc;
int minreclen;
{ {
int nparts; int nparts;
register int i; register int i;
@ -99,9 +97,7 @@ _validate_keydesc(keydesc, minreclen)
*/ */
static int static int
_check_typelen(type, length) _check_typelen(int type, int length)
int type;
int length;
{ {
switch (type) { switch (type) {
case INTTYPE: case INTTYPE:

View file

@ -75,9 +75,7 @@ static float *isminfloat = (float *)isminfloatarr;
*/ */
void void
_iskey_fillmax(pkeydesc2, keybuf) _iskey_fillmax(struct keydesc2 *pkeydesc2, register char *keybuf)
struct keydesc2 *pkeydesc2;
register char *keybuf;
{ {
register int i; register int i;
register struct keypart2 *ppart; register struct keypart2 *ppart;
@ -143,9 +141,7 @@ _iskey_fillmax(pkeydesc2, keybuf)
*/ */
void void
_iskey_fillmin(pkeydesc2, keybuf) _iskey_fillmin(struct keydesc2 *pkeydesc2, register char *keybuf)
struct keydesc2 *pkeydesc2;
register char *keybuf;
{ {
register int i; register int i;
register struct keypart2 *ppart; register struct keypart2 *ppart;

View file

@ -75,9 +75,7 @@ static mrused_last = 0; /* stamp generator */
*/ */
void void
_mngfcb_insert(fcb, isfhandle) _mngfcb_insert(Fcb *fcb, Bytearray *isfhandle)
Fcb *fcb;
Bytearray *isfhandle;
{ {
int hashval = _hashisfhandle(isfhandle); int hashval = _hashisfhandle(isfhandle);
register int ind; register int ind;
@ -114,8 +112,7 @@ _mngfcb_insert(fcb, isfhandle)
*/ */
Fcb * Fcb *
_mngfcb_find(isfhandle) _mngfcb_find(Bytearray *isfhandle)
Bytearray *isfhandle;
{ {
int hashval = _hashisfhandle(isfhandle); int hashval = _hashisfhandle(isfhandle);
register int ind; register int ind;
@ -150,8 +147,7 @@ _mngfcb_find(isfhandle)
*/ */
void void
_mngfcb_delete(isfhandle) _mngfcb_delete(Bytearray *isfhandle)
Bytearray *isfhandle;
{ {
int hashval = _hashisfhandle(isfhandle); int hashval = _hashisfhandle(isfhandle);
register int ind; register int ind;
@ -187,7 +183,7 @@ _mngfcb_delete(isfhandle)
*/ */
Bytearray * Bytearray *
_mngfcb_victim() _mngfcb_victim(void)
{ {
int victim_ind = -1; int victim_ind = -1;
long victim_time = 0; /* Assign to shut up lint */ long victim_time = 0; /* Assign to shut up lint */
@ -214,8 +210,7 @@ _mngfcb_victim()
*/ */
Static int Static int
_hashisfhandle(isfhandle) _hashisfhandle(Bytearray *isfhandle)
Bytearray *isfhandle;
{ {
register char *p; register char *p;
register unsigned h, g; register unsigned h, g;

View file

@ -72,9 +72,7 @@ static int _am_open();
*/ */
int int
isopen(isfname, mode) isopen(char *isfname, int mode)
char *isfname;
int mode;
{ {
Fab *fab; Fab *fab;
Isfd isfd; Isfd isfd;
@ -119,8 +117,7 @@ isopen(isfname, mode)
return ((int)isfd); /* Successful isopen() */ return ((int)isfd); /* Successful isopen() */
} }
Static int _am_open(fab) Static int _am_open(register Fab *fab)
register Fab *fab;
{ {
return (_amopen(fab->isfname, fab->openmode, &fab->varlength, return (_amopen(fab->isfname, fab->openmode, &fab->varlength,
&fab->minreclen, &fab->maxreclen, &fab->isfhandle, &fab->minreclen, &fab->maxreclen, &fab->isfhandle,

View file

@ -50,9 +50,7 @@ static char sccsid[] = "@(#)ispageio.c 1.3 89/07/17 Copyr 1988 Sun Micro";
*/ */
void void
_isseekpg(fd, pgno) _isseekpg(int fd, Blkno pgno)
int fd;
Blkno pgno;
{ {
long offset = pgno * ISPAGESIZE; long offset = pgno * ISPAGESIZE;
@ -67,9 +65,7 @@ _isseekpg(fd, pgno)
*/ */
void void
_isreadpg(fd, buf) _isreadpg(int fd, char *buf)
int fd;
char *buf;
{ {
if (read(fd, buf, ISPAGESIZE) != ISPAGESIZE) if (read(fd, buf, ISPAGESIZE) != ISPAGESIZE)
_isfatal_error("read failed"); _isfatal_error("read failed");
@ -82,9 +78,7 @@ _isreadpg(fd, buf)
*/ */
void void
_iswritepg(fd, buf) _iswritepg(int fd, char *buf)
int fd;
char *buf;
{ {
if (write(fd, buf, ISPAGESIZE) != ISPAGESIZE) if (write(fd, buf, ISPAGESIZE) != ISPAGESIZE)
_isfatal_error("write failed"); _isfatal_error("write failed");

View file

@ -49,8 +49,7 @@ static char sccsid[] = "@(#)isperm.c 1.3 89/07/17 Copyr 1988 Sun Micro";
*/ */
enum openmode enum openmode
_getopenmode(mode) _getopenmode(int mode)
int mode;
{ {
switch (mode & ISOPENMODE) { switch (mode & ISOPENMODE) {
case ISINPUT: case ISINPUT:
@ -71,8 +70,7 @@ _getopenmode(mode)
*/ */
enum readmode enum readmode
_getreadmode(mode) _getreadmode(int mode)
int mode;
{ {
switch (mode & ISREADMODE) { switch (mode & ISREADMODE) {
case ISFIRST: case ISFIRST:

View file

@ -71,10 +71,7 @@ static int _amread();
*/ */
int int
isread(isfd, record, mode) isread(int isfd, char *record, int mode)
int isfd;
char *record;
int mode;
{ {
register Fab *fab; register Fab *fab;
int reclen; int reclen;
@ -150,14 +147,9 @@ isread(isfd, record, mode)
*/ */
static int static int
_amread(isfhandle, record, reclen, readmode, curpos, recnum, errcode) _amread(Bytearray *isfhandle, char *record, int *reclen,
Bytearray *isfhandle; enum readmode readmode, Bytearray *curpos, Recno *recnum,
enum readmode readmode; struct errcode *errcode)
char *record;
int *reclen;
Bytearray *curpos;
Recno *recnum;
struct errcode *errcode;
{ {
Fcb *fcb = NULL; Fcb *fcb = NULL;
Recno recnum2; Recno recnum2;

View file

@ -68,8 +68,7 @@ static int _amrename();
*/ */
int int
isrename(oldname, newname) isrename(char *oldname, char *newname)
char *oldname, *newname;
{ {
Isfd isfd, isfd2; Isfd isfd, isfd2;
Fab *fab; Fab *fab;
@ -145,8 +144,7 @@ isrename(oldname, newname)
*/ */
Static void Static void
_removelast2(path) _removelast2(char *path)
char *path;
{ {
register char *p; register char *p;
@ -169,10 +167,7 @@ _removelast2(path)
static int static int
_amrename(isfhandle, newname, errcode) _amrename(Bytearray *isfhandle, char *newname, struct errcode *errcode)
Bytearray *isfhandle;
char *newname;
struct errcode *errcode;
{ {
Fcb *fcb; Fcb *fcb;
char *isfname = _getisfname(isfhandle); char *isfname = _getisfname(isfhandle);
@ -210,10 +205,9 @@ _amrename(isfhandle, newname, errcode)
} }
/* newname, with no prefix */
Static void Static void
_rename_datfile(isfname, newname) _rename_datfile(char *isfname, char *newname)
char *isfname;
char *newname; /* with no prefix */
{ {
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];
char newbuf[MAXPATHLEN]; char newbuf[MAXPATHLEN];
@ -239,10 +233,9 @@ _rename_datfile(isfname, newname)
(void)rename(namebuf, newbuf); (void)rename(namebuf, newbuf);
} }
/* newname, with no prefix */
Static void Static void
_rename_indfile(isfname, newname) _rename_indfile(char *isfname, char *newname)
char *isfname;
char *newname; /* with no prefix */
{ {
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];
char newbuf[MAXPATHLEN]; char newbuf[MAXPATHLEN];
@ -268,10 +261,9 @@ _rename_indfile(isfname, newname)
(void)rename(namebuf, newbuf); (void)rename(namebuf, newbuf);
} }
/* newname, with no prefix */
Static void Static void
_rename_varfile(isfname, newname) _rename_varfile(char *isfname, char *newname)
char *isfname;
char *newname; /* with no prefix */
{ {
char namebuf[MAXPATHLEN]; char namebuf[MAXPATHLEN];
char newbuf[MAXPATHLEN]; char newbuf[MAXPATHLEN];

View file

@ -69,9 +69,7 @@ Static int typeletter();
Static rp_readcntlpg(); Static rp_readcntlpg();
static int isnoprintf(const char *, ...); static int isnoprintf(const char *, ...);
isrepair(isfname, verbose) isrepair(char *isfname, int verbose)
char *isfname;
int verbose;
{ {
extern char *rp_readrecord_v(), *rp_readrecord_f(); extern char *rp_readrecord_v(), *rp_readrecord_f();
char cntlpg[ISCNTLSIZE]; char cntlpg[ISCNTLSIZE];
@ -345,9 +343,7 @@ static char recordbuffer[ISMAXRECLEN + LONGSIZE];
/* rp_readcntlpg() - Read the control page */ /* rp_readcntlpg() - Read the control page */
Static Static
rp_readcntlpg(datfd, cntlpg) rp_readcntlpg(int datfd, char *cntlpg)
int datfd;
char *cntlpg;
{ {
if (read (datfd, cntlpg, ISCNTLSIZE) != ISCNTLSIZE) if (read (datfd, cntlpg, ISCNTLSIZE) != ISCNTLSIZE)
return (ISERROR); return (ISERROR);
@ -357,10 +353,7 @@ rp_readcntlpg(datfd, cntlpg)
/* rp_readrecord_f() - Read a record from .rec file */ /* rp_readrecord_f() - Read a record from .rec file */
Static char * Static char *
rp_readrecord_f(datfd, offset, reclen) rp_readrecord_f(int datfd, long offset, int reclen)
int datfd;
long offset;
int reclen;
{ {
if (lseek(datfd, offset, 0) != offset) if (lseek(datfd, offset, 0) != offset)
return ((char *) NULL); return ((char *) NULL);
@ -376,10 +369,7 @@ rp_readrecord_f(datfd, offset, reclen)
/* rp_readrecord_v() - Read a record from .rec file */ /* rp_readrecord_v() - Read a record from .rec file */
Static char * Static char *
rp_readrecord_v(datfd, varfd, offset, minreclen, maxreclen) rp_readrecord_v(int datfd, int varfd, long offset, int minreclen, int maxreclen)
int datfd, varfd;
long offset;
int minreclen, maxreclen;
{ {
long tailoff; long tailoff;
char frameheadbuf [2 * SHORTSIZE]; char frameheadbuf [2 * SHORTSIZE];
@ -462,8 +452,7 @@ cmd_error(const char *str, int (*print)(const char *, ...))
} }
static int static int
typeletter(type) typeletter(int type)
int type;
{ {
switch (type) { switch (type) {
case INTTYPE: case INTTYPE:

View file

@ -71,9 +71,7 @@ static int _amrewcurr(), _changekeys2();
*/ */
int int
isrewcurr(isfd, record) isrewcurr(int isfd, char *record)
int isfd;
char *record;
{ {
register Fab *fab; register Fab *fab;
int reclen; int reclen;
@ -134,13 +132,8 @@ isrewcurr(isfd, record)
*/ */
static int static int
_amrewcurr(isfhandle, record, reclen, curpos, recnum, errcode) _amrewcurr(Bytearray *isfhandle, char *record, int reclen,
Bytearray *isfhandle; Bytearray *curpos, Recno *recnum, struct errcode *errcode)
char *record;
int reclen;
Recno *recnum;
Bytearray *curpos;
struct errcode *errcode;
{ {
Fcb *fcb; Fcb *fcb;
Crp *crp; Crp *crp;
@ -242,12 +235,8 @@ _amrewcurr(isfhandle, record, reclen, curpos, recnum, errcode)
} }
Static int Static int
_changekeys2(fcb, record, oldrecord, recnum, curpos) _changekeys2(Fcb *fcb, char *record, char *oldrecord,
Fcb *fcb; Recno recnum, Bytearray *curpos)
char *record;
char *oldrecord;
Recno recnum;
Bytearray *curpos;
{ {
int nkeys = fcb->nkeys; int nkeys = fcb->nkeys;
register int i; register int i;

View file

@ -70,10 +70,7 @@ static int _amrewrec(), _changekeys();
*/ */
int int
isrewrec(isfd, recnum, record) isrewrec(int isfd, long recnum, char *record)
int isfd;
long recnum;
char *record;
{ {
register Fab *fab; register Fab *fab;
int reclen; int reclen;
@ -131,12 +128,8 @@ isrewrec(isfd, recnum, record)
*/ */
static int static int
_amrewrec(isfhandle, record, reclen, recnum, errcode) _amrewrec(Bytearray *isfhandle, char *record, int reclen, Recno recnum,
Bytearray *isfhandle; struct errcode *errcode)
char *record;
int reclen;
Recno recnum;
struct errcode *errcode;
{ {
Fcb *fcb; Fcb *fcb;
char oldrecbuf[ISMAXRECLEN]; char oldrecbuf[ISMAXRECLEN];
@ -214,11 +207,7 @@ _amrewrec(isfhandle, record, reclen, recnum, errcode)
} }
static int static int
_changekeys (fcb, record, oldrecord, recnum) _changekeys (Fcb *fcb, char *record, char *oldrecord, Recno recnum)
Fcb *fcb;
char *record;
char *oldrecord;
Recno recnum;
{ {
int nkeys = fcb->nkeys; int nkeys = fcb->nkeys;
register int i; register int i;

View file

@ -65,9 +65,8 @@ static sigset_t oldmask;
static sigset_t allsignals; static sigset_t allsignals;
_issignals_cntl(opt) /* opt, 1 will enable masking, 0 will disable masking */
int opt; /* 1 will enable masking */ _issignals_cntl(int opt)
/* 0 will disable masking */
{ {
int oldmask = do_mask; int oldmask = do_mask;

View file

@ -52,10 +52,7 @@ extern char *_isunix_malloc();
*/ */
Issort * Issort *
_issort_create(reclen,nrecs,compfunc) _issort_create(int reclen, int nrecs, int (*compfunc)())
int reclen;
int nrecs;
int (*compfunc)();
{ {
Issort *p; Issort *p;
@ -82,8 +79,7 @@ _issort_create(reclen,nrecs,compfunc)
*/ */
void void
_issort_destroy(srt) _issort_destroy(Issort *srt)
Issort *srt;
{ {
assert(srt->ist_array != (char *) 0); assert(srt->ist_array != (char *) 0);
@ -98,9 +94,7 @@ _issort_destroy(srt)
*/ */
void void
_issort_insert(srt,record) _issort_insert(register Issort *srt, char *record)
register Issort *srt;
char *record;
{ {
assert(srt->ist_nrecs < srt->ist_allocrecs); assert(srt->ist_nrecs < srt->ist_allocrecs);
@ -117,8 +111,7 @@ _issort_insert(srt,record)
*/ */
void void
_issort_sort(srt) _issort_sort(Issort *srt)
Issort *srt;
{ {
if (srt->ist_nrecs > 1) if (srt->ist_nrecs > 1)
qsort(srt->ist_array,srt->ist_nrecs,srt->ist_reclength,srt->ist_compf); qsort(srt->ist_array,srt->ist_nrecs,srt->ist_reclength,srt->ist_compf);
@ -133,8 +126,7 @@ _issort_sort(srt)
*/ */
void void
_issort_rewind(srt) _issort_rewind(Issort *srt)
Issort *srt;
{ {
srt->ist_currec = 0; srt->ist_currec = 0;
} }
@ -146,8 +138,7 @@ _issort_rewind(srt)
*/ */
char * char *
_issort_read(srt) _issort_read(register Issort *srt)
register Issort *srt;
{ {
return((srt->ist_currec < srt->ist_nrecs) ? return((srt->ist_currec < srt->ist_nrecs) ?
(srt->ist_array + srt->ist_currec++ * srt->ist_reclength) : (srt->ist_array + srt->ist_currec++ * srt->ist_reclength) :

View file

@ -67,12 +67,8 @@ static int _amstart();
*/ */
int int
isstart(isfd, keydesc, length, record, mode) isstart(int isfd, struct keydesc *keydesc, int length, char *record,
int isfd; int mode)
struct keydesc *keydesc;
int length;
char *record;
int mode;
{ {
register Fab *fab; register Fab *fab;
int reclen; int reclen;
@ -160,17 +156,9 @@ isstart(isfd, keydesc, length, record, mode)
/* ARGSUSED */ /* ARGSUSED */
static int static int
_amstart(isfhandle, record, reclen, readmode, _amstart(Bytearray *isfhandle, char *record, int *reclen,
keydesc, keylen, curpos, recnum, errcode) enum readmode readmode, struct keydesc *keydesc, int keylen,
Bytearray *isfhandle; Bytearray *curpos, Recno *recnum, struct errcode *errcode)
enum readmode readmode;
char *record;
int *reclen;
Bytearray *curpos;
Recno *recnum;
struct errcode *errcode;
struct keydesc *keydesc;
int keylen;
{ {
Fcb *fcb; Fcb *fcb;
Recno recnum2; Recno recnum2;

View file

@ -53,7 +53,7 @@ static char sccsid[] = "@(#)issync.c 1.7 89/07/17 Copyr 1988 Sun Micro";
*/ */
int int
issync() issync(void)
{ {
return iscntl(ALLISFD, ISCNTL_FSYNC); return iscntl(ALLISFD, ISCNTL_FSYNC);
} }
@ -63,14 +63,13 @@ issync()
*/ */
int int
isfsync(isfd) isfsync(int isfd)
int isfd;
{ {
return iscntl(isfd, ISCNTL_FSYNC); return iscntl(isfd, ISCNTL_FSYNC);
} }
_issync() int _issync(void)
{ {
int i; int i;
@ -80,8 +79,7 @@ _issync()
return (ISOK); return (ISOK);
} }
_isfsync(isfd) int _isfsync(int isfd)
int isfd;
{ {
register Fab *fab; register Fab *fab;
Fcb *fcb; Fcb *fcb;

View file

@ -67,11 +67,7 @@ static _istail_read();
/*ARGSUSED*/ /*ARGSUSED*/
int int
_vlrec_write(fcb, record, recnum, reclen) _vlrec_write(register Fcb *fcb, char *record, Recno *recnum, int reclen)
register Fcb *fcb;
char *record;
Recno *recnum;
int reclen;
{ {
Recno recnum2; Recno recnum2;
long rec_position; long rec_position;
@ -141,11 +137,7 @@ _vlrec_write(fcb, record, recnum, reclen)
*/ */
int int
_vlrec_read(fcb, record, recnum, reclen) _vlrec_read(register Fcb *fcb, char *record, Recno recnum, int *reclen)
register Fcb *fcb;
char *record;
Recno recnum;
int *reclen;
{ {
long rec_position; long rec_position;
long tailoff; long tailoff;
@ -193,9 +185,7 @@ _vlrec_read(fcb, record, recnum, reclen)
*/ */
long long
_vl_getpos(fcb, recnum) _vl_getpos(Fcb *fcb, Recno recnum)
Fcb *fcb;
Recno recnum;
{ {
return ((long)(ISCNTLSIZE + (fcb->minreclen + LONGSIZE) * (recnum -1))); return ((long)(ISCNTLSIZE + (fcb->minreclen + LONGSIZE) * (recnum -1)));
} }
@ -216,11 +206,7 @@ _vl_getpos(fcb, recnum)
/*ARGSUSED*/ /*ARGSUSED*/
int int
_vlrec_rewrite(fcb, record, recnum, reclen) _vlrec_rewrite(register Fcb *fcb, char *record, Recno recnum, int reclen)
register Fcb *fcb;
char *record;
Recno recnum;
int reclen;
{ {
long rec_position; long rec_position;
long tailoff; long tailoff;
@ -272,9 +258,7 @@ _vlrec_rewrite(fcb, record, recnum, reclen)
*/ */
int int
_vlrec_delete(fcb, recnum) _vlrec_delete(register Fcb *fcb, Recno recnum)
register Fcb *fcb;
Recno recnum;
{ {
long rec_position; long rec_position;
long tailoff; long tailoff;
@ -338,11 +322,7 @@ _vlrec_delete(fcb, recnum)
/*ARGSUSED*/ /*ARGSUSED*/
int int
_vlrec_wrrec(fcb, record, recnum, reclen) _vlrec_wrrec(register Fcb *fcb, char *record, Recno recnum, int reclen)
register Fcb *fcb;
char *record;
Recno recnum;
int reclen;
{ {
long rec_position; long rec_position;
long tailoff; long tailoff;
@ -437,9 +417,7 @@ _vlrec_wrrec(fcb, record, recnum, reclen)
*/ */
static void static void
remove_from_chain2(fcb, recnum) remove_from_chain2(Fcb *fcb, Recno recnum)
Fcb *fcb;
Recno recnum;
{ {
char recnobuf1 [RECNOSIZE] , recnobuf2 [RECNOSIZE]; char recnobuf1 [RECNOSIZE] , recnobuf2 [RECNOSIZE];
long pos1, pos2; long pos1, pos2;
@ -474,10 +452,7 @@ remove_from_chain2(fcb, recnum)
/* Insert tail into .var file. Return offset in .var file */ /* Insert tail into .var file. Return offset in .var file */
long _istail_insert(fcb, tailp, taillen) long _istail_insert(Fcb *fcb, char *tailp, int taillen)
Fcb *fcb;
char *tailp;
int taillen;
{ {
char frameheadbuf [2 * SHORTSIZE]; char frameheadbuf [2 * SHORTSIZE];
int framelen; int framelen;
@ -518,9 +493,7 @@ long _istail_insert(fcb, tailp, taillen)
/* Remove tail from .var file */ /* Remove tail from .var file */
/* ARGSUSED */ /* ARGSUSED */
Static void _istail_delete(fcb, offset) Static void _istail_delete(Fcb *fcb, long offset)
Fcb *fcb;
long offset;
{ {
/* /*
* Don't do anything in NetISAM 1.0. The tails are lost, the space * Don't do anything in NetISAM 1.0. The tails are lost, the space
@ -531,10 +504,7 @@ Static void _istail_delete(fcb, offset)
/* Read tail from .var file */ /* Read tail from .var file */
Static _istail_read(fcb, offset, buffer) Static _istail_read(Fcb *fcb, long offset, char *buffer)
Fcb *fcb;
long offset;
char *buffer;
{ {
char frameheadbuf [2 * SHORTSIZE]; char frameheadbuf [2 * SHORTSIZE];
int taillen; int taillen;
@ -556,11 +526,7 @@ Static _istail_read(fcb, offset, buffer)
/* Rewrite tail. Returns -1 if the new tail is longer than the original frame */ /* Rewrite tail. Returns -1 if the new tail is longer than the original frame */
int _istail_modify(fcb, offset, tailp, taillen) int _istail_modify(Fcb *fcb, long offset, char *tailp, int taillen)
Fcb *fcb;
long offset;
int taillen;
char *tailp;
{ {
char frameheadbuf [2 * SHORTSIZE]; char frameheadbuf [2 * SHORTSIZE];
int framelen; int framelen;

View file

@ -71,9 +71,7 @@ static int _am_write();
*/ */
int int
iswrite(isfd, record) iswrite(int isfd, char *record)
int isfd;
char *record;
{ {
int _am_write(); int _am_write();
register Fab *fab; register Fab *fab;
@ -123,12 +121,8 @@ iswrite(isfd, record)
} }
Static int _am_write(fab, record, reclen, curpos, recnum) Static int _am_write(register Fab *fab, char *record, int reclen,
register Fab *fab; Bytearray *curpos, Recno *recnum)
char *record;
int reclen;
Bytearray *curpos;
Recno *recnum;
{ {
return (_amwrite(&fab->isfhandle, record, reclen, return (_amwrite(&fab->isfhandle, record, reclen,
curpos, recnum, &fab->errcode)); curpos, recnum, &fab->errcode));

View file

@ -70,10 +70,7 @@ static int _amwrrec();
*/ */
int int
iswrrec(isfd, recnum, record) iswrrec(int isfd, long recnum, char *record)
int isfd;
long recnum;
char *record;
{ {
register Fab *fab; register Fab *fab;
int reclen; int reclen;
@ -131,12 +128,8 @@ iswrrec(isfd, recnum, record)
*/ */
static int static int
_amwrrec(isfhandle, record, reclen, recnum, errcode) _amwrrec(Bytearray *isfhandle, char *record, int reclen, Recno recnum,
Bytearray *isfhandle; struct errcode *errcode)
char *record;
int reclen;
Recno recnum;
struct errcode *errcode;
{ {
Fcb *fcb = NULL; Fcb *fcb = NULL;
int err; int err;