/* 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));
}
/* 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);
/* 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 );
/* 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;
/* 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 );
/* Frees a list
*/
-void ll_free(ll)
-llist *ll;
+void ll_free(llist *ll)
{
LL_P *curr, next, free;
/* Finds the next element and returns its data
*/
-CHAR_P *ll_next(ll)
-llist *ll;
+CHAR_P *ll_next(llist *ll)
{
LL_P *next;
/* Prepends (stacks) item
*/
-int ll_prepend(ll, data)
-llist *ll;
-CHAR_P *data;
+int ll_prepend(llist *ll, CHAR_P *data)
{
LL_P item;
/* 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 )
/* 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;
/* 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 */
/* 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;
/* 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;
/* 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));
/* 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;
/* 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));
/* Get current record type
*/
int
-d_crtype(crtype , dbn)
-int *crtype;
-int dbn;
+d_crtype(
+int *crtype,
+int dbn
+)
{
INT crt;
/* 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;
/* 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;
/* 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;
/* 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;
/* 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;
/* 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;
/* 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;
/* 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;
/* 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;
/* 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;
/* 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 );
/* 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));
/* 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));
/* 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
/* Initialize a task structure
*/
-int taskinit(tsk)
-TASK *tsk;
+int taskinit(TASK *tsk)
{
byteset(tsk, '\0', sizeof(TASK));
tsk->No_of_dbs = 1;
/* Initialize multiple database table entries
*/
int
-initdbt(dbnames )
-const char *dbnames;
+initdbt(const char *dbnames)
{
int dbt_lc; /* loop control */
char dbfile [DtSrFILENMLEN];
/* Close database
*/
int
-d_close()
+d_close(void)
{
int i;
/* Free all allocated memory upon termination
*/
-void termfree()
+void termfree(void)
{
/* free all allocated memory */
}
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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;
/* 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));
/* Set database transaction activity file name/path
*/
-d_dbtaf(taf)
-const char *taf;
+d_dbtaf(const char *taf)
{
char dbtaf[FILENMLEN];
int len;
/* Set Database User Identifier
*/
int
-d_dbuserid(id)
-const char *id;
+d_dbuserid(const char *id)
{
const char *chk_id;
/* 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;
of the database
*/
int
-d_destroy(dbname)
-const char *dbname;
+d_destroy(const char *dbname)
{
int ft_lc; /* loop control */
FILE_ENTRY *file_ptr;
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
/* 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) );
/* 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) );
/* 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;
/* Close a database file
*/
int
-dio_close( fno )
-FILE_NO fno;
+dio_close(FILE_NO fno)
{
FILE_ENTRY *file_ptr;
/* Initialize database I/O
*/
int
-dio_init()
+dio_init(void)
{
CHAR_P Tempbuff;
#define tempbuff Tempbuff.ptr
} /* 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;
/****************************************/
/* Free the memory allocated for pages
*/
-void dio_free()
+void dio_free(void)
{
int pgt_lc; /* loop control */
PAGE_ENTRY *pg_ptr;
/* Clear pages for a single file.
*/
int
-dio_clrfile(fno )
-FILE_NO fno;
+dio_clrfile(FILE_NO fno)
{
return( clear_cache(fno, fno+1) );
}
/* Clear all pages for *all* files from I/O buffer
*/
int
-dio_clear()
+dio_clear(void)
{
return( clear_cache(0, size_ft) );
}
* 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 */
* 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;
/* 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;
}
/* 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;
/* 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;
* 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;
* 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;
/* Release database page hold
*/
int
-dio_release( dba )
-DB_ADDR dba;
+dio_release(DB_ADDR dba)
{
FILE_NO file;
F_ADDR us1, us2;
/* 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 */
* 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 */
/****************************************/
/* 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 */
/* Initialize page zero table
*/
-static int dio_pzinit()
+static int dio_pzinit(void)
{
FILE_NO i;
PGZERO *pgzero_ptr;
/* 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;
/* 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;
* 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;
/* 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;
/****************************************/
/* 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);
/****************************************/
/* Clear page zero cache
*/
-void dio_pzclr()
+void dio_pzclr(void)
{
FILE_NO i;
PGZERO *pgzero_ptr;
/* 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 */
/* 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;
*/
-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 */
/* 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;
/* 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];
/* 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;
/* 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;
/* 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];
/* 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];
/* Database initialization function
*/
int
-d_initialize(dbn)
-int dbn;
+d_initialize(int dbn)
{
FILE_NO fno;
/* 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)
/* Internal function prototypes */
-static int alloc_dict(P0);
-static int initcurr(P0);
+static int alloc_dict(void);
+static int initcurr(void);
/* Initialize database tables
*/
int
-inittab()
+inittab(void)
{
int dbt_lc; /* loop control */
INT i, j;
/* Allocate space for dictionary
*/
-static int alloc_dict()
+static int alloc_dict(void)
{
int old_size;
int new_size;
/* Initialize currency tables
*/
-static int initcurr()
+static int initcurr(void)
{
int dbt_lc; /* loop control */
int rec, i;
/* 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;
/* 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;
/* 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 */
/* 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 */
#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;
/* 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 */
/* Close key field processing
*/
-void key_close()
+void key_close(void)
{
int k;
KEY_INFO *ki_ptr;
/* 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;
/* 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;
/* 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 */
/* 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;
/* 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
/* 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;
/* 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 */
/* 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 */
/* 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;
/* 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;
/* 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;
/* 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;
/* 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;
/* 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;
/* 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;
/* 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;
/* 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
/* 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
/* 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++);
/* 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;
/* 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
/* 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;
/* 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;
/* 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;
/* 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;
/* 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 */
/* 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) );
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)))
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;
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;
/* 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);
/* 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,
/* compare the INT variables
*/
-int INTcmp( i1, i2 )
-const char *i1, *i2;
+int INTcmp(const char *i1, const char *i2)
{
INT 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;
/* check for empty DB_ADDR
*/
int
-null_dba( db_addr )
-const char *db_addr;
+null_dba(const char *db_addr)
{
DB_ADDR dba;
/* check for valid DB_ADDR
*/
int
-check_dba( dba )
-DB_ADDR dba;
+check_dba(DB_ADDR dba)
{
FILE_NO fno;
F_ADDR rno, last;
/* 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;
/* 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;
/* Free the memory allocated for the sk_list
*/
-int sk_free()
+int sk_free(void)
{
SK_P *sk_ptr;
/* 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;
/* 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;
/* read MAP_FILE and make appropriate d_mapchar-calls
*/
-int ctb_init()
+int ctb_init(void)
{
int map_fd;
unsigned char inchar, outchar, subsort;
}
/* 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;
}
/* get one character from the file */
-static int nextc( fd )
-int fd;
+static int nextc(int fd)
{
int n;
/* 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"))
/* Free country table
*/
-void ctbl_free()
+void ctbl_free(void)
{
MEM_UNLOCK( &db_global.country_tbl );
FREE( &db_global.country_tbl );
/* 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;
/* 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;
/* Turn on db_VISTA runtime options
*/
int
-d_on_opt(optflag)
-int optflag;
+d_on_opt(int optflag)
{
int i;
/* Turn off db_VISTA runtime options
*/
int
-d_off_opt(optflag)
-int optflag;
+d_off_opt(int optflag)
{
int i;
/* ======================================================================
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
/* ======================================================================
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.
/* ======================================================================
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
/* ======================================================================
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
/* ======================================================================
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
/* ======================================================================
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
/* Set Country Table path
*/
-int d_ctbpath(ctb)
-const char *ctb;
+int d_ctbpath(const char *ctb)
{
int i;
*/
/* 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 */
/* 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;
/* 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 */
/* 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;
/* 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;
/* 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;
/* 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;
/* 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;
/* 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;
/* 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;
/* 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 */
/* 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 */
/* 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 */
/* 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;
/* ======================================================================
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.
/* Find next record of type
*/
int
-d_recnext(dbn)
-int dbn;
+d_recnext(int dbn)
{
INT rectype;
FILE_NO fno;
/* ======================================================================
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.
/* 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;
/* ======================================================================
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.
/* 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 */
/* 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;
/* Process renamed file table
*/
int
-renfiles()
+renfiles(void)
{
int dbt_lc; /* loop control */
REN_ENTRY_P *rp;
/* Read currency table
*/
int
-d_rdcurr(currbuff, currsize)
-DB_ADDR **currbuff;
-int *currsize;
+d_rdcurr(DB_ADDR **currbuff, int *currsize)
{
int cs;
RETURN( d_rerdcurr(currbuff) );
}
-int d_rerdcurr(currbuff)
-DB_ADDR **currbuff;
+int d_rerdcurr(DB_ADDR **currbuff)
{
DB_ADDR *cb_ptr;
/* Write currency table
*/
int
-d_wrcurr(currbuff)
-DB_ADDR *currbuff;
+d_wrcurr(DB_ADDR *currbuff)
{
DB_ADDR *cb_ptr;
/* 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));
/* 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;
/* 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;
/* 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;
/* 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 */
/* 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;
/* 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 */
/* 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;
/* 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;
/* 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 ) {