From: Peter Howkins Date: Fri, 29 Jun 2018 17:43:11 +0000 (+0100) Subject: libDtSearch: Convert to ANSI function definitions and use proper prototypes (which... X-Git-Tag: 2.3.0a~280 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=32eb933929e3506aa0f25e7482fa81271fca308c;p=oweals%2Fcde.git libDtSearch: Convert to ANSI function definitions and use proper prototypes (which causes more warnings --- diff --git a/cde/lib/DtSearch/raima/alloc.c b/cde/lib/DtSearch/raima/alloc.c index fb683521..c48b8aa2 100644 --- a/cde/lib/DtSearch/raima/alloc.c +++ b/cde/lib/DtSearch/raima/alloc.c @@ -90,8 +90,7 @@ /* Allocate and clear i*s bytes of memory */ -char * d_calloc(i, s) -unsigned i, s; +char * d_calloc(unsigned i, unsigned s) { return (I_CALLOC(cp, i, s)); } @@ -99,16 +98,14 @@ unsigned i, s; /* Allocate b bytes of memory */ -char * d_alloc(b) -unsigned b; +char * d_alloc(unsigned b) { return (I_MALLOC(cp, b)); } /* Free memory */ -void d_free(p) -CHAR_P *p; +void d_free(CHAR_P *p) { if ((p != NULL) && (p->ptr != NULL)) { I_FREE(p); @@ -121,8 +118,7 @@ static int NewInit(P1(LL_P *)); /* Resets pointer to current element and checks for an empty list */ -BOOLEAN ll_access(ll) -llist *ll; +BOOLEAN ll_access(llist *ll) { ll->curr = NULL; return( ll->head.ptr != NULL && ll->tail.ptr != NULL ); @@ -130,9 +126,7 @@ llist *ll; /* Appends item to list */ -int ll_append(ll, data) -llist *ll; -CHAR_P *data; +int ll_append(llist *ll, CHAR_P *data) { LL_P item; LL_P hold; @@ -164,8 +158,7 @@ CHAR_P *data; /* Finds the first element of a list and returns its data */ -CHAR_P *ll_first(ll) -llist *ll; +CHAR_P *ll_first(llist *ll) { if ( ll->head.ptr == NULL ) { return( NULL ); @@ -178,8 +171,7 @@ llist *ll; /* Frees a list */ -void ll_free(ll) -llist *ll; +void ll_free(llist *ll) { LL_P *curr, next, free; @@ -200,8 +192,7 @@ llist *ll; /* Finds the next element and returns its data */ -CHAR_P *ll_next(ll) -llist *ll; +CHAR_P *ll_next(llist *ll) { LL_P *next; @@ -220,9 +211,7 @@ llist *ll; /* Prepends (stacks) item */ -int ll_prepend(ll, data) -llist *ll; -CHAR_P *data; +int ll_prepend(llist *ll, CHAR_P *data) { LL_P item; @@ -250,8 +239,7 @@ CHAR_P *data; /* Allocates and initializes a new list element */ -static int NewInit(new) -LL_P *new; +static int NewInit(LL_P *new) { new->ptr = (ll_elem *)ALLOC(new, sizeof(ll_elem), "new"); if ( new->ptr == NULL ) diff --git a/cde/lib/DtSearch/raima/cmtype.c b/cde/lib/DtSearch/raima/cmtype.c index 428859dc..fa945a27 100644 --- a/cde/lib/DtSearch/raima/cmtype.c +++ b/cde/lib/DtSearch/raima/cmtype.c @@ -52,10 +52,7 @@ /* Get current member type */ int -d_cmtype(set, cmtype , dbn) -int set; -int *cmtype; -int dbn; +d_cmtype(int set, int *cmtype, int dbn) { char *mrec; INT crt; diff --git a/cde/lib/DtSearch/raima/connect.c b/cde/lib/DtSearch/raima/connect.c index d82c27cc..4bd9e739 100644 --- a/cde/lib/DtSearch/raima/connect.c +++ b/cde/lib/DtSearch/raima/connect.c @@ -71,9 +71,10 @@ typedef struct { /* Connect the current record as member of set */ int -d_connect(set , dbn) -int set; /* Set constant */ -int dbn; /* Database number */ +d_connect( +int set, /* Set constant */ +int dbn /* Database number */ +) { MEM_PTR crmp; /* current record's member pointer */ SET_PTR cosp; /* current owner's set pointer */ @@ -285,10 +286,11 @@ quit: /* Compare two sort fields */ -static int sortcmp(set_ptr, mem1, mem2) -SET_ENTRY *set_ptr; /* set table entry */ -char *mem1; /* member record 1 */ -char *mem2; /* member record 2 */ +static int sortcmp( +SET_ENTRY *set_ptr, /* set table entry */ +char *mem1, /* member record 1 */ +char *mem2 /* member record 2 */ +) { INT rn1, rn2; /* record numbers for mem1 & mem2 */ MEMBER_ENTRY *mt1, *mt2; diff --git a/cde/lib/DtSearch/raima/cotype.c b/cde/lib/DtSearch/raima/cotype.c index ad46a9c2..51db8646 100644 --- a/cde/lib/DtSearch/raima/cotype.c +++ b/cde/lib/DtSearch/raima/cotype.c @@ -51,10 +51,7 @@ /* Get current owner type */ int -d_cotype(set, cotype , dbn) -int set; -int *cotype; -int dbn; +d_cotype(int set, int *cotype, int dbn) { char *orec; INT crt; diff --git a/cde/lib/DtSearch/raima/crget.c b/cde/lib/DtSearch/raima/crget.c index efe0c572..cac33561 100644 --- a/cde/lib/DtSearch/raima/crget.c +++ b/cde/lib/DtSearch/raima/crget.c @@ -50,9 +50,10 @@ /* Get current record */ int -d_crget(dba , dbn) -DB_ADDR *dba; /* db address of record to become current */ -int dbn; +d_crget( +DB_ADDR *dba, /* db address of record to become current */ +int dbn +) { DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_NOIO)); diff --git a/cde/lib/DtSearch/raima/crread.c b/cde/lib/DtSearch/raima/crread.c index b025a9d0..59fcd9e7 100644 --- a/cde/lib/DtSearch/raima/crread.c +++ b/cde/lib/DtSearch/raima/crread.c @@ -51,10 +51,11 @@ /* Read data from field of current record */ int -d_crread(field, data , dbn) -long field; /* Field constant */ -char *data; /* Data area to contain field contents */ -int dbn; /* database number */ +d_crread( +long field, /* Field constant */ +char *data, /* Data area to contain field contents */ +int dbn /* database number */ +) { int fld, rec; RECORD_ENTRY *rec_ptr; diff --git a/cde/lib/DtSearch/raima/crset.c b/cde/lib/DtSearch/raima/crset.c index 8f57860e..a27af515 100644 --- a/cde/lib/DtSearch/raima/crset.c +++ b/cde/lib/DtSearch/raima/crset.c @@ -50,9 +50,10 @@ /* Set current record */ int -d_crset(dba , dbn) -DB_ADDR *dba; /* db address of record to become current */ -int dbn; +d_crset( +DB_ADDR *dba, /* db address of record to become current */ +int dbn +) { DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO)); diff --git a/cde/lib/DtSearch/raima/crtype.c b/cde/lib/DtSearch/raima/crtype.c index aea8d8d9..97969c41 100644 --- a/cde/lib/DtSearch/raima/crtype.c +++ b/cde/lib/DtSearch/raima/crtype.c @@ -50,9 +50,10 @@ /* Get current record type */ int -d_crtype(crtype , dbn) -int *crtype; -int dbn; +d_crtype( +int *crtype, +int dbn +) { INT crt; diff --git a/cde/lib/DtSearch/raima/crwrite.c b/cde/lib/DtSearch/raima/crwrite.c index f10692ce..516b4e3a 100644 --- a/cde/lib/DtSearch/raima/crwrite.c +++ b/cde/lib/DtSearch/raima/crwrite.c @@ -51,10 +51,11 @@ /* Write data to a field in the current record */ int -d_crwrite(field, data , dbn) -long field; /* field constant */ -char *data; /* data area to contain field contents */ -int dbn; /* database number */ +d_crwrite( +long field, /* field constant */ +char *data, /* data area to contain field contents */ +int dbn /* database number */ +) { int stat, fld, rec; RECORD_ENTRY *rec_ptr; diff --git a/cde/lib/DtSearch/raima/csmget.c b/cde/lib/DtSearch/raima/csmget.c index 96c7be1f..b10b127c 100644 --- a/cde/lib/DtSearch/raima/csmget.c +++ b/cde/lib/DtSearch/raima/csmget.c @@ -50,10 +50,11 @@ /* Get current set member */ int -d_csmget(set, dba , dbn) -int set; /* Set table entry */ -DB_ADDR *dba; /* db address of record to become current */ -int dbn; /* database number */ +d_csmget( +int set, /* Set table entry */ +DB_ADDR *dba, /* db address of record to become current */ +int dbn /* database number */ +) { SET_ENTRY *set_ptr; diff --git a/cde/lib/DtSearch/raima/csmread.c b/cde/lib/DtSearch/raima/csmread.c index bac4755d..c516225b 100644 --- a/cde/lib/DtSearch/raima/csmread.c +++ b/cde/lib/DtSearch/raima/csmread.c @@ -51,11 +51,12 @@ /* Read data from field of current set member */ int -d_csmread(set, field, data , dbn) -int set; /* Set constant */ -long field; /* Field constant */ -char *data; /* Data area to contain field contents */ -int dbn; /* database number */ +d_csmread( +int set, /* Set constant */ +long field, /* Field constant */ +char *data, /* Data area to contain field contents */ +int dbn /* database number */ +) { int fld, rec; char *recp; diff --git a/cde/lib/DtSearch/raima/csmset.c b/cde/lib/DtSearch/raima/csmset.c index aba40bd1..6155802f 100644 --- a/cde/lib/DtSearch/raima/csmset.c +++ b/cde/lib/DtSearch/raima/csmset.c @@ -50,10 +50,11 @@ /* Set current set member */ int -d_csmset(set, dba , dbn) -int set; /* Set table entry */ -DB_ADDR *dba; /* db address of record to become current */ -int dbn; /* database number */ +d_csmset( +int set, /* Set table entry */ +DB_ADDR *dba, /* db address of record to become current */ +int dbn /* database number */ +) { INT type; char *ptr; diff --git a/cde/lib/DtSearch/raima/csmwrite.c b/cde/lib/DtSearch/raima/csmwrite.c index bfae2d86..1f4656fb 100644 --- a/cde/lib/DtSearch/raima/csmwrite.c +++ b/cde/lib/DtSearch/raima/csmwrite.c @@ -51,11 +51,12 @@ /* Write data to a field in the current set member */ int -d_csmwrite(set, field, data , dbn) -int set; /* Set constant */ -long field; /* Field constant */ -const char *data; /* Data area to contain field contents */ -int dbn; /* database number */ +d_csmwrite( +int set, /* Set constant */ +long field, /* Field constant */ +const char *data, /* Data area to contain field contents */ +int dbn /* database number */ +) { int stat, fld, rec; char *recp; diff --git a/cde/lib/DtSearch/raima/csoget.c b/cde/lib/DtSearch/raima/csoget.c index b3650a8d..84468419 100644 --- a/cde/lib/DtSearch/raima/csoget.c +++ b/cde/lib/DtSearch/raima/csoget.c @@ -51,10 +51,11 @@ /* Get current set owner */ int -d_csoget(set, dba , dbn) -int set; /* Set table entry */ -DB_ADDR *dba; /* db address of record to become current */ -int dbn; /* database number */ +d_csoget( +int set, /* Set table entry */ +DB_ADDR *dba, /* db address of record to become current */ +int dbn /* database number */ +) { SET_ENTRY *set_ptr; diff --git a/cde/lib/DtSearch/raima/csoread.c b/cde/lib/DtSearch/raima/csoread.c index 19424bc5..533388e8 100644 --- a/cde/lib/DtSearch/raima/csoread.c +++ b/cde/lib/DtSearch/raima/csoread.c @@ -51,11 +51,12 @@ /* Read data from field of current set owner */ int -d_csoread(set, field, data , dbn) -int set; /* Set constant */ -long field; /* Field constant */ -char *data; /* Data area to contain field contents */ -int dbn; /* database number */ +d_csoread( +int set, /* Set constant */ +long field, /* Field constant */ +char *data, /* Data area to contain field contents */ +int dbn /* database number */ +) { int fld, rec; char *recp; diff --git a/cde/lib/DtSearch/raima/csoset.c b/cde/lib/DtSearch/raima/csoset.c index 9b62985f..f8eb9136 100644 --- a/cde/lib/DtSearch/raima/csoset.c +++ b/cde/lib/DtSearch/raima/csoset.c @@ -51,10 +51,11 @@ /* Set current set owner */ int -d_csoset(set, dba , dbn) -int set; /* Set table entry */ -DB_ADDR *dba; /* db address of record to become current */ -int dbn; /* database number */ +d_csoset( +int set, /* Set table entry */ +DB_ADDR *dba, /* db address of record to become current */ +int dbn /* database number */ +) { INT type; char *ptr; diff --git a/cde/lib/DtSearch/raima/csowrite.c b/cde/lib/DtSearch/raima/csowrite.c index 73fcd2bb..f469b652 100644 --- a/cde/lib/DtSearch/raima/csowrite.c +++ b/cde/lib/DtSearch/raima/csowrite.c @@ -51,11 +51,12 @@ /* Write data to a field in the current set owner */ int -d_csowrite(set, field, data , dbn) -int set; /* Set constant */ -long field; /* Field constant */ -const char *data; /* Data area to contain field contents */ -int dbn; /* database number */ +d_csowrite( +int set, /* Set constant */ +long field, /* Field constant */ +const char *data, /* Data area to contain field contents */ +int dbn /* database number */ +) { int stat, fld, rec; char *recp; diff --git a/cde/lib/DtSearch/raima/dbacode.c b/cde/lib/DtSearch/raima/dbacode.c index 09d821e3..c6ad3144 100644 --- a/cde/lib/DtSearch/raima/dbacode.c +++ b/cde/lib/DtSearch/raima/dbacode.c @@ -44,10 +44,11 @@ /* Decode file and slot number from a database address */ int -d_decode_dba(dba, file, slot) -DB_ADDR dba; /* database address */ -int *file; /* returned file number */ -long *slot; /* returned slot number */ +d_decode_dba( +DB_ADDR dba, /* database address */ +int *file, /* returned file number */ +long *slot /* returned slot number */ +) { *file = (int)(FILEMASK & (dba >> FILESHIFT)); *slot = ADDRMASK & dba; @@ -59,10 +60,11 @@ long *slot; /* returned slot number */ /* Encode database address from file and slot number */ int -d_encode_dba(file, slot, dba) -int file; /* returned file number */ -long slot; /* returned slot number */ -DB_ADDR *dba; /* database address */ +d_encode_dba( +int file, /* returned file number */ +long slot, /* returned slot number */ +DB_ADDR *dba /* database address */ +) { *dba = ((FILEMASK & file) << FILESHIFT) | slot; return ( db_status = S_OKAY ); diff --git a/cde/lib/DtSearch/raima/dbdpath.c b/cde/lib/DtSearch/raima/dbdpath.c index 23ca1b57..a569e4b2 100644 --- a/cde/lib/DtSearch/raima/dbdpath.c +++ b/cde/lib/DtSearch/raima/dbdpath.c @@ -50,8 +50,7 @@ /* Set Database Dictionary Path */ int -d_dbdpath(path) -const char *path; +d_dbdpath(const char *path) { DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(LOCK_NONE)); diff --git a/cde/lib/DtSearch/raima/dbfpath.c b/cde/lib/DtSearch/raima/dbfpath.c index f66eccb1..4871a36d 100644 --- a/cde/lib/DtSearch/raima/dbfpath.c +++ b/cde/lib/DtSearch/raima/dbfpath.c @@ -50,8 +50,7 @@ /* Set Database Files Path */ int -d_dbfpath(path) -const char *path; +d_dbfpath(const char *path) { DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(LOCK_NONE)); diff --git a/cde/lib/DtSearch/raima/dblfcns.c b/cde/lib/DtSearch/raima/dblfcns.c index 8394fbf2..3753c980 100644 --- a/cde/lib/DtSearch/raima/dblfcns.c +++ b/cde/lib/DtSearch/raima/dblfcns.c @@ -191,27 +191,19 @@ int db_txtest = 0; /* transaction commit failure testing flag */ /* Internal function prototypes */ -static int bld_lock_tables(P0); -static int initses(P0); -static int lock_files(P1(int) Pi(LOCK_REQUEST *)); -static int send_lock(P0); -static int send_free(P0); -static void reset_locks(P0); -static int recovery_check(P0); - - - - - - +static int bld_lock_tables(void); +static int initses(void); +static int lock_files(int, LOCK_REQUEST *); +static int send_lock(void); +static int send_free(void); +static void reset_locks(void); +static int recovery_check(void); /* Open db_VISTA database */ int -d_open(dbnames, opentype) -const char *dbnames; -const char *opentype; +d_open(const char *dbnames, const char *opentype) { DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(LOCK_ALL)); #ifdef DEBUG_DBLF @@ -274,8 +266,7 @@ const char *opentype; /* Initialize a task structure */ -int taskinit(tsk) -TASK *tsk; +int taskinit(TASK *tsk) { byteset(tsk, '\0', sizeof(TASK)); tsk->No_of_dbs = 1; @@ -287,8 +278,7 @@ TASK *tsk; /* Initialize multiple database table entries */ int -initdbt(dbnames ) -const char *dbnames; +initdbt(const char *dbnames) { int dbt_lc; /* loop control */ char dbfile [DtSrFILENMLEN]; @@ -375,7 +365,7 @@ const char *dbnames; /* Close database */ int -d_close() +d_close(void) { int i; @@ -427,7 +417,7 @@ d_close() /* Free all allocated memory upon termination */ -void termfree() +void termfree(void) { /* free all allocated memory */ @@ -477,51 +467,12 @@ void termfree() } } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int alloc_table(Table, new_size, old_size ) -CHAR_P *Table; +int alloc_table( +CHAR_P *Table, #define table Table->ptr -unsigned new_size; -unsigned old_size; +unsigned new_size, +unsigned old_size +) { CHAR_P Temp_table; diff --git a/cde/lib/DtSearch/raima/dblog.c b/cde/lib/DtSearch/raima/dblog.c index 764e86d4..86c5aff3 100644 --- a/cde/lib/DtSearch/raima/dblog.c +++ b/cde/lib/DtSearch/raima/dblog.c @@ -49,8 +49,7 @@ /* Set database log file name/path */ -d_dblog(log) -const char *log; +d_dblog(const char *log) { DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(LOCK_NONE)); diff --git a/cde/lib/DtSearch/raima/dbtaf.c b/cde/lib/DtSearch/raima/dbtaf.c index f75e5fed..edfe11a2 100644 --- a/cde/lib/DtSearch/raima/dbtaf.c +++ b/cde/lib/DtSearch/raima/dbtaf.c @@ -52,8 +52,7 @@ static char VISTATAF[] = "vista.taf"; /* Set database transaction activity file name/path */ -d_dbtaf(taf) -const char *taf; +d_dbtaf(const char *taf) { char dbtaf[FILENMLEN]; int len; diff --git a/cde/lib/DtSearch/raima/dbuserid.c b/cde/lib/DtSearch/raima/dbuserid.c index e76123a8..028bf058 100644 --- a/cde/lib/DtSearch/raima/dbuserid.c +++ b/cde/lib/DtSearch/raima/dbuserid.c @@ -52,8 +52,7 @@ /* Set Database User Identifier */ int -d_dbuserid(id) -const char *id; +d_dbuserid(const char *id) { const char *chk_id; diff --git a/cde/lib/DtSearch/raima/delete.c b/cde/lib/DtSearch/raima/delete.c index 50d61a6a..f70f5b9a 100644 --- a/cde/lib/DtSearch/raima/delete.c +++ b/cde/lib/DtSearch/raima/delete.c @@ -53,8 +53,7 @@ static DB_ADDR zap_dba = NULL_DBA; /* Delete the current record, with error checking */ int -d_delete(dbn) -int dbn; +d_delete(int dbn) { int st_lc, mt_lc; /* loop control */ INT i, rt; diff --git a/cde/lib/DtSearch/raima/destroy.c b/cde/lib/DtSearch/raima/destroy.c index c068a29b..017cd68c 100644 --- a/cde/lib/DtSearch/raima/destroy.c +++ b/cde/lib/DtSearch/raima/destroy.c @@ -55,8 +55,7 @@ of the database */ int -d_destroy(dbname) -const char *dbname; +d_destroy(const char *dbname) { int ft_lc; /* loop control */ FILE_ENTRY *file_ptr; diff --git a/cde/lib/DtSearch/raima/dio.c b/cde/lib/DtSearch/raima/dio.c index 3a3617d3..0f730c6e 100644 --- a/cde/lib/DtSearch/raima/dio.c +++ b/cde/lib/DtSearch/raima/dio.c @@ -164,12 +164,11 @@ static int dbpg_lru_slot; /* least recently accessed db page */ static int no_modheld; /* number of modified or held db pages */ static FILE_NO working_file; /* current key file being processed */ -static void cache_init(P1(int) Pi(LOOKUP_ENTRY *) - Pi(PAGE_ENTRY *) Pi(int)); -static int dio_pzinit(P0); -static int clear_cache(P1(FILE_NO) Pi(FILE_NO)); -static int dio_pzflush(P0); -static int dio_in(P1(PAGE_ENTRY *) Pi(LOOKUP_ENTRY *)); +static void cache_init(int, LOOKUP_ENTRY *, PAGE_ENTRY *, int); +static int dio_pzinit(void); +static int clear_cache(FILE_NO, FILE_NO); +static int dio_pzflush(void); +static int dio_in(PAGE_ENTRY *, LOOKUP_ENTRY *); #define used_files Used_files.ptr #define db_lookup Db_lookup.ptr @@ -180,8 +179,7 @@ static int dio_in(P1(PAGE_ENTRY *) Pi(LOOKUP_ENTRY *)); /* Set the maximum number of open db_VISTA files */ int -d_setfiles(num) -int num; +d_setfiles(int num) { if ( dbpg_table ) return( dberr(S_DBCLOSE) ); @@ -195,9 +193,10 @@ int num; /* Set number of virtual memory pages */ int -d_setpages(dbpgs, ixpgs) -int dbpgs; /* # of db cache pages */ -int ixpgs; /* # of index cache pages - ignored in single-user version */ +d_setpages( +int dbpgs, /* # of db cache pages */ +int ixpgs /* # of index cache pages - ignored in single-user version */ +) { if ( dbpg_table ) return( dberr(S_SETPAGES) ); @@ -215,8 +214,7 @@ int ixpgs; /* # of index cache pages - ignored in single-user version */ /* Open a database file */ int -dio_open( fno ) -FILE_NO fno; +dio_open(FILE_NO fno) { FILE_ENTRY *file_ptr, *lru_file_ptr; int *uf_ptr; @@ -263,8 +261,7 @@ FILE_NO fno; /* Close a database file */ int -dio_close( fno ) -FILE_NO fno; +dio_close(FILE_NO fno) { FILE_ENTRY *file_ptr; @@ -286,7 +283,7 @@ FILE_NO fno; /* Initialize database I/O */ int -dio_init() +dio_init(void) { CHAR_P Tempbuff; #define tempbuff Tempbuff.ptr @@ -366,11 +363,8 @@ dio_init() } /* dio_init() */ -static void cache_init (pg_cnt, lu_ptr, pg_ptr, pgsize) -int pg_cnt; -LOOKUP_ENTRY * lu_ptr; -PAGE_ENTRY * pg_ptr; -int pgsize; +static void +cache_init (int pg_cnt, LOOKUP_ENTRY *lu_ptr, PAGE_ENTRY * pg_ptr, int pgsize) { int pg_no; @@ -417,7 +411,7 @@ int pgsize; /****************************************/ /* Free the memory allocated for pages */ -void dio_free() +void dio_free(void) { int pgt_lc; /* loop control */ PAGE_ENTRY *pg_ptr; @@ -445,8 +439,7 @@ void dio_free() /* Clear pages for a single file. */ int -dio_clrfile(fno ) -FILE_NO fno; +dio_clrfile(FILE_NO fno) { return( clear_cache(fno, fno+1) ); } @@ -461,7 +454,7 @@ FILE_NO fno; /* Clear all pages for *all* files from I/O buffer */ int -dio_clear() +dio_clear(void) { return( clear_cache(0, size_ft) ); } @@ -476,9 +469,10 @@ dio_clear() * Clears all pages for a range of specified files. * Subroutine of dio_clrfile and dio_clear. */ -static int clear_cache(fr_file, to_file ) -FILE_NO fr_file; /* clear from file "fr_file" */ -FILE_NO to_file; /* ..to (not thru) file "to_file" */ +static int clear_cache( +FILE_NO fr_file, /* clear from file "fr_file" */ +FILE_NO to_file /* ..to (not thru) file "to_file" */ +) { FILE_NO s_file; /* start file to be cleared */ FILE_NO e_file; /* end file (+1) to be cleared */ @@ -564,7 +558,7 @@ FILE_NO to_file; /* ..to (not thru) file "to_file" */ * Writes out all modified cache pages to respective files (dio_out), * then writes out page zero (dio_pzflush). */ -int dio_flush() +int dio_flush(void) { int pgt_lc; /* loop control */ PAGE_ENTRY *pg_ptr; @@ -605,8 +599,7 @@ int dio_flush() /* Set the default file number */ -void dio_setdef( file_no ) -FILE_NO file_no; +void dio_setdef(FILE_NO file_no) { working_file = file_no; } @@ -621,10 +614,7 @@ FILE_NO file_no; /* Database I/O page get */ int -dio_get( page_no, page_ptr, hold ) -F_ADDR page_no; -char * *page_ptr; -int hold; +dio_get(F_ADDR page_no, char **page_ptr, int hold) { PAGE_ENTRY *pg_ptr; @@ -657,8 +647,7 @@ int hold; /* Set modified flag for a page */ int -dio_touch( page_no ) -F_ADDR page_no; +dio_touch(F_ADDR page_no) { PAGE_ENTRY *pg_ptr; @@ -693,10 +682,7 @@ F_ADDR page_no; * unless a page swap is necessary. */ int -dio_read( dba, recptr, hold ) -DB_ADDR dba; -char * *recptr; -int hold; +dio_read(DB_ADDR dba, char * *recptr, int hold) { FILE_NO file; int offset; @@ -741,10 +727,7 @@ int hold; * If recptr not NULL, copies rec to page cache. */ int -dio_write( dba, recptr, release ) -DB_ADDR dba; -const char *recptr; -int release; +dio_write(DB_ADDR dba, const char *recptr, int release) { FILE_NO file; F_ADDR us1, us2; @@ -785,8 +768,7 @@ int release; /* Release database page hold */ int -dio_release( dba ) -DB_ADDR dba; +dio_release(DB_ADDR dba) { FILE_NO file; F_ADDR us1, us2; @@ -819,12 +801,13 @@ DB_ADDR dba; /* Search a cache for page */ int -dio_findpg(file, page, pg_table, xpg_ptr, xlu_ptr ) -FILE_NO file; /* file number = 0..size_ft-1 */ -F_ADDR page; /* database page number */ -PAGE_ENTRY *pg_table; /* = dbpg_table, ixpg_table, or NULL */ -PAGE_ENTRY * *xpg_ptr; /* pointer to page table entry for found page */ -LOOKUP_ENTRY * *xlu_ptr;/* pointer to lookup table slot for found page*/ +dio_findpg( +FILE_NO file, /* file number = 0..size_ft-1 */ +F_ADDR page, /* database page number */ +PAGE_ENTRY *pg_table, /* = dbpg_table, ixpg_table, or NULL */ +PAGE_ENTRY * *xpg_ptr, /* pointer to page table entry for found page */ +LOOKUP_ENTRY * *xlu_ptr /* pointer to lookup table slot for found page*/ +) { LOOKUP_ENTRY *lookup; /* = db_lookup or ix_lookup */ int pgtab_sz; /* = db_pgtab_sz or ix_pgtab_sz */ @@ -968,9 +951,10 @@ LOOKUP_ENTRY * *xlu_ptr;/* pointer to lookup table slot for found page*/ * page swap function. */ int -dio_out(pg_ptr, lu_ptr) -PAGE_ENTRY *pg_ptr; /* page table entry to be output */ -LOOKUP_ENTRY *lu_ptr; /* corresponding lookup table entry */ +dio_out( +PAGE_ENTRY *pg_ptr, /* page table entry to be output */ +LOOKUP_ENTRY *lu_ptr /* corresponding lookup table entry */ +) { int desc; /* file descriptor */ int fno; /* file number */ @@ -1011,9 +995,10 @@ LOOKUP_ENTRY *lu_ptr; /* corresponding lookup table entry */ /****************************************/ /* Read in a page to the buffer */ -static int dio_in(pg_ptr, lu_ptr) -PAGE_ENTRY *pg_ptr; /* page table entry to be input */ -LOOKUP_ENTRY *lu_ptr; /* corresponding to pg_ptr */ +static int dio_in( +PAGE_ENTRY *pg_ptr, /* page table entry to be input */ +LOOKUP_ENTRY *lu_ptr /* corresponding to pg_ptr */ +) { int desc; /* file descriptor */ int fno; /* file number */ @@ -1058,7 +1043,7 @@ LOOKUP_ENTRY *lu_ptr; /* corresponding to pg_ptr */ /* Initialize page zero table */ -static int dio_pzinit() +static int dio_pzinit(void) { FILE_NO i; PGZERO *pgzero_ptr; @@ -1105,7 +1090,7 @@ static int dio_pzinit() /* Flush page zero table * Complement to dio_out which writes all pages except page zero. */ -static int dio_pzflush() +static int dio_pzflush(void) { FILE_NO i; int desc; @@ -1154,8 +1139,9 @@ static int dio_pzflush() /* Read a file's page zero */ int -dio_pzread(fno) -FILE_NO fno; /* file number */ +dio_pzread( +FILE_NO fno /* file number */ +) { FILE_ENTRY *file_ptr; PGZERO *pgzero_ptr; @@ -1197,9 +1183,10 @@ FILE_NO fno; /* file number */ * Returns memory address of the free slot into 'loc'. */ int -dio_pzalloc(fno, loc ) -FILE_NO fno; /* file number */ -F_ADDR *loc; /* pointer to allocated location */ +dio_pzalloc( +FILE_NO fno, /* file number */ +F_ADDR *loc /* pointer to allocated location */ +) { DB_ADDR dba; F_ADDR pg; @@ -1260,9 +1247,10 @@ F_ADDR *loc; /* pointer to allocated location */ /* Delete record slot or key node from page zero */ int -dio_pzdel(fno, loc ) -FILE_NO fno; /* file number */ -F_ADDR loc; /* location to be freed */ +dio_pzdel( +FILE_NO fno, /* file number */ +F_ADDR loc /* location to be freed */ +) { DB_ADDR dba; INT recnum; @@ -1316,8 +1304,7 @@ F_ADDR loc; /* location to be freed */ /****************************************/ /* Return pz_next for file fno */ -F_ADDR dio_pznext(fno) -FILE_NO fno; +F_ADDR dio_pznext(FILE_NO fno) { if ( pgzero[fno].pz_next == 0L ) dio_pzread(fno); @@ -1331,7 +1318,7 @@ FILE_NO fno; /****************************************/ /* Clear page zero cache */ -void dio_pzclr() +void dio_pzclr(void) { FILE_NO i; PGZERO *pgzero_ptr; diff --git a/cde/lib/DtSearch/raima/discon.c b/cde/lib/DtSearch/raima/discon.c index bafc2ade..d148b264 100644 --- a/cde/lib/DtSearch/raima/discon.c +++ b/cde/lib/DtSearch/raima/discon.c @@ -65,9 +65,10 @@ typedef struct { /* Disconnect the current member of set */ int -d_discon(nset , dbn) -int nset; /* set number */ -int dbn; /* database number */ +d_discon( +int nset, /* set number */ +int dbn /* database number */ +) { SET_PTR cosp; /* current owner's set pointer */ MEM_PTR cmmp; /* member's member pointer */ diff --git a/cde/lib/DtSearch/raima/disdel.c b/cde/lib/DtSearch/raima/disdel.c index 62c1362c..7eed532f 100644 --- a/cde/lib/DtSearch/raima/disdel.c +++ b/cde/lib/DtSearch/raima/disdel.c @@ -51,8 +51,7 @@ /* Disconnect from all sets (owner and member) and delete record */ int -d_disdel(dbn) -int dbn; +d_disdel(int dbn) { int rectype, nset, cset; int set, mem; diff --git a/cde/lib/DtSearch/raima/dproto.h b/cde/lib/DtSearch/raima/dproto.h index 0fd71569..ec204044 100644 --- a/cde/lib/DtSearch/raima/dproto.h +++ b/cde/lib/DtSearch/raima/dproto.h @@ -159,135 +159,133 @@ */ -int d_setfiles(P1(int)); /* dio.c */ -int d_setpages(P1(int) Pi(int)); /* dio.c */ -int d_trbound(P0); /* trlog.c */ -int d_trlog(P1(int) Pi(int) Pi(const char *) Pi(int)); +int d_setfiles(int); /* dio.c */ +int d_setpages(int, int); /* dio.c */ +int d_trbound(void); /* trlog.c */ +int d_trlog(int, int, const char *, int); /* trlog.c */ -int d_trmark(P0); /* trlog.c */ -int d_tron(P0); /* trlog.c */ -int d_troff(P0); /* trlog.c */ -int d_decode_dba(P1(DB_ADDR) Pi(int *) Pi(long *)); +int d_trmark(void); /* trlog.c */ +int d_tron(void); /* trlog.c */ +int d_troff(void); /* trlog.c */ +int d_decode_dba(DB_ADDR, int *, long *); /* dbacode.c */ -int d_encode_dba(P1(int) Pi(long) Pi(DB_ADDR *)); +int d_encode_dba(int, long, DB_ADDR *); /* dbacode.c */ #define d_memlock(p) /**/ #define d_memlock_group(lg) S_OKAY #define d_memunlock(p) /**/ #define d_memunlock_group(lg) /**/ -char * d_alloc(P1(unsigned)); /* alloc.c */ -char * d_calloc(P1(unsigned) Pi(unsigned)); /* alloc.c */ -void d_free(P1(CHAR_P *)); /* alloc.c */ +char * d_alloc(unsigned); /* alloc.c */ +char * d_calloc(unsigned, unsigned); /* alloc.c */ +void d_free(CHAR_P *); /* alloc.c */ #define dt_opentask(a) S_OKAY #define dt_closetask(a) S_OKAY -int d_close(P0); /* dblfcns.c */ -int d_cmstat(P1(int) DBN_Dn); /* cmstat.c */ -int d_cmtype(P1(int) Pi(int *) DBN_Dn); /* cmtype.c */ -int d_connect(P1(int) DBN_Dn); /* connect.c */ -int d_cotype(P1(int) Pi(int *) DBN_Dn); /* cotype.c */ -int d_crget(P1(DB_ADDR *) DBN_Dn); /* crget.c */ -int d_crread(P1(long) Pi(char *) DBN_Dn); /* crread.c */ -int d_crset(P1(DB_ADDR *) DBN_Dn); /* crset.c */ -int d_crtype(P1(int *) DBN_Dn); /* crtype.c */ -int d_crwrite(P1(long) Pi(char *) DBN_Dn); /* crwrite.c */ -int d_csmget(P1(int) Pi(DB_ADDR *) DBN_Dn); /* csmget.c */ -int d_csmread(P1(int) Pi(long) Pi(char *) DBN_Dn); +int d_close(void); /* dblfcns.c */ +int d_cmstat(int, int); /* cmstat.c */ +int d_cmtype(int, int *, int); /* cmtype.c */ +int d_connect(int, int); /* connect.c */ +int d_cotype(int, int *, int); /* cotype.c */ +int d_crget(DB_ADDR *, int); /* crget.c */ +int d_crread(long, char *, int); /* crread.c */ +int d_crset(DB_ADDR *, int); /* crset.c */ +int d_crtype(int *, int); /* crtype.c */ +int d_crwrite(long, char *, int); /* crwrite.c */ +int d_csmget(int, DB_ADDR *, int); /* csmget.c */ +int d_csmread(int, long, char *, int); /* csmread.c */ -int d_csmset(P1(int) Pi(DB_ADDR *) DBN_Dn); /* csmset.c */ -int d_csmwrite(P1(int) Pi(long) Pi(const char *) DBN_Dn); +int d_csmset(int, DB_ADDR *, int); /* csmset.c */ +int d_csmwrite(int, long, const char *, int); /* csmwrite.c */ -int d_csoget(P1(int) Pi(DB_ADDR *) DBN_Dn); /* csoget.c */ -int d_csoread(P1(int) Pi(long) Pi(char *) DBN_Dn); +int d_csoget(int, DB_ADDR *, int); /* csoget.c */ +int d_csoread(int, long, char *, int); /* csoread.c */ -int d_csoset(P1(int) Pi(DB_ADDR *) DBN_Dn); /* csoset.c */ -int d_csowrite(P1(int) Pi(long) Pi(const char *) DBN_Dn); +int d_csoset(int, DB_ADDR *, int); /* csoset.c */ +int d_csowrite(int, long, const char *, int); /* csowrite.c */ -int d_ctbpath(P1(const char *)); /* pathfcns.c */ -int d_dbdpath(P1(const char *)); /* dbdpath.c */ -int d_dbfpath(P1(const char *)); /* dbfpath.c */ -int d_dblog(P1(const char *)); /* dblog.c */ -int d_dbtaf(P1(const char *)); /* dbtaf.c */ -int d_dbuserid(P1(const char *)); /* dbuserid.c */ -int d_delete(DBN_D1); /* delete.c */ -int d_disdel(DBN_D1); /* disdel.c */ -int d_recnext(DBN_D1); /* recnext.c */ -int d_recprev(DBN_D1); /* recprev.c */ -int d_destroy(P1(const char *)); /* destroy.c */ -int d_discon(P1(int) DBN_Dn); /* discon.c */ -int d_fillnew(P1(int) Pi(const char *) DBN_Dn); /* fillnew.c */ -int d_findco(P1(int) DBN_Dn); /* findco.c */ -int d_findfm(P1(int) DBN_Dn); /* findfm.c */ -int d_findlm(P1(int) DBN_Dn); /* findlm.c */ -int d_findnm(P1(int) DBN_Dn); /* findnm.c */ -int d_findpm(P1(int) DBN_Dn); /* findpm.c */ -int d_freeall(P0); /* dblfcns.c */ -int d_initialize(DBN_D1); /* initial.c */ -int d_initfile(P1(FILE_NO) DBN_Dn); /* initial.c */ -int d_ismember(P1(int) DBN_Dn); /* ismember.c */ -int d_isowner(P1(int) DBN_Dn); /* isowner.c */ -int d_keydel(P1(long) DBN_Dn); /* keydel.c */ -int d_keyexist(P1(long) DBN_Dn); /* keyexist.c */ -int d_keyfind(P1(long) Pi(const char *) DBN_Dn); +int d_ctbpath(const char *); /* pathfcns.c */ +int d_dbdpath(const char *); /* dbdpath.c */ +int d_dbfpath(const char *); /* dbfpath.c */ +int d_dblog(const char *); /* dblog.c */ +int d_dbtaf(const char *); /* dbtaf.c */ +int d_dbuserid(const char *); /* dbuserid.c */ +int d_delete(int); /* delete.c */ +int d_disdel(int); /* disdel.c */ +int d_recnext(int); /* recnext.c */ +int d_recprev(int); /* recprev.c */ +int d_destroy(const char *); /* destroy.c */ +int d_discon(int, int); /* discon.c */ +int d_fillnew(int, const char *, int); /* fillnew.c */ +int d_findco(int, int); /* findco.c */ +int d_findfm(int, int); /* findfm.c */ +int d_findlm(int, int); /* findlm.c */ +int d_findnm(int, int); /* findnm.c */ +int d_findpm(int, int); /* findpm.c */ +int d_freeall(void); /* dblfcns.c */ +int d_initialize(int); /* initial.c */ +int d_initfile(FILE_NO, int); /* initial.c */ +int d_ismember(int, int); /* ismember.c */ +int d_isowner(int, int); /* isowner.c */ +int d_keydel(long, int); /* keydel.c */ +int d_keyexist(long, int); /* keyexist.c */ +int d_keyfind(long, const char *, int); /* keyfind.c */ -int d_keyfree(P1(long) DBN_Dn); /* dblfcns.c */ -int d_keyfrst(P1(long) DBN_Dn); /* keyfrst.c */ -int d_keylast(P1(long) DBN_Dn); /* keylast.c */ -int d_keylock(P1(long) Pi(char *) DBN_Dn); /* dblfcns.c */ -int d_keylstat(P1(long) Pi(char *) DBN_Dn); /* dblfcns.c */ -int d_keynext(P1(long) DBN_Dn); /* keynext.c */ -int d_keyprev(P1(long) DBN_Dn); /* keyprev.c */ -int d_keyread(P1(char *)); /* keyfcns.c */ -int d_keystore(P1(long) DBN_Dn); /* keystore.c */ -int d_lock(P1(int) Pi(LOCK_REQUEST *) DBN_Dn); /* dblfcns.c */ -int d_makenew(P1(int) DBN_Dn); /* makenew.c */ -int d_mapchar(P1(unsigned char) Pi(unsigned char) - Pi(const char *) Pi(unsigned char)); /* mapchar.c */ -int d_members(P1(int) Pi(LONG *) DBN_Dn); /* members.c */ -int d_off_opt(P1(int)); /* options.c */ -int d_on_opt(P1(int)); /* options.c */ -int d_open(P1(const char *) Pi(const char *)); +int d_keyfree(long, int); /* dblfcns.c */ +int d_keyfrst(long, int); /* keyfrst.c */ +int d_keylast(long, int); /* keylast.c */ +int d_keylock(long, char *, int); /* dblfcns.c */ +int d_keylstat(long, char *, int); /* dblfcns.c */ +int d_keynext(long, int); /* keynext.c */ +int d_keyprev(long, int); /* keyprev.c */ +int d_keyread(char *); /* keyfcns.c */ +int d_keystore(long, int); /* keystore.c */ +int d_lock(int, LOCK_REQUEST *, int); /* dblfcns.c */ +int d_makenew(int, int); /* makenew.c */ +int d_mapchar(unsigned char, unsigned char, const char *, unsigned char); /* mapchar.c */ +int d_members(int, LONG *, int); /* members.c */ +int d_off_opt(int); /* options.c */ +int d_on_opt(int); /* options.c */ +int d_open(const char *, const char *); /* dblfcns.c */ -int d_rerdcurr(P1(DB_ADDR **)); /* rwcurr.c */ -int d_rdcurr(P1(DB_ADDR **) Pi(int *)); /* rwcurr.c */ -int d_wrcurr(P1(DB_ADDR *)); /* rwcurr.c */ -int d_recfree(P1(int) DBN_Dn); /* dblfcns.c */ -int d_recfrst(P1(int) DBN_Dn); /* recfrst.c */ -int d_reclast(P1(int) DBN_Dn); /* reclast.c */ -int d_reclock(P1(int) Pi(char *) DBN_Dn); /* dblfcns.c */ -int d_reclstat(P1(int) Pi(char *) DBN_Dn); /* dblfcns.c */ -int d_recover(P1(const char *)); /* recover.c */ -int d_recread(P1(char *) DBN_Dn); /* recread.c */ -int d_recset(P1(int) DBN_Dn); /* recset.c */ -int d_recwrite(P1(const char *) DBN_Dn); /* recwrite.c */ -int d_renfile(P1(const char *) Pi(FILE_NO) - Pi(const char *)); /* renfile.c */ -int d_retries(P1(int)); /* dblfcns.c */ -int d_rlbclr(P0); /* dblfcns.c */ -int d_rlbset(P0); /* dblfcns.c */ -int d_rlbtst(P0); /* dblfcns.c */ -int d_set_dberr(P1(FARPROC)); /* dberr.c */ -int d_setdb(P1(int)); /* setdb.c */ -int d_setfree(P1(int) DBN_Dn); /* dblfcns.c */ -int d_setkey(P1(long) Pi(const char *) DBN_Dn); /* makenew.c */ -int d_setlock(P1(int) Pi(char *) DBN_Dn); /* dblfcns.c */ -int d_setlstat(P1(int) Pi(char *) DBN_Dn); /* dblfcns.c */ -int d_setmm(P1(int) Pi(int) DBN_Dn); /* setmm.c */ -int d_setmo(P1(int) Pi(int) DBN_Dn); /* setmo.c */ -int d_setmr(P1(int) DBN_Dn); /* setmr.c */ -int d_setom(P1(int) Pi(int) DBN_Dn); /* setom.c */ -int d_setoo(P1(int) Pi(int) DBN_Dn); /* setoo.c */ -int d_setor(P1(int) DBN_Dn); /* setor.c */ -int d_setrm(P1(int) DBN_Dn); /* setrm.c */ -int d_setro(P1(int) DBN_Dn); /* setro.c */ -int d_timeout(P1(int)); /* dblfcns.c */ -int d_trabort(P0); /* dblfcns.c */ -int d_trbegin(P1(const char *)); /* dblfcns.c */ -int d_trend(P0); /* dblfcns.c */ +int d_rerdcurr(DB_ADDR **); /* rwcurr.c */ +int d_rdcurr(DB_ADDR **, int *); /* rwcurr.c */ +int d_wrcurr(DB_ADDR *); /* rwcurr.c */ +int d_recfree(int, int); /* dblfcns.c */ +int d_recfrst(int, int); /* recfrst.c */ +int d_reclast(int, int); /* reclast.c */ +int d_reclock(int, char *, int); /* dblfcns.c */ +int d_reclstat(int, char *, int); /* dblfcns.c */ +int d_recover(const, char *); /* recover.c */ +int d_recread(char *, int); /* recread.c */ +int d_recset(int, int); /* recset.c */ +int d_recwrite(const char *, int); /* recwrite.c */ +int d_renfile(const char *dbn, FILE_NO fno, const char *fnm); /* renfile.c */ +int d_retries(int); /* dblfcns.c */ +int d_rlbclr(void); /* dblfcns.c */ +int d_rlbset(void); /* dblfcns.c */ +int d_rlbtst(void); /* dblfcns.c */ +int d_set_dberr(FARPROC); /* dberr.c */ +int d_setdb(int); /* setdb.c */ +int d_setfree(int, int); /* dblfcns.c */ +int d_setkey(long, const char *, int); /* makenew.c */ +int d_setlock(int, char *, int); /* dblfcns.c */ +int d_setlstat(int, char *, int); /* dblfcns.c */ +int d_setmm(int, int, int); /* setmm.c */ +int d_setmo(int, int, int); /* setmo.c */ +int d_setmr(int, int); /* setmr.c */ +int d_setom(int, int, int); /* setom.c */ +int d_setoo(int, int, int); /* setoo.c */ +int d_setor(int, int); /* setor.c */ +int d_setrm(int, int); /* setrm.c */ +int d_setro(int, int); /* setro.c */ +int d_timeout(int); /* dblfcns.c */ +int d_trabort(void); /* dblfcns.c */ +int d_trbegin(const char *); /* dblfcns.c */ +int d_trend(void); /* dblfcns.c */ -int dberr(P1(int)); /* dberr.c */ +int dberr(int); /* dberr.c */ #define D_FUNCTIONS_H /* vpp -nOS2 -dUNIX -nBSD -nVANILLA_BSD -nVMS -nMEMLOCK -nWINDOWS -nFAR_ALLOC -f/usr/users/master/config/nonwin dproto.h */ diff --git a/cde/lib/DtSearch/raima/fillnew.c b/cde/lib/DtSearch/raima/fillnew.c index 1e2f9bc3..c52bb07c 100644 --- a/cde/lib/DtSearch/raima/fillnew.c +++ b/cde/lib/DtSearch/raima/fillnew.c @@ -55,10 +55,11 @@ /* Create and fill a new record */ int -d_fillnew( nrec, recval , dbn ) -int nrec; /* record number */ -const char *recval; /* record value */ -int dbn; /* database number */ +d_fillnew( +int nrec, /* record number */ +const char *recval, /* record value */ +int dbn /* database number */ +) { DB_ADDR db_addr; INT recnum, stat; diff --git a/cde/lib/DtSearch/raima/findco.c b/cde/lib/DtSearch/raima/findco.c index 8fb81467..3760309c 100644 --- a/cde/lib/DtSearch/raima/findco.c +++ b/cde/lib/DtSearch/raima/findco.c @@ -50,9 +50,7 @@ /* Find owner of current record */ int -d_findco(nset , dbn) -int nset; -int dbn; +d_findco(int nset, int dbn) { int set; char mem[MEMPSIZE]; diff --git a/cde/lib/DtSearch/raima/findfm.c b/cde/lib/DtSearch/raima/findfm.c index 05a44789..42121051 100644 --- a/cde/lib/DtSearch/raima/findfm.c +++ b/cde/lib/DtSearch/raima/findfm.c @@ -50,9 +50,7 @@ /* Find first member of set */ int -d_findfm(nset , dbn) -int nset; -int dbn; +d_findfm(int nset, int dbn) { char setp[SETPSIZE]; DB_ADDR mem; diff --git a/cde/lib/DtSearch/raima/findlm.c b/cde/lib/DtSearch/raima/findlm.c index 0f08e1f0..42c07a37 100644 --- a/cde/lib/DtSearch/raima/findlm.c +++ b/cde/lib/DtSearch/raima/findlm.c @@ -50,9 +50,7 @@ /* Find last member of set */ int -d_findlm(nset , dbn) -int nset; -int dbn; +d_findlm(int nset, int dbn) { char setp[SETPSIZE]; DB_ADDR mem; diff --git a/cde/lib/DtSearch/raima/findnm.c b/cde/lib/DtSearch/raima/findnm.c index b3b9b5a2..662f9e2a 100644 --- a/cde/lib/DtSearch/raima/findnm.c +++ b/cde/lib/DtSearch/raima/findnm.c @@ -50,9 +50,7 @@ /* Find next member of set */ int -d_findnm(nset , dbn) -int nset; -int dbn; +d_findnm(int nset, int dbn) { int set; char memp[MEMPSIZE]; diff --git a/cde/lib/DtSearch/raima/findpm.c b/cde/lib/DtSearch/raima/findpm.c index 60a22380..4c4c2230 100644 --- a/cde/lib/DtSearch/raima/findpm.c +++ b/cde/lib/DtSearch/raima/findpm.c @@ -50,9 +50,7 @@ /* Find previous member of set */ int -d_findpm(nset , dbn) -int nset; -int dbn; +d_findpm(int nset, int dbn) { int set; char memp[MEMPSIZE]; diff --git a/cde/lib/DtSearch/raima/initial.c b/cde/lib/DtSearch/raima/initial.c index 88ada382..edd3325c 100644 --- a/cde/lib/DtSearch/raima/initial.c +++ b/cde/lib/DtSearch/raima/initial.c @@ -89,8 +89,7 @@ extern int max_open_files; /* see dio.c */ /* Database initialization function */ int -d_initialize(dbn) -int dbn; +d_initialize(int dbn) { FILE_NO fno; @@ -113,9 +112,10 @@ int dbn; /* Initialize database file */ int -d_initfile(fno , dbn) -FILE_NO fno; /* file table entry of file to be initialized */ -int dbn; +d_initfile( +FILE_NO fno, /* file table entry of file to be initialized */ +int dbn +) { INIT_PAGE_P Page; #define page (Page.ptr) diff --git a/cde/lib/DtSearch/raima/inittab.c b/cde/lib/DtSearch/raima/inittab.c index 4059cd45..b0a67b95 100644 --- a/cde/lib/DtSearch/raima/inittab.c +++ b/cde/lib/DtSearch/raima/inittab.c @@ -86,8 +86,8 @@ int dump_init_tables = FALSE; /* Internal function prototypes */ -static int alloc_dict(P0); -static int initcurr(P0); +static int alloc_dict(void); +static int initcurr(void); @@ -95,7 +95,7 @@ static int initcurr(P0); /* Initialize database tables */ int -inittab() +inittab(void) { int dbt_lc; /* loop control */ INT i, j; @@ -525,7 +525,7 @@ goodver: /* Allocate space for dictionary */ -static int alloc_dict() +static int alloc_dict(void) { int old_size; int new_size; @@ -622,7 +622,7 @@ static int alloc_dict() /* Initialize currency tables */ -static int initcurr() +static int initcurr(void) { int dbt_lc; /* loop control */ int rec, i; diff --git a/cde/lib/DtSearch/raima/ismember.c b/cde/lib/DtSearch/raima/ismember.c index b87d0280..5b37a194 100644 --- a/cde/lib/DtSearch/raima/ismember.c +++ b/cde/lib/DtSearch/raima/ismember.c @@ -51,9 +51,10 @@ /* Check to see if current record is a connected member of SET */ int -d_ismember(set , dbn) -int set; /* set table entry */ -int dbn; /* database number */ +d_ismember( +int set, /* set table entry */ +int dbn /* database number */ +) { char crmp[MEMPSIZE]; /* current record's member pointer */ SET_ENTRY *set_ptr; diff --git a/cde/lib/DtSearch/raima/isowner.c b/cde/lib/DtSearch/raima/isowner.c index 80f320a9..79878df5 100644 --- a/cde/lib/DtSearch/raima/isowner.c +++ b/cde/lib/DtSearch/raima/isowner.c @@ -51,9 +51,10 @@ /* Check to see if current record is a owner of non-empty SET */ int -d_isowner(set , dbn) -int set; /* set table entry */ -int dbn; /* database number */ +d_isowner( +int set, /* set table entry */ +int dbn /* database number */ +) { char crsp[SETPSIZE]; /* current record's set pointer */ SET_ENTRY *set_ptr; diff --git a/cde/lib/DtSearch/raima/keydel.c b/cde/lib/DtSearch/raima/keydel.c index b6a4a7a8..bd3d1c65 100644 --- a/cde/lib/DtSearch/raima/keydel.c +++ b/cde/lib/DtSearch/raima/keydel.c @@ -54,9 +54,10 @@ /* Delete optional key value */ int -d_keydel(field , dbn) -long field; /* key field constant */ -int dbn; /* database number */ +d_keydel( +long field, /* key field constant */ +int dbn /* database number */ +) { int fld; /* field number */ int rec, rn; /* record type of current record */ diff --git a/cde/lib/DtSearch/raima/keyexist.c b/cde/lib/DtSearch/raima/keyexist.c index b1f8008a..350220b8 100644 --- a/cde/lib/DtSearch/raima/keyexist.c +++ b/cde/lib/DtSearch/raima/keyexist.c @@ -46,9 +46,10 @@ /* Check for optional key existence */ int -d_keyexist(field , dbn) -long field; /* key field constant */ -int dbn; /* database number */ +d_keyexist( +long field, /* key field constant */ +int dbn /* database number */ +) { int fld; /* field number */ int rec, rn; /* record type of current record */ diff --git a/cde/lib/DtSearch/raima/keyfcns.c b/cde/lib/DtSearch/raima/keyfcns.c index a629a7fa..473da2ea 100644 --- a/cde/lib/DtSearch/raima/keyfcns.c +++ b/cde/lib/DtSearch/raima/keyfcns.c @@ -114,18 +114,15 @@ typedef struct { #define KEYREPOS 3 /* Internal function prototypes */ -static int node_search(P1(const char *) Pi(DB_ADDR *) - Pi(NODE *) Pi(int *) Pi(int *) - Pi(F_ADDR *)); -static int keycmp(P1(const char *) Pi(KEY_SLOT *) - Pi(DB_ADDR *)); -static int expand(P1(const char *) Pi(DB_ADDR) Pi(F_ADDR)); -static int split_root(P1(NODE *)); -static int split_node(P1(F_ADDR) Pi(NODE *)); -static int delete(P0); -static void open_slots(P1(NODE *) Pi(int) Pi(int)); -static void close_slots(P1(NODE *) Pi(int) Pi(int)); -static void key_found(P1(DB_ADDR *)); +static int node_search(const char *, DB_ADDR *, NODE *, int *, int *, F_ADDR *); +static int keycmp(const char *, KEY_SLOT *, DB_ADDR *); +static int expand(const char *, DB_ADDR, F_ADDR); +static int split_root(NODE *); +static int split_node(F_ADDR, NODE *); +static int delete(void); +static void open_slots(NODE *, int, int); +static void close_slots(NODE *, int, int); +static void key_found(DB_ADDR *); static KEY_INFO *curkey; @@ -145,7 +142,7 @@ static int unique; /* Open B-tree key field index processing */ int -key_open() +key_open(void) { int fd_lc; /* loop control */ long t; /* total keys thru level l */ @@ -209,7 +206,7 @@ key_open() /* Close key field processing */ -void key_close() +void key_close(void) { int k; KEY_INFO *ki_ptr; @@ -231,8 +228,9 @@ void key_close() /* Initialize key function operation */ int -key_init(field ) -int field; /* field number to be processed */ +key_init( +int field /* field number to be processed */ +) { FIELD_ENTRY *fld_ptr; FILE_ENTRY *file_ptr; @@ -263,8 +261,7 @@ int field; /* field number to be processed */ /* Reset key_info last status to reposition keys on file "fno" */ int -key_reset(fno ) -FILE_NO fno; +key_reset(FILE_NO fno) { int i; KEY_INFO *ki_ptr; @@ -282,9 +279,10 @@ FILE_NO fno; /* Locate proper key position on B-tree */ int -key_locpos(key_val, dba) -const char *key_val; /* key search value */ -DB_ADDR *dba; /* database address of located key */ +key_locpos( +const char *key_val, /* key search value */ +DB_ADDR *dba /* database address of located key */ +) { NODE *node; /* pointer to current node */ F_ADDR child; /* page number of child node */ @@ -373,14 +371,14 @@ DB_ADDR *dba; /* database address of located key */ /* Search node for key value */ -static int node_search(key_val, dba, node, slotno, slot_offset, - child) -const char *key_val; /* key being searched */ -DB_ADDR *dba; /* database address included in comparison if not null */ -NODE *node; /* node being searched */ -int *slotno; /* slot number of key position in node */ -int *slot_offset; /* slot position offset */ -F_ADDR *child; /* child ptr of located key */ +static int node_search( +const char *key_val, /* key being searched */ +DB_ADDR *dba, /* database address included in comparison if not null */ +NODE *node, /* node being searched */ +int *slotno, /* slot number of key position in node */ +int *slot_offset, /* slot position offset */ +F_ADDR *child /* child ptr of located key */ +) { int cmp, i, l, u, slot_pos; char *node_slot_ptr; @@ -428,10 +426,11 @@ have_slot: /* Compare key value */ -static int keycmp(key_val, slot, dba) -const char *key_val; /* key value */ -KEY_SLOT *slot; /* pointer to key slot to be compared */ -DB_ADDR *dba; /* database address included in comparison if not null */ +static int keycmp( +const char *key_val, /* key value */ +KEY_SLOT *slot, /* pointer to key slot to be compared */ +DB_ADDR *dba /* database address included in comparison if not null */ +) { /* returns < 0 if key_val < slot @@ -452,9 +451,10 @@ DB_ADDR *dba; /* database address included in comparison if not null */ /* Scan thru key field */ int -key_scan(fcn, dba ) -int fcn; /* next or prev */ -DB_ADDR *dba; /* db address of scanned record */ +key_scan( +int fcn, /* next or prev */ +DB_ADDR *dba /* db address of scanned record */ +) { F_ADDR child; NODE *node; @@ -550,8 +550,7 @@ DB_ADDR *dba; /* db address of scanned record */ /* Key has been found. Save appropriate information */ -static void key_found(dba) -DB_ADDR *dba; +static void key_found(DB_ADDR *dba) { MEM_LOCK(&curkey->Keyval); /* save key value and database address for possible repositioning */ @@ -570,9 +569,10 @@ DB_ADDR *dba; /* Find key boundary */ int -key_boundary(fcn, dba ) -int fcn; /* KEYFRST or KEYLAST */ -DB_ADDR *dba; /* to get dba of first or last key */ +key_boundary( +int fcn, /* KEYFRST or KEYLAST */ +DB_ADDR *dba /* to get dba of first or last key */ +) { F_ADDR pg; /* node number */ NODE *node; /* pointer to node contents in cache */ @@ -660,10 +660,11 @@ DB_ADDR *dba; /* to get dba of first or last key */ /* Insert key field into B-tree */ int -key_insert(fld, key_val, dba ) -int fld; /* key field number */ -const char *key_val; /* key value */ -DB_ADDR dba; /* record's database address */ +key_insert( +int fld, /* key field number */ +const char *key_val, /* key value */ +DB_ADDR dba /* record's database address */ +) { int stat; @@ -695,10 +696,11 @@ DB_ADDR dba; /* record's database address */ /* Expand node for new key */ -static int expand(key_val, dba, brother ) -const char *key_val; /* key value */ -DB_ADDR dba; /* record's database address */ -F_ADDR brother; /* page number of brother node */ +static int expand( +const char *key_val, /* key value */ +DB_ADDR dba, /* record's database address */ +F_ADDR brother /* page number of brother node */ +) { F_ADDR pg; NODE *node; @@ -755,9 +757,10 @@ F_ADDR brother; /* page number of brother node */ /* Split node into two nodes */ -static int split_node(l_pg, l_node ) -F_ADDR l_pg; /* left node's page number */ -NODE *l_node; /* left node buffer */ +static int split_node( +F_ADDR l_pg, /* left node's page number */ +NODE *l_node /* left node buffer */ +) { F_ADDR r_pg; NODE *r_node; @@ -800,8 +803,7 @@ NODE *l_node; /* left node buffer */ /* Split root node */ -static int split_root(node ) -NODE *node; +static int split_root(NODE *node) { F_ADDR l_pg, r_pg; NODE *l_node, *r_node; @@ -849,10 +851,7 @@ NODE *node; /* Delete key from B-tree */ int -key_delete(fld, key_val, dba ) -int fld; -char const *key_val; -DB_ADDR dba; +key_delete(int fld, char const *key_val, DB_ADDR dba) { int stat; @@ -879,7 +878,7 @@ DB_ADDR dba; /* Delete key at current node_path position */ -static int delete() +static int delete(void) { F_ADDR pg, p_pg, l_pg, r_pg; NODE *node; @@ -1093,10 +1092,7 @@ shrink: /* delete key from leaf (shrink node ) */ /* Open n slots in node */ -static void open_slots(node, slot_pos, n) -NODE *node; -int slot_pos; -int n; +static void open_slots(NODE *node, int slot_pos, int n) { char *dst, *src; int amt, w, nw; @@ -1116,10 +1112,7 @@ int n; /* Close n slots in node */ -static void close_slots(node, slot_pos, n) -NODE *node; -int slot_pos; -int n; +static void close_slots(NODE *node, int slot_pos, int n) { char *dst, *src; int w, amt; @@ -1140,8 +1133,7 @@ int n; /* Read value of last key scanned */ int -d_keyread(key_val) -char *key_val; +d_keyread(char *key_val) { int kt_lc; /* loop control */ #ifndef NO_FLOAT @@ -1214,11 +1206,12 @@ char *key_val; /* Build compound key value from record */ int -key_bldcom(fld, rec, key, cflag ) -int fld; /* compound key field number */ -char *rec; /* ptr to record data */ -char *key; /* ptr to array to recv constructed key */ -int cflag; /* TRUE to compliment compound descending keys */ +key_bldcom( +int fld, /* compound key field number */ +char *rec, /* ptr to record data */ +char *key, /* ptr to array to recv constructed key */ +int cflag /* TRUE to compliment compound descending keys */ +) { int kt_lc; /* loop control */ #ifndef NO_FLOAT @@ -1278,10 +1271,7 @@ int cflag; /* TRUE to compliment compound descending keys */ /* Complement and copy bytes */ -void key_cmpcpy(s1, s2, n) -char *s1; -char *s2; -INT n; +void key_cmpcpy(char *s1, char *s2, INT n) { while ( n-- ) { *s1++ = ~(*s2++); diff --git a/cde/lib/DtSearch/raima/keyfind.c b/cde/lib/DtSearch/raima/keyfind.c index 84af4262..ee878fb4 100644 --- a/cde/lib/DtSearch/raima/keyfind.c +++ b/cde/lib/DtSearch/raima/keyfind.c @@ -57,10 +57,11 @@ static void chk_desc_key(P1(int) Pi(FIELD_ENTRY *) /* Find record thru key field */ int -d_keyfind(field, fldval , dbn) -long field; /* field constant */ -const char *fldval; /* value of the data field */ -int dbn; /* database number */ +d_keyfind( +long field, /* field constant */ +const char *fldval, /* value of the data field */ +int dbn /* database number */ +) { int fld, rec; DB_ADDR dba; @@ -96,11 +97,7 @@ int dbn; /* database number */ /* Check compound key value for descending fields */ -static void chk_desc_key(fld, fld_ptr, fldval, ckey) -int fld; -FIELD_ENTRY *fld_ptr; -const char *fldval; -char *ckey; +static void chk_desc_key(int fld, FIELD_ENTRY *fld_ptr, const char *fldval, char *ckey) { int kt_lc; /* loop control */ #ifndef NO_FLOAT diff --git a/cde/lib/DtSearch/raima/keyfrst.c b/cde/lib/DtSearch/raima/keyfrst.c index faa23420..439225f7 100644 --- a/cde/lib/DtSearch/raima/keyfrst.c +++ b/cde/lib/DtSearch/raima/keyfrst.c @@ -51,9 +51,10 @@ /* Find first key */ int -d_keyfrst(field , dbn) -long field; /* field constant */ -int dbn; /* database number */ +d_keyfrst( +long field, /* field constant */ +int dbn /* database number */ +) { int fld, rec; DB_ADDR dba; diff --git a/cde/lib/DtSearch/raima/keylast.c b/cde/lib/DtSearch/raima/keylast.c index 44b25d44..e86325e2 100644 --- a/cde/lib/DtSearch/raima/keylast.c +++ b/cde/lib/DtSearch/raima/keylast.c @@ -51,9 +51,10 @@ /* Find last key */ int -d_keylast(field , dbn) -long field; /* field constant */ -int dbn; /* database number */ +d_keylast( +long field, /* field constant */ +int dbn /* database number */ +) { int fld, rec; DB_ADDR dba; diff --git a/cde/lib/DtSearch/raima/keynext.c b/cde/lib/DtSearch/raima/keynext.c index 25f13f53..7dc1c3e3 100644 --- a/cde/lib/DtSearch/raima/keynext.c +++ b/cde/lib/DtSearch/raima/keynext.c @@ -52,9 +52,10 @@ /* Find next record thru key field */ int -d_keynext(field , dbn) -long field; /* field constant */ -int dbn; /* database number */ +d_keynext( +long field, /* field constant */ +int dbn /* database number */ +) { int fld, rec; DB_ADDR dba; diff --git a/cde/lib/DtSearch/raima/keyprev.c b/cde/lib/DtSearch/raima/keyprev.c index 766c8da9..1334c990 100644 --- a/cde/lib/DtSearch/raima/keyprev.c +++ b/cde/lib/DtSearch/raima/keyprev.c @@ -52,9 +52,10 @@ /* Find previous record thru key field */ int -d_keyprev(field , dbn) -long field; /* field constant */ -int dbn; /* database number */ +d_keyprev( +long field, /* field constant */ +int dbn /* database number */ +) { int fld, rec; DB_ADDR dba; diff --git a/cde/lib/DtSearch/raima/keystore.c b/cde/lib/DtSearch/raima/keystore.c index 53826ecc..9327d9f1 100644 --- a/cde/lib/DtSearch/raima/keystore.c +++ b/cde/lib/DtSearch/raima/keystore.c @@ -53,9 +53,10 @@ /* Store optional key value */ int -d_keystore(field , dbn) -long field; /* key field constant */ -int dbn; /* database number */ +d_keystore( +long field, /* key field constant */ +int dbn /* database number */ +) { int fld; /* field number */ int rec, rn; /* record type of current record */ diff --git a/cde/lib/DtSearch/raima/libfcns.c b/cde/lib/DtSearch/raima/libfcns.c index c19c6ed5..fa4296c1 100644 --- a/cde/lib/DtSearch/raima/libfcns.c +++ b/cde/lib/DtSearch/raima/libfcns.c @@ -71,8 +71,7 @@ static int ctblcmp(P1(const unsigned char FAR*) /* Check for valid db number and set curr_db, curr_db_table and curr_rn_table */ int -dbn_check(dbn) -int dbn; +dbn_check(int dbn) { if ( ! dbopen ) return( dberr(S_DBOPEN) ); @@ -93,10 +92,7 @@ int dbn; and set_table pointer. */ int -nset_check(nset, set, set_ptr ) -int nset; -int *set; -SET_ENTRY * *set_ptr; +nset_check(int nset, int *set, SET_ENTRY **set_ptr) { nset -= SETMARK; if ((nset < 0) || (nset >= TABLE_SIZE(Size_st))) @@ -111,12 +107,8 @@ SET_ENTRY * *set_ptr; and field numbers and pointers. */ int -nfld_check(nfld, rec, fld, rec_ptr, fld_ptr ) -long nfld; -int *rec; -int *fld; -RECORD_ENTRY * *rec_ptr; -FIELD_ENTRY * *fld_ptr; +nfld_check(long nfld, int *rec, int *fld, RECORD_ENTRY **rec_ptr, + FIELD_ENTRY **fld_ptr) { int trec; int tfld; @@ -136,10 +128,7 @@ FIELD_ENTRY * *fld_ptr; number and pointer. */ int -nrec_check(nrec, rec, rec_ptr) -int nrec; -int *rec; -RECORD_ENTRY * *rec_ptr; +nrec_check(int nrec, int *rec, RECORD_ENTRY **rec_ptr) { if (rec_okay(nrec - RECMARK, rec, (RECORD_ENTRY * *)rec_ptr)) db_status = S_OKAY; @@ -151,10 +140,7 @@ RECORD_ENTRY * *rec_ptr; /* Internal record number check */ -static int rec_okay(nrec, rec, rec_ptr) -int nrec; -int *rec; -RECORD_ENTRY * *rec_ptr; +static int rec_okay(int nrec, int *rec, RECORD_ENTRY **rec_ptr) { if ((nrec < 0) || (nrec >= TABLE_SIZE(Size_rt))) return (FALSE); @@ -166,10 +152,11 @@ RECORD_ENTRY * *rec_ptr; /* Compare values of two db_VISTA data fields */ -int fldcmp(fld_ptr, f1, f2) -FIELD_ENTRY *fld_ptr; -const char *f1; /* pointer to field 1 */ -const char *f2; /* pointer to field 2 */ +int fldcmp( +FIELD_ENTRY *fld_ptr, +const char *f1, /* pointer to field 1 */ +const char *f2 /* pointer to field 2 */ +) /* returns < 0 if f1 < f2, = 0 if f1 == f2, @@ -321,8 +308,7 @@ const char *f2; /* pointer to field 2 */ /* compare the INT variables */ -int INTcmp( i1, i2 ) -const char *i1, *i2; +int INTcmp(const char *i1, const char *i2) { INT I1, I2; @@ -334,8 +320,7 @@ const char *i1, *i2; /* compare two DB_ADDR variables */ -int ADDRcmp( d1, d2 ) -const DB_ADDR *d1, *d2; +int ADDRcmp(const DB_ADDR *d1, const DB_ADDR *d2) { DB_ADDR a1, a2; FILE_NO f1, f2; @@ -364,8 +349,7 @@ const DB_ADDR *d1, *d2; /* check for empty DB_ADDR */ int -null_dba( db_addr ) -const char *db_addr; +null_dba(const char *db_addr) { DB_ADDR dba; @@ -377,8 +361,7 @@ const char *db_addr; /* check for valid DB_ADDR */ int -check_dba( dba ) -DB_ADDR dba; +check_dba(DB_ADDR dba) { FILE_NO fno; F_ADDR rno, last; @@ -401,10 +384,11 @@ DB_ADDR dba; /* Compare two strings with sorting according to char-table */ -static int ctblcmp(s, t, n) -const unsigned char *s; /* String 1 */ -const unsigned char *t; /* String 2 */ -int n; /* Max. String length */ +static int ctblcmp( +const unsigned char *s, /* String 1 */ +const unsigned char *t, /* String 2 */ +int n /* Max. String length */ +) { int x; unsigned char f1, f2, x1, x2; diff --git a/cde/lib/DtSearch/raima/makenew.c b/cde/lib/DtSearch/raima/makenew.c index f0843f7d..84aca043 100644 --- a/cde/lib/DtSearch/raima/makenew.c +++ b/cde/lib/DtSearch/raima/makenew.c @@ -54,10 +54,7 @@ /* Set the value of a key field */ int -d_setkey( field, fldvalue , dbn ) -long field; -const char *fldvalue; -int dbn; +d_setkey(long field, const char *fldvalue, int dbn) { SK_P *sk_ptr; SK_P sk_p; @@ -117,7 +114,7 @@ int dbn; /* Free the memory allocated for the sk_list */ -int sk_free() +int sk_free(void) { SK_P *sk_ptr; @@ -135,9 +132,7 @@ int sk_free() /* Create a new empty record */ int -d_makenew( nrec , dbn ) -int nrec; -int dbn; +d_makenew(int nrec, int dbn) { DB_ADDR db_addr; INT recnum, fld, stat; diff --git a/cde/lib/DtSearch/raima/mapchar.c b/cde/lib/DtSearch/raima/mapchar.c index 8b3b6e3b..e6f4f006 100644 --- a/cde/lib/DtSearch/raima/mapchar.c +++ b/cde/lib/DtSearch/raima/mapchar.c @@ -75,12 +75,13 @@ static int nextc(P1(int)); /* Map ASCII-Characters for output and sorting */ -int d_mapchar(inchar,outchar,sort_str,subsort) -unsigned char inchar; /* value of character to be mapped */ -unsigned char outchar; /* output character as ... */ -const char *sort_str; /* sort string (max. len = 2) */ -unsigned char subsort; /* subsort value, to distinguish between two */ +int d_mapchar( +unsigned char inchar, /* value of character to be mapped */ +unsigned char outchar, /* output character as ... */ +const char *sort_str, /* sort string (max. len = 2) */ +unsigned char subsort /* subsort value, to distinguish between two */ /* equal values (e.g. 'a' and 'A', if necessary) */ +) { int indx; @@ -108,7 +109,7 @@ unsigned char subsort; /* subsort value, to distinguish between two */ /* read MAP_FILE and make appropriate d_mapchar-calls */ -int ctb_init() +int ctb_init(void) { int map_fd; unsigned char inchar, outchar, subsort; @@ -139,9 +140,7 @@ int ctb_init() } /* do an fgets from a binary file */ -static void bgets( s, len, fd ) -char *s; -int len, fd; +static void bgets(char *s, int len, int fd) { int c; @@ -160,8 +159,7 @@ eof: } /* get one character from the file */ -static int nextc( fd ) -int fd; +static int nextc(int fd) { int n; @@ -180,7 +178,7 @@ int fd; /* Allocate and initialize country_table */ -int ctbl_alloc() +int ctbl_alloc(void) { if ((db_global.country_tbl.ptr = (CNTRY_TBL *) ALLOC(&db_global.country_tbl,256*sizeof(CNTRY_TBL)+1,"country_tbl")) @@ -194,7 +192,7 @@ int ctbl_alloc() /* Free country table */ -void ctbl_free() +void ctbl_free(void) { MEM_UNLOCK( &db_global.country_tbl ); FREE( &db_global.country_tbl ); diff --git a/cde/lib/DtSearch/raima/members.c b/cde/lib/DtSearch/raima/members.c index 50a0fbdb..7e28149e 100644 --- a/cde/lib/DtSearch/raima/members.c +++ b/cde/lib/DtSearch/raima/members.c @@ -51,10 +51,11 @@ /* Get number of members of the current set owner */ int -d_members(set, tot , dbn) -int set; /* Set table entry */ -LONG *tot; /* total members of set */ -int dbn; /* database number */ +d_members( +int set, /* Set table entry */ +LONG *tot, /* total members of set */ +int dbn /* database number */ +) { char setp[SETPSIZE]; char *recp; diff --git a/cde/lib/DtSearch/raima/opens.c b/cde/lib/DtSearch/raima/opens.c index 3901d6e0..eba2c5eb 100644 --- a/cde/lib/DtSearch/raima/opens.c +++ b/cde/lib/DtSearch/raima/opens.c @@ -60,9 +60,7 @@ /* Open a binary file for shared access */ -int open_b(filenm, flags) -const char *filenm; -int flags; +int open_b(const char *filenm, int flags) { int desc; diff --git a/cde/lib/DtSearch/raima/options.c b/cde/lib/DtSearch/raima/options.c index b0aa0f41..5b7caa58 100644 --- a/cde/lib/DtSearch/raima/options.c +++ b/cde/lib/DtSearch/raima/options.c @@ -44,8 +44,7 @@ /* Turn on db_VISTA runtime options */ int -d_on_opt(optflag) -int optflag; +d_on_opt(int optflag) { int i; @@ -71,8 +70,7 @@ int optflag; /* Turn off db_VISTA runtime options */ int -d_off_opt(optflag) -int optflag; +d_off_opt(int optflag) { int i; diff --git a/cde/lib/DtSearch/raima/pathfcns.c b/cde/lib/DtSearch/raima/pathfcns.c index 5738bad9..18c5943b 100644 --- a/cde/lib/DtSearch/raima/pathfcns.c +++ b/cde/lib/DtSearch/raima/pathfcns.c @@ -91,14 +91,15 @@ static char * remfile(P1(char *)); /* ====================================================================== Construct the full path to the dictionary. */ -int con_dbd(path_str,dbname,dbdpath) -char *path_str; /* (output) string to receive the full path to the +int con_dbd( +char *path_str, /* (output) string to receive the full path to the dictionary */ -char *dbname; /* contains the filename of the dictionary preceded +char *dbname, /* contains the filename of the dictionary preceded optionally by a path preceded optionally (DOS only) by a drive spec. */ -char *dbdpath; /* contains one element of the environment variable +char *dbdpath /* contains one element of the environment variable DBDPATH. NULL means no DBDPATH defined. */ +) { /* RETURNS: db_status, S_OKAY means no errors @@ -142,11 +143,12 @@ char *dbdpath; /* contains one element of the environment variable /* ====================================================================== Construct full path to data/key files */ -int con_dbf(path_str, dbfile, dbname, dbfpath) -char *path_str; /* (output) receives full path to dictionary */ -char *dbfile; /* path to database file (defn in schema) */ -char *dbname; /* d_open dbname argument - path to dictionary */ -char *dbfpath; /* one element from DBFPATH, or NULL for no path */ +int con_dbf( +char *path_str, /* (output) receives full path to dictionary */ +char *dbfile, /* path to database file (defn in schema) */ +char *dbname, /* d_open dbname argument - path to dictionary */ +char *dbfpath /* one element from DBFPATH, or NULL for no path */ +) { /* RETURNS: db_status, S_OKAY means no error. @@ -190,11 +192,12 @@ char *dbfpath; /* one element from DBFPATH, or NULL for no path */ /* ====================================================================== extracts a single element from DBxPATH type variables */ -char * get_element(dbxpath,num) -char *dbxpath; /* DBxPATH, elements separated by semicolons +char * get_element( +char *dbxpath, /* DBxPATH, elements separated by semicolons NULL causes get_element to return NULL. A NULL string also causes a NULL return */ -int num; /* Element to extract (0 = first) */ +int num /* Element to extract (0 = first) */ +) { /* RETURNS: Pointer to string with element. NULL if no such element @@ -238,8 +241,9 @@ int num; /* Element to extract (0 = first) */ /* ====================================================================== Returns TRUE of path is absolute */ -static int isabs(path_str) -char *path_str; /* path to test, NULL causes iabs to return FALSE */ +static int isabs( +char *path_str /* path to test, NULL causes iabs to return FALSE */ +) { /* RETURNS: TRUE if path is absolute @@ -256,8 +260,9 @@ char *path_str; /* path to test, NULL causes iabs to return FALSE */ /* ====================================================================== Removes drive specifier from path */ -static char * remdrv(path_str) -char *path_str; /* path to remove drive from */ +static char * remdrv( +char *path_str /* path to remove drive from */ +) { /* RETURNS: Pointer to string w/o drive specification. Note that @@ -273,8 +278,9 @@ char *path_str; /* path to remove drive from */ /* ====================================================================== Removes file from a path. */ -static char * remfile(path_str) -char *path_str; /* Path to remove filename from */ +static char * remfile( +char *path_str /* Path to remove filename from */ +) { /* RETURNS: Pointer to the path with the filename removed (a static @@ -297,8 +303,7 @@ char *path_str; /* Path to remove filename from */ /* Set Country Table path */ -int d_ctbpath(ctb) -const char *ctb; +int d_ctbpath(const char *ctb) { int i; diff --git a/cde/lib/DtSearch/raima/proto.h b/cde/lib/DtSearch/raima/proto.h index c633efbf..9a3cfc02 100644 --- a/cde/lib/DtSearch/raima/proto.h +++ b/cde/lib/DtSearch/raima/proto.h @@ -142,176 +142,168 @@ */ /* From dberr.c: */ -void dbautorec(P0); +void dbautorec(void); /* From dblfcns.c: */ -int taskinit(P1(TASK *)); -int initdbt(P1(const char *)); -int alloc_table(P1(CHAR_P *) Pi(unsigned) Pi(unsigned)); +int taskinit(TASK *); +int initdbt(const char *); +int alloc_table(CHAR_P *, unsigned, unsigned); #define ALLOC_TABLE(t, n, o, v) alloc_table((CHAR_P *)(t), n, o) -void termfree(P0); +void termfree(void); /* From dio.c: */ -int dio_open(P1(FILE_NO)); -int dio_close(P1(FILE_NO)); -int dio_init(P0); -void dio_free(P0); -int dio_clrfile(P1(FILE_NO)); -int dio_clear(P0); -int dio_flush(P0); -void dio_setdef(P1(FILE_NO)); -int dio_get(P1(F_ADDR) Pi(char * *) Pi(int)); -int dio_touch(P1(F_ADDR)); -int dio_read(P1(DB_ADDR) Pi(char * *) Pi(int)); -int dio_write(P1(DB_ADDR) Pi(const char *) Pi(int)); -int dio_release(P1(DB_ADDR)); -int dio_rrlb(P1(DB_ADDR) Pi(INT *)); -int dio_wrlb(P1(DB_ADDR) Pi(INT)); -int dio_findpg(P1(FILE_NO) Pi(F_ADDR) Pi(PAGE_ENTRY *) - Pi(PAGE_ENTRY * *) - Pi(LOOKUP_ENTRY * *)); -int dio_out(P1(PAGE_ENTRY *) Pi(LOOKUP_ENTRY *)); -int dio_pzread(P1(FILE_NO)); -int dio_pzalloc(P1(FILE_NO) Pi(F_ADDR *)); -int dio_pzdel(P1(FILE_NO) Pi(F_ADDR)); -F_ADDR dio_pznext(P1(FILE_NO)); -void dio_pzclr(P0); +int dio_open(FILE_NO); +int dio_close(FILE_NO); +int dio_init(void); +void dio_free(void); +int dio_clrfile(FILE_NO); +int dio_clear(void); +int dio_flush(void); +void dio_setdef(FILE_NO); +int dio_get(F_ADDR, char **, int); +int dio_touch(F_ADDR); +int dio_read(DB_ADDR, char **, int); +int dio_write(DB_ADDR, const char *, int); +int dio_release(DB_ADDR); +int dio_rrlb(DB_ADDR, INT *); +int dio_wrlb(DB_ADDR, INT); +int dio_findpg(FILE_NO, F_ADDR, PAGE_ENTRY *, PAGE_ENTRY **, LOOKUP_ENTRY **); +int dio_out(PAGE_ENTRY *, LOOKUP_ENTRY *); +int dio_pzread(FILE_NO); +int dio_pzalloc(FILE_NO, F_ADDR *); +int dio_pzdel(FILE_NO, F_ADDR); +F_ADDR dio_pznext(FILE_NO); +void dio_pzclr(void); /* From initenv.c: */ -int initenv(P0); +int initenv(void); /* From inittab.c: */ -int inittab(P0); +int inittab(void); /* From keyfcns.c: */ -int key_open(P0); -void key_close(P0); -int key_init(P1(int)); -int key_reset(P1(FILE_NO)); -int key_locpos(P1(const char *) Pi(DB_ADDR *)); -int key_scan(P1(int) Pi(DB_ADDR *)); -int key_boundary(P1(int) Pi(DB_ADDR *)); -int key_insert(P1(int) Pi(const char *) Pi(DB_ADDR)); -int key_delete(P1(int) Pi(const char *) Pi(DB_ADDR)); +int key_open(void); +void key_close(void); +int key_init(int); +int key_reset(FILE_NO); +int key_locpos(const char *, DB_ADDR *); +int key_scan(int, DB_ADDR *); +int key_boundary(int, DB_ADDR *); +int key_insert(int, const char *, DB_ADDR); +int key_delete(int, const char *, DB_ADDR); /* Due to a problem with MSC 5.1, we couldn't declare the 2nd parm of key_bldcom as const (see keyfcns.c) */ -int key_bldcom(P1(int) Pi(char *) Pi(char *) Pi(int)); +int key_bldcom(int, char *, char *, int); /* Because of a "problem" with the MSC 5.1 compiler, we couldn't declare the second argument to key_cmpcpy with a const attribute. Hence we were not able to define the 2nd argument of key_bldcom as const. */ -void key_cmpcpy(P1(char *) Pi(char *) Pi(INT)); +void key_cmpcpy(char *, char *, INT); /* From libfcns.c: */ -int dbn_check(P1(int)); -int nset_check(P1(int) Pi(int *) Pi(SET_ENTRY * *)); -int nfld_check(P1(long) Pi(int *) Pi(int *) - Pi(RECORD_ENTRY * *) - Pi(FIELD_ENTRY * *)); -int nrec_check(P1(int) Pi(int *) Pi(RECORD_ENTRY * *)); -int fldcmp(P1(FIELD_ENTRY *) Pi(const char *) - Pi(const char *)); -int INTcmp(P1(const char *) Pi(const char *)); -int ADDRcmp(P1(const DB_ADDR *) Pi(const DB_ADDR *)); -int null_dba(P1(const char *)); -int check_dba(P1(DB_ADDR)); +int dbn_check(int); +int nset_check(int, int *, SET_ENTRY **); +int nfld_check(long, int *, int *, RECORD_ENTRY **, FIELD_ENTRY **); +int nrec_check(int, int *, RECORD_ENTRY **); +int fldcmp(FIELD_ENTRY *, const char *, const char *); +int INTcmp(const char *, const char *); +int ADDRcmp(const DB_ADDR *, const DB_ADDR *); +int null_dba(const char *); +int check_dba(DB_ADDR); /* From makenew.c: */ -int sk_free(P0); +int sk_free(void); /* From netwdos.c: */ -int netbios_chk(P0); -int nw_reset(P1(int) Pi(int)); -int nw_addnm(P1(char *) Pi(int *)); -int nw_cleanup(P1(char *)); -int nw_sestat(P0); -int nw_delnm(P1(char *)); -int nw_call(P1(char *) Pi(char *) Pi(int *)); -int nw_hangup(P1(int)); -int nw_send(P1(int) Pi(MESSAGE *) Pi(int)); -int nw_rcvmsg(P1(int) Pi(MESSAGE *) Pi(int) Pi(int *)); +int netbios_chk(void); +int nw_reset(int, int); +int nw_addnm(char *, int *); +int nw_cleanup(char *); +int nw_sestat(void); +int nw_delnm(char *); +int nw_call(char *, char *, int *); +int nw_hangup(int); +int nw_send(int, MESSAGE *, int); +int nw_rcvmsg(int, MESSAGE *, int, int *); /* From opens.c: */ -int open_b(P1(const char *) Pi(int)); +int open_b(const char *, int); /* From ovfcns.c: */ -int o_setup(P0); -int o_init(P0); -int o_fileinit(P1(FILE_NO)); -int o_search(P1(FILE_NO) Pi(F_ADDR) Pi(F_ADDR *)); -int o_write(P1(PAGE_ENTRY *) Pi(LOOKUP_ENTRY *)); -int o_pzwrite(P1(FILE_NO)); -int o_flush(P0); -int o_update(P0); -long o_pages(P1(FILE_NO)); -void o_free(P0); +int o_setup(void); +int o_init(void); +int o_fileinit(FILE_NO); +int o_search(FILE_NO, F_ADDR, F_ADDR *); +int o_write(PAGE_ENTRY *, LOOKUP_ENTRY *); +int o_pzwrite(FILE_NO); +int o_flush(void); +int o_update(void); +long o_pages(FILE_NO); +void o_free(void); /* From recfcns.c: */ -int r_chkfld(P1(INT) Pi(FIELD_ENTRY *) Pi(char *) - Pi(const char *)); -int r_delrec(P1(INT) Pi(DB_ADDR)); -int r_gfld(P1(FIELD_ENTRY *) Pi(char *) Pi(char *)); -int r_gmem(P1(int) Pi(char *) Pi(char *)); -int r_gset(P1(int) Pi(char *) Pi(char *)); -int r_pfld(P1(INT) Pi(FIELD_ENTRY *) Pi(char *) - Pi(const char *) Pi(DB_ADDR *)); -int r_pmem(P1(int) Pi(char *) Pi(char *)); -int r_pset(P1(int) Pi(char *) Pi(char *)); -int r_smem(P1(DB_ADDR *) Pi(INT)); -int r_setopt(P1(FIELD_ENTRY *) Pi(char *)); -int r_clropt(P1(FIELD_ENTRY *) Pi(char *)); -int r_tstopt(P1(FIELD_ENTRY *) Pi(char *)); +int r_chkfld(INT, FIELD_ENTRY *, char *, const char *); +int r_delrec(INT, DB_ADDR); +int r_gfld(FIELD_ENTRY *, char *, char *); +int r_gmem(int, char *, char *); +int r_gset(int, char *, char *); +int r_pfld(INT, FIELD_ENTRY *, char *, const char *, DB_ADDR *); +int r_pmem(int, char *, char *); +int r_pset(int, char *, char *); +int r_smem(DB_ADDR *, INT); +int r_setopt(FIELD_ENTRY *, char *); +int r_clropt(FIELD_ENTRY *, char *); +int r_tstopt(FIELD_ENTRY *, char *); /* From pathfcns.c */ -int con_dbd(P1(char *) Pi(char *) Pi(char *)); -int con_dbf(P1(char *) Pi(char *) Pi(char *) - Pi(char *)); -char * get_element(P1(char *) Pi(int)); +int con_dbd(char *, char *, char *); +int con_dbf(char *, char *, char *, char *); +char * get_element(char *, int); /* From renfile.c: */ -int renfiles(P0); +int renfiles(void); /* From startup.c: */ int startup(DBN_FIX_D1 TASK_PTR_Di LOCK_Di); /* From taffcns.c: */ -int taf_open(P0); -int taf_close(P0); -int taf_access(P0); -int taf_release(P0); -int taf_add(P1(const char *)); -int taf_del(P1(const char *) ); +int taf_open(void); +int taf_close(void); +int taf_access(void); +int taf_release(void); +int taf_add(const char *); +int taf_del(const char *); /* From mapchar.c */ -int ctb_init(P0); -int ctbl_alloc(P0); -void ctbl_free(P0); +int ctb_init(void); +int ctbl_alloc(void); +void ctbl_free(void); /* System functions */ #ifndef _STRING_H #ifndef linux - void CDECL memcpy(P1(char *) Pi(char *) Pi(int)); + void CDECL memcpy(char *, char *, int); #endif - int CDECL memcmp(P1(char *) Pi(char *) Pi(int)); - void CDECL memset(P1(char *) Pi(char) Pi(int)); + int CDECL memcmp(char *, char *, int); + void CDECL memset(char *, char, int); - int CDECL strcmp(P1(const char *) Pi(const char *)); - char * CDECL strcpy(P1(char *) Pi(const char *)); - char * CDECL strcat(P1(char *) Pi(const char *)); - int CDECL strlen(P1(const char *)); - int CDECL strncmp(P1(const char *) Pi(const char *) Pi(int)); - char * CDECL strncpy(P1(char *) Pi(const char *) Pi(int)); - char * CDECL strchr(P1(const char *) Pi(int)); - char * CDECL strrchr(P1(const char *) Pi(int)); + int CDECL strcmp(const char *, const char *); + char * CDECL strcpy(char *, const char *); + char * CDECL strcat(char *, const char *); + int CDECL strlen(const char *); + int CDECL strncmp(const char *, const char *, int); + char * CDECL strncpy(char *, const char *, int); + char * CDECL strchr(const char *, int); + char * CDECL strrchr(const char *, int); #endif -void CDECL free(P1(void *)); /* AIXV3 - DPG 07/05/90 */ -time_t CDECL time(P1(long *)); -int CDECL write(P1(int) Pi(char *) Pi(unsigned int)); -int CDECL read(P1(int) Pi(char *) Pi(unsigned int)); -long CDECL lseek(P1(int) Pi(long) Pi(int)); -int CDECL close(P1(int)); -void CDECL exit(P1(int)); -char * CDECL getenv(P1(const char *)); -int CDECL locking(P1(int) Pi(int) Pi(long)); -int CDECL unlink(P1(const char *)); +void CDECL free(void *); /* AIXV3 - DPG 07/05/90 */ +time_t CDECL time(long *); +int CDECL write(int, char *, unsigned int); +int CDECL read(int, char *, unsigned int); +long CDECL lseek(int, long, int); +int CDECL close(int); +void CDECL exit(int); +char * CDECL getenv(const char *); +int CDECL locking(int, int, long); +int CDECL unlink(const char *); /* vpp -nOS2 -dUNIX -nBSD -nVANILLA_BSD -nVMS -nMEMLOCK -nWINDOWS -nFAR_ALLOC -f/usr/users/master/config/nonwin proto.h */ diff --git a/cde/lib/DtSearch/raima/recfcns.c b/cde/lib/DtSearch/raima/recfcns.c index 8d6c328c..4c1229ed 100644 --- a/cde/lib/DtSearch/raima/recfcns.c +++ b/cde/lib/DtSearch/raima/recfcns.c @@ -71,11 +71,12 @@ static int struct_key_chk = 1; /* Check a field for permission to change it */ int -r_chkfld(field, fld_ptr, rec, data ) -INT field; /* field_table entry number */ -FIELD_ENTRY *fld_ptr; /* corresponds to field */ -char *rec; /* pointer to record slot */ -const char *data; /* pointer to data area containing field contents */ +r_chkfld( +INT field, /* field_table entry number */ +FIELD_ENTRY *fld_ptr, /* corresponds to field */ +char *rec, /* pointer to record slot */ +const char *data /* pointer to data area containing field contents */ +) { DB_ADDR dba; long fld; @@ -140,9 +141,7 @@ const char *data; /* pointer to data area containing field contents */ /* Delete the current record */ int -r_delrec( rt, db_addr ) -INT rt; -DB_ADDR db_addr; +r_delrec(INT rt, DB_ADDR db_addr) { char *rec; /* ptr to record slot */ char *fptr; /* field data ptr */ @@ -189,10 +188,11 @@ DB_ADDR db_addr; /* Get data field from record */ int -r_gfld(fld_ptr, rec, data ) -FIELD_ENTRY *fld_ptr; -char *rec; /* pointer to record */ -char *data; /* pointer to data area to contain field contents */ +r_gfld( +FIELD_ENTRY *fld_ptr, +char *rec, /* pointer to record */ +char *data /* pointer to data area to contain field contents */ +) { int kt_lc; /* loop control */ INT rn; @@ -232,10 +232,11 @@ char *data; /* pointer to data area to contain field contents */ /* Get member pointer from record */ int -r_gmem(set, rec, mem_addr ) -int set; /* set table entry number */ -char *rec; /* pointer to record */ -char *mem_addr; /* pointer to member pointer */ +r_gmem( +int set, /* set table entry number */ +char *rec, /* pointer to record */ +char *mem_addr /* pointer to member pointer */ +) { INT rt; int mem, memtot; @@ -264,10 +265,11 @@ char *mem_addr; /* pointer to member pointer */ /* Get set pointer from record */ int -r_gset(set, rec, setptr ) -int set; /* set table entry number */ -char *rec; /* pointer to record */ -char *setptr; /* pointer to set pointer */ +r_gset( +int set, /* set table entry number */ +char *rec, /* pointer to record */ +char *setptr /* pointer to set pointer */ +) { INT rt; int len; @@ -287,12 +289,13 @@ char *setptr; /* pointer to set pointer */ /* Put data field into record */ int -r_pfld(field, fld_ptr, rec, data, db_addr ) -INT field; /* field_table entry number */ -FIELD_ENTRY *fld_ptr; /* corresponds to field */ -char *rec; /* pointer to existing record */ -const char *data; /* pointer to data area containing new field contents */ -DB_ADDR *db_addr; +r_pfld( +INT field, /* field_table entry number */ +FIELD_ENTRY *fld_ptr, /* corresponds to field */ +char *rec, /* pointer to existing record */ +const char *data, /* pointer to data area containing new field contents */ +DB_ADDR *db_addr +) { DB_ADDR mdba, odba, dba; int set, sn; @@ -411,10 +414,11 @@ DB_ADDR *db_addr; /* Put member pointer into record */ int -r_pmem(set, rec, mem_addr ) -int set; /* set table entry number */ -char *rec; /* pointer to record */ -char *mem_addr; /* pointer to member pointer */ +r_pmem( +int set, /* set table entry number */ +char *rec, /* pointer to record */ +char *mem_addr /* pointer to member pointer */ +) { INT rt; int mem, memtot; @@ -443,10 +447,11 @@ char *mem_addr; /* pointer to member pointer */ /* Put set pointer into record */ int -r_pset(set, rec, setptr ) -int set; /* set table entry number */ -char *rec; /* pointer to record */ -char *setptr; /* pointer to set pointer */ +r_pset( +int set, /* set table entry number */ +char *rec, /* pointer to record */ +char *setptr /* pointer to set pointer */ +) { INT rt; int len; @@ -468,9 +473,7 @@ char *setptr; /* pointer to set pointer */ /* Set the current set member from record */ int -r_smem( db_addr, set ) -DB_ADDR *db_addr; -INT set; +r_smem(DB_ADDR *db_addr, INT set) { char mem[MEMPSIZE], *ptr; DB_ADDR dba; @@ -493,9 +496,10 @@ INT set; /* Set the optional key field "stored" bit */ int -r_setopt( fld_ptr, rec ) -FIELD_ENTRY *fld_ptr; /* field table entry of optional key */ -char *rec; /* Pointer to record */ +r_setopt( +FIELD_ENTRY *fld_ptr, /* field table entry of optional key */ +char *rec /* Pointer to record */ +) { int offset; /* offset to the bit map */ int keyndx; /* index into bit map of this key */ @@ -521,9 +525,10 @@ char *rec; /* Pointer to record */ /* Clear the optional key field "stored" bit */ int -r_clropt( fld_ptr, rec ) -FIELD_ENTRY *fld_ptr; /* Field table entry of optional key */ -char *rec; /* Pointer to record */ +r_clropt( +FIELD_ENTRY *fld_ptr, /* Field table entry of optional key */ +char *rec /* Pointer to record */ +) { int offset; /* offset to the bit map */ int keyndx; /* index into bit map of this key */ @@ -549,9 +554,10 @@ char *rec; /* Pointer to record */ /* Test the optional key field "stored" bit */ int -r_tstopt( fld_ptr, rec ) -FIELD_ENTRY *fld_ptr; /* Field table entry of optional key */ -char *rec; /* Pointer to record */ +r_tstopt( +FIELD_ENTRY *fld_ptr, /* Field table entry of optional key */ +char *rec /* Pointer to record */ +) { int offset; /* offset to the bit map */ int keyndx; /* index into bit map of this key */ diff --git a/cde/lib/DtSearch/raima/recfrst.c b/cde/lib/DtSearch/raima/recfrst.c index 361c2f7d..8f8bb12f 100644 --- a/cde/lib/DtSearch/raima/recfrst.c +++ b/cde/lib/DtSearch/raima/recfrst.c @@ -49,9 +49,10 @@ /* Find first record of type */ int -d_recfrst( rec , dbn ) -int rec; /* record type/table entry */ -int dbn; +d_recfrst( +int rec, /* record type/table entry */ +int dbn +) { INT rectype; FILE_NO ftype; diff --git a/cde/lib/DtSearch/raima/reclast.c b/cde/lib/DtSearch/raima/reclast.c index 539f30e0..b05aee1f 100644 --- a/cde/lib/DtSearch/raima/reclast.c +++ b/cde/lib/DtSearch/raima/reclast.c @@ -73,9 +73,10 @@ /* ====================================================================== d_reclast - find last record occurrence in database */ -int d_reclast( rec , dbn ) -int rec; /* record # to find last occurrence of */ -int dbn; /* optional database number */ +int d_reclast( +int rec, /* record # to find last occurrence of */ +int dbn /* optional database number */ +) { /* RETURNS: db_status. Sets current record to last record, if found. diff --git a/cde/lib/DtSearch/raima/recnext.c b/cde/lib/DtSearch/raima/recnext.c index 2fb52404..dc5f7f6c 100644 --- a/cde/lib/DtSearch/raima/recnext.c +++ b/cde/lib/DtSearch/raima/recnext.c @@ -50,8 +50,7 @@ /* Find next record of type */ int -d_recnext(dbn) -int dbn; +d_recnext(int dbn) { INT rectype; FILE_NO fno; diff --git a/cde/lib/DtSearch/raima/recprev.c b/cde/lib/DtSearch/raima/recprev.c index f9057f62..29297638 100644 --- a/cde/lib/DtSearch/raima/recprev.c +++ b/cde/lib/DtSearch/raima/recprev.c @@ -73,8 +73,7 @@ /* ====================================================================== d_recprev - find previous record via database address */ -int d_recprev( dbn ) -int dbn; +int d_recprev(int dbn) { /* RETURNS: db_status. Also sets current record to previous matched record. diff --git a/cde/lib/DtSearch/raima/recread.c b/cde/lib/DtSearch/raima/recread.c index 255f94fb..427a8731 100644 --- a/cde/lib/DtSearch/raima/recread.c +++ b/cde/lib/DtSearch/raima/recread.c @@ -52,9 +52,10 @@ /* Read contents of current record */ int -d_recread(rec , dbn) -char *rec; /* ptr to record area */ -int dbn; +d_recread( +char *rec, /* ptr to record area */ +int dbn +) { INT rt; /* record type */ DB_ADDR dba; diff --git a/cde/lib/DtSearch/raima/recset.c b/cde/lib/DtSearch/raima/recset.c index 4d1c7067..effdeb95 100644 --- a/cde/lib/DtSearch/raima/recset.c +++ b/cde/lib/DtSearch/raima/recset.c @@ -71,9 +71,10 @@ /* ====================================================================== set record type and database address to current */ -int d_recset( rec , dbn ) -int rec; /* record type */ -int dbn; +int d_recset( +int rec, /* record type */ +int dbn +) { /* RETURNS: db_status return code. diff --git a/cde/lib/DtSearch/raima/recwrite.c b/cde/lib/DtSearch/raima/recwrite.c index ec1a1a30..34a092cf 100644 --- a/cde/lib/DtSearch/raima/recwrite.c +++ b/cde/lib/DtSearch/raima/recwrite.c @@ -52,9 +52,10 @@ /* Write contents to current record */ int -d_recwrite(rec , dbn) -const char *rec; /* ptr to record area */ -int dbn; +d_recwrite( +const char *rec, /* ptr to record area */ +int dbn +) { INT rt; /* record type */ char *fptr; /* field data pointer */ diff --git a/cde/lib/DtSearch/raima/renfile.c b/cde/lib/DtSearch/raima/renfile.c index 9f6837a3..d6f75bae 100644 --- a/cde/lib/DtSearch/raima/renfile.c +++ b/cde/lib/DtSearch/raima/renfile.c @@ -47,10 +47,11 @@ /* Rename database file */ int -d_renfile(dbn, fno, fnm) -const char *dbn; /* database containing file to be renamed */ -FILE_NO fno; /* file id number for file to be renamed */ -const char *fnm; /* new file name */ +d_renfile( +const char *dbn, /* database containing file to be renamed */ +FILE_NO fno, /* file id number for file to be renamed */ +const char *fnm /* new file name */ +) { REN_ENTRY_P r; @@ -87,7 +88,7 @@ const char *fnm; /* new file name */ /* Process renamed file table */ int -renfiles() +renfiles(void) { int dbt_lc; /* loop control */ REN_ENTRY_P *rp; diff --git a/cde/lib/DtSearch/raima/rwcurr.c b/cde/lib/DtSearch/raima/rwcurr.c index bc5914d5..07cd84c4 100644 --- a/cde/lib/DtSearch/raima/rwcurr.c +++ b/cde/lib/DtSearch/raima/rwcurr.c @@ -55,9 +55,7 @@ /* Read currency table */ int -d_rdcurr(currbuff, currsize) -DB_ADDR **currbuff; -int *currsize; +d_rdcurr(DB_ADDR **currbuff, int *currsize) { int cs; @@ -70,8 +68,7 @@ int *currsize; RETURN( d_rerdcurr(currbuff) ); } -int d_rerdcurr(currbuff) -DB_ADDR **currbuff; +int d_rerdcurr(DB_ADDR **currbuff) { DB_ADDR *cb_ptr; @@ -89,8 +86,7 @@ DB_ADDR **currbuff; /* Write currency table */ int -d_wrcurr(currbuff) -DB_ADDR *currbuff; +d_wrcurr(DB_ADDR *currbuff) { DB_ADDR *cb_ptr; diff --git a/cde/lib/DtSearch/raima/setdb.c b/cde/lib/DtSearch/raima/setdb.c index 7efef598..291b8ae7 100644 --- a/cde/lib/DtSearch/raima/setdb.c +++ b/cde/lib/DtSearch/raima/setdb.c @@ -52,8 +52,9 @@ /* Set current database */ int -d_setdb(dbn) -int dbn; /* database number */ +d_setdb( +int dbn /* database number */ +) { DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_NOIO)); diff --git a/cde/lib/DtSearch/raima/setmm.c b/cde/lib/DtSearch/raima/setmm.c index b1f2b1a7..258a2188 100644 --- a/cde/lib/DtSearch/raima/setmm.c +++ b/cde/lib/DtSearch/raima/setmm.c @@ -50,10 +50,11 @@ /* Set current member to current member */ int -d_setmm(sett, sets , dbn) -int sett; /* set table entry number of target member */ -int sets; /* set table entry number of source member */ -int dbn; /* database number */ +d_setmm( +int sett, /* set table entry number of target member */ +int sets, /* set table entry number of source member */ +int dbn /* database number */ +) { int cmtype; /* current member type */ int mem; diff --git a/cde/lib/DtSearch/raima/setmo.c b/cde/lib/DtSearch/raima/setmo.c index 29671354..c4ac376b 100644 --- a/cde/lib/DtSearch/raima/setmo.c +++ b/cde/lib/DtSearch/raima/setmo.c @@ -50,10 +50,11 @@ /* Set current member to current owner */ int -d_setmo(setm, seto , dbn) -int setm; /* set table entry number of member */ -int seto; /* set table entry number of owner */ -int dbn; /* database number */ +d_setmo( +int setm, /* set table entry number of member */ +int seto, /* set table entry number of owner */ +int dbn /* database number */ +) { int mem; SET_ENTRY *setm_ptr, *seto_ptr; diff --git a/cde/lib/DtSearch/raima/setmr.c b/cde/lib/DtSearch/raima/setmr.c index a860ff8b..8c85d0ac 100644 --- a/cde/lib/DtSearch/raima/setmr.c +++ b/cde/lib/DtSearch/raima/setmr.c @@ -50,9 +50,10 @@ /* Set current member to current record */ int -d_setmr(set , dbn) -int set; /* set table entry number */ -int dbn; /* database number */ +d_setmr( +int set, /* set table entry number */ +int dbn /* database number */ +) { int crtype; /* current record type */ int mem; diff --git a/cde/lib/DtSearch/raima/setom.c b/cde/lib/DtSearch/raima/setom.c index 0a38c313..f2075b97 100644 --- a/cde/lib/DtSearch/raima/setom.c +++ b/cde/lib/DtSearch/raima/setom.c @@ -51,10 +51,11 @@ /* Set current owner to current member */ int -d_setom(nseto, nsetm , dbn) -int nseto; /* set table entry number of owner */ -int nsetm; /* set table entry number of member */ -int dbn; /* database number */ +d_setom( +int nseto, /* set table entry number of owner */ +int nsetm, /* set table entry number of member */ +int dbn /* database number */ +) { int seto, setm; int cmtype; /* current record type */ diff --git a/cde/lib/DtSearch/raima/setoo.c b/cde/lib/DtSearch/raima/setoo.c index d2ca28e4..5d678983 100644 --- a/cde/lib/DtSearch/raima/setoo.c +++ b/cde/lib/DtSearch/raima/setoo.c @@ -51,10 +51,11 @@ /* Set current owner to current owner */ int -d_setoo(nsett, nsets , dbn) -int nsett; /* set table entry number of target owner */ -int nsets; /* set table entry number of source owner */ -int dbn; /* database number */ +d_setoo( +int nsett, /* set table entry number of target owner */ +int nsets, /* set table entry number of source owner */ +int dbn /* database number */ +) { int sett, sets; SET_ENTRY *sett_ptr, *sets_ptr; diff --git a/cde/lib/DtSearch/raima/setor.c b/cde/lib/DtSearch/raima/setor.c index ce13744b..41d60d84 100644 --- a/cde/lib/DtSearch/raima/setor.c +++ b/cde/lib/DtSearch/raima/setor.c @@ -50,9 +50,10 @@ /* Set current owner to current record */ int -d_setor(nset , dbn) -int nset; /* set number */ -int dbn; /* database number */ +d_setor( +int nset, /* set number */ +int dbn /* database number */ +) { int set; int crtype; /* current record type */ diff --git a/cde/lib/DtSearch/raima/setrm.c b/cde/lib/DtSearch/raima/setrm.c index fccaac32..eb6d21b3 100644 --- a/cde/lib/DtSearch/raima/setrm.c +++ b/cde/lib/DtSearch/raima/setrm.c @@ -50,9 +50,10 @@ /* Set current record to current member */ int -d_setrm(set , dbn) -int set; /* set table entry number */ -int dbn; /* database number */ +d_setrm( +int set, /* set table entry number */ +int dbn /* database number */ +) { SET_ENTRY *set_ptr; diff --git a/cde/lib/DtSearch/raima/setro.c b/cde/lib/DtSearch/raima/setro.c index 9f85e8b2..a25250f2 100644 --- a/cde/lib/DtSearch/raima/setro.c +++ b/cde/lib/DtSearch/raima/setro.c @@ -50,9 +50,10 @@ /* Set current record to current owner */ int -d_setro(set , dbn) -int set; /* set table entry number */ -int dbn; /* database number */ +d_setro( +int set, /* set table entry number */ +int dbn /* database number */ +) { SET_ENTRY *set_ptr; diff --git a/cde/lib/DtSearch/raima/startup.c b/cde/lib/DtSearch/raima/startup.c index c04d1e7c..0d6963a7 100644 --- a/cde/lib/DtSearch/raima/startup.c +++ b/cde/lib/DtSearch/raima/startup.c @@ -46,8 +46,7 @@ /* Called once at the beginning of each external function */ -int startup(DB_ID) -int dbn; +int startup(int dbn) { db_status = S_OKAY; if ( ! db_glob_init ) {