/* Allocate and clear i*s bytes of memory
*/
-char FAR * d_calloc(i, s)
+char * d_calloc(i, s)
unsigned i, s;
{
return (I_CALLOC(cp, i, s));
/* Allocate b bytes of memory
*/
-char FAR * d_alloc(b)
+char * d_alloc(b)
unsigned b;
{
return (I_MALLOC(cp, b));
/* Free memory
*/
void d_free(p)
-CHAR_P FAR *p;
+CHAR_P *p;
{
if ((p != NULL) && (p->ptr != NULL)) {
I_FREE(p);
}
-static int NewInit(P1(LL_P FAR *));
+static int NewInit(P1(LL_P *));
/* Resets pointer to current element and checks for an empty list
*/
BOOLEAN ll_access(ll)
-llist FAR *ll;
+llist *ll;
{
ll->curr = NULL;
return( ll->head.ptr != NULL && ll->tail.ptr != NULL );
/* Appends item to list
*/
int ll_append(ll, data)
-llist FAR *ll;
-CHAR_P FAR *data;
+llist *ll;
+CHAR_P *data;
{
LL_P item;
LL_P hold;
if ( ll->head.ptr == NULL ) {
/* Empty list */
ll->head = ll->tail = item;
- ll->curr = (LL_P FAR *)&ll->head;
+ ll->curr = (LL_P *)&ll->head;
CurrLock(ll);
}
else {
CurrUnlock(ll);
- ll->curr = (LL_P FAR *)&ll->tail;
+ ll->curr = (LL_P *)&ll->tail;
CurrLock(ll);
hold = item;
MEM_LOCK(&item);
ll->curr->ptr->next = item;
CurrUnlock(ll);
- ll->curr = (LL_P FAR *)&ll->tail;
+ ll->curr = (LL_P *)&ll->tail;
*ll->curr = hold;
CurrLock(ll);
}
/* Finds the first element of a list and returns its data
*/
-CHAR_P FAR *ll_first(ll)
-llist FAR *ll;
+CHAR_P *ll_first(ll)
+llist *ll;
{
if ( ll->head.ptr == NULL ) {
return( NULL );
}
CurrUnlock(ll);
- ll->curr = (LL_P FAR *)&ll->head;
+ ll->curr = (LL_P *)&ll->head;
CurrLock(ll);
- return( (CHAR_P FAR *)&ll->curr->ptr->data );
+ return( (CHAR_P *)&ll->curr->ptr->data );
}
/* Frees a list
*/
void ll_free(ll)
-llist FAR *ll;
+llist *ll;
{
- LL_P FAR *curr, next, free;
+ LL_P *curr, next, free;
- curr = (LL_P FAR *)&ll->head;
+ curr = (LL_P *)&ll->head;
while ( TRUE ) {
MEM_LOCK(curr);
if ( curr->ptr == NULL )
break;
bytecpy(&next, &curr->ptr->next, sizeof(LL_P));
if ( curr != NULL )
- d_free((CHAR_P FAR *)curr);
+ d_free((CHAR_P *)curr);
bytecpy(&free, &next, sizeof(LL_P));
curr = &free;
}
/* Finds the next element and returns its data
*/
-CHAR_P FAR *ll_next(ll)
-llist FAR *ll;
+CHAR_P *ll_next(ll)
+llist *ll;
{
- LL_P FAR *next;
+ LL_P *next;
if ( ll->curr == NULL ) {
return( ll_first(ll) );
CurrUnlock(ll);
ll->curr = next;
CurrLock(ll);
- return( (CHAR_P FAR *)&ll->curr->ptr->data );
+ return( (CHAR_P *)&ll->curr->ptr->data );
}
/* Prepends (stacks) item
*/
int ll_prepend(ll, data)
-llist FAR *ll;
-CHAR_P FAR *data;
+llist *ll;
+CHAR_P *data;
{
LL_P item;
if ( ll->head.ptr == NULL ) {
/* Empty list */
ll->head = ll->tail = item;
- ll->curr = (LL_P FAR *)&ll->head;
+ ll->curr = (LL_P *)&ll->head;
CurrLock(ll);
}
else {
MEM_LOCK(&item);
item.ptr->next = ll->head;
MEM_UNLOCK(&item);
- ll->curr = (LL_P FAR *)&ll->head;
+ ll->curr = (LL_P *)&ll->head;
*ll->curr = item;
CurrLock(ll);
}
/* Allocates and initializes a new list element
*/
static int NewInit(new)
-LL_P FAR *new;
+LL_P *new;
{
- new->ptr = (ll_elem FAR *)ALLOC(new, sizeof(ll_elem), "new");
+ new->ptr = (ll_elem *)ALLOC(new, sizeof(ll_elem), "new");
if ( new->ptr == NULL )
return( dberr(S_NOMEMORY) );
byteset(new->ptr, '\0', sizeof(ll_elem));
int
d_cmtype(set, cmtype TASK_PARM DBN_PARM)
int set;
-int FAR *cmtype;
+int *cmtype;
TASK_DECL
DBN_DECL
{
- char FAR *mrec;
+ char *mrec;
INT crt;
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
#ifndef SINGLE_USER
int dbopen_sv;
#endif
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY **)&set_ptr) != S_OKAY)
RETURN( db_status );
if ( ! curr_mem[set] )
#endif
/* Read current member */
- dio_read(curr_mem[set], (char FAR * FAR *)&mrec, NOPGHOLD);
+ dio_read(curr_mem[set], (char **)&mrec, NOPGHOLD);
#ifndef SINGLE_USER
dbopen = dbopen_sv;
#endif
#include "dbtype.h"
/* Internal function Prototypes */
-static int sortcmp(P1(SET_ENTRY FAR *) Pi(char FAR *)
- Pi(char FAR *));
+static int sortcmp(P1(SET_ENTRY *) Pi(char *)
+ Pi(char *));
/* set pointer structure definition */
typedef struct {
SET_PTR cosp; /* current owner's set pointer */
MEM_PTR cmmp; /* current member's member pointer */
MEM_PTR nmmp; /* next member's member pointer */
- char FAR *crec; /* ptr to current record contents in cache */
- char FAR *orec; /* ptr to current owner record contents in cache */
- char FAR *mrec; /* ptr to current member record contents in cache */
- char FAR *nrec; /* ptr to next member record contents in cache */
+ char *crec; /* ptr to current record contents in cache */
+ char *orec; /* ptr to current owner record contents in cache */
+ char *mrec; /* ptr to current member record contents in cache */
+ char *nrec; /* ptr to next member record contents in cache */
DB_ADDR mdba; /* db address of current member record */
DB_ADDR ndba; /* db address of next member record */
INT ordering; /* set order control variable */
#ifndef NO_TIMESTAMP
FILE_NO file;
#endif
- SET_ENTRY FAR *set_ptr;
- DB_ADDR FAR *co_ptr;
- DB_ADDR FAR *cm_ptr;
+ SET_ENTRY *set_ptr;
+ DB_ADDR *co_ptr;
+ DB_ADDR *cm_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY **)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current record */
crec = orec = mrec = nrec = NULL;
/* read current record */
- if ( dio_read( curr_rec, (char FAR * FAR *)&crec, PGHOLD ) != S_OKAY )
+ if ( dio_read( curr_rec, (char **)&crec, PGHOLD ) != S_OKAY )
RETURN( db_status );
/* read owner record */
- if ( (stat = dio_read(*co_ptr, (char FAR * FAR *)&orec, PGHOLD)) != S_OKAY ) {
+ if ( (stat = dio_read(*co_ptr, (char **)&orec, PGHOLD)) != S_OKAY ) {
dio_release( curr_rec );
RETURN( stat );
}
/* get copy of current record's member ptr for set */
- if ( (stat = r_gmem(set, crec, (char FAR *)&crmp)) != S_OKAY )
+ if ( (stat = r_gmem(set, crec, (char *)&crmp)) != S_OKAY )
goto quit;
/* ensure record not already connected to set */
goto quit;
}
/* get set pointer from owner */
- if ( r_gset(set, orec, (char FAR *)&cosp) != S_OKAY ) {
+ if ( r_gset(set, orec, (char *)&cosp) != S_OKAY ) {
stat = db_status == S_INVOWN ? dberr(S_SYSERR) : db_status;
goto quit;
}
for (mdba = cosp.first; TRUE; mdba = cmmp.next) {
/* read member record and get member pointer from member
record */
- if (((stat = dio_read(mdba, (char FAR * FAR *)&mrec, NOPGHOLD)) != S_OKAY) ||
- ((stat = r_gmem(set, mrec, (char FAR *)&cmmp)) != S_OKAY))
+ if (((stat = dio_read(mdba, (char * *)&mrec, NOPGHOLD)) != S_OKAY) ||
+ ((stat = r_gmem(set, mrec, (char *)&cmmp)) != S_OKAY))
goto quit;
/* compare sort fields of current record with member record */
member pointer
*/
mdba = cosp.first;
- if (((stat = dio_read(mdba, (char FAR * FAR *)&mrec, PGHOLD)) != S_OKAY) ||
- ((stat = r_gmem(set, mrec, (char FAR *)&cmmp)) != S_OKAY))
+ if (((stat = dio_read(mdba, (char * *)&mrec, PGHOLD)) != S_OKAY) ||
+ ((stat = r_gmem(set, mrec, (char *)&cmmp)) != S_OKAY))
goto quit;
/* set current member's previous, and current owner's first, to
/* read current member record and get member pointer from
current member
*/
- if (((stat = dio_read(mdba, (char FAR * FAR *)&mrec, PGHOLD)) != S_OKAY) ||
- ((stat = r_gmem(set, mrec, (char FAR *)&cmmp)) != S_OKAY))
+ if (((stat = dio_read(mdba, (char * *)&mrec, PGHOLD)) != S_OKAY) ||
+ ((stat = r_gmem(set, mrec, (char *)&cmmp)) != S_OKAY))
goto quit;
/* set current record's next to current member's next */
}
/* read next member record and member pointer from next member */
ndba = crmp.next;
- if (((stat = dio_read(ndba, (char FAR * FAR *)&nrec, PGHOLD)) != S_OKAY) ||
- ((stat = r_gmem(set, nrec, (char FAR *)&nmmp)) != S_OKAY))
+ if (((stat = dio_read(ndba, (char * *)&nrec, PGHOLD)) != S_OKAY) ||
+ ((stat = r_gmem(set, nrec, (char *)&nmmp)) != S_OKAY))
goto quit;
/* set previous pointer in next member to current record */
/* put member pointer back into member record and mark member
record as modified
*/
- if (((stat = r_pmem(set, mrec, (char FAR *)&cmmp)) != S_OKAY) ||
+ if (((stat = r_pmem(set, mrec, (char *)&cmmp)) != S_OKAY) ||
((stat = dio_write(mdba, NULL, PGFREE)) != S_OKAY))
goto quit;
}
/* put member pointer back into next record and mark next record
as modified
*/
- if (((stat = r_pmem(set, nrec, (char FAR *)&nmmp)) != S_OKAY) ||
+ if (((stat = r_pmem(set, nrec, (char *)&nmmp)) != S_OKAY) ||
((stat = dio_write(ndba, NULL, PGFREE)) != S_OKAY))
goto quit;
}
/* put set pointer back into owner record and mark owner record as
modified; put member pointer back into current record mark current
record as modified */
- if (((stat = r_pset(set, orec, (char FAR *)&cosp)) != S_OKAY) ||
+ if (((stat = r_pset(set, orec, (char *)&cosp)) != S_OKAY) ||
((stat = dio_write(*co_ptr, NULL, PGFREE)) != S_OKAY) ||
- ((stat = r_pmem(set, crec, (char FAR *)&crmp)) != S_OKAY) ||
+ ((stat = r_pmem(set, crec, (char *)&crmp)) != S_OKAY) ||
((stat = dio_write(curr_rec, NULL, PGFREE)) != S_OKAY))
goto quit;
/* Compare two sort fields
*/
static int sortcmp(set_ptr, mem1, mem2)
-SET_ENTRY FAR *set_ptr; /* set table entry */
-char FAR *mem1; /* member record 1 */
-char FAR *mem2; /* member record 2 */
+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 FAR *mt1, FAR *mt2;
- MEMBER_ENTRY FAR *mt;
+ MEMBER_ENTRY *mt1, *mt2;
+ MEMBER_ENTRY *mt;
int mem, memtot;
int cmp; /* fldcmp result */
int maxflds;
- SORT_ENTRY FAR *srt1_ptr, FAR *srt2_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ SORT_ENTRY *srt1_ptr, *srt2_ptr;
+ FIELD_ENTRY *fld_ptr;
/* extract record numbers from record header */
bytecpy(&rn1, mem1, sizeof(INT));
int
d_cotype(set, cotype TASK_PARM DBN_PARM)
int set;
-int FAR *cotype;
+int *cotype;
TASK_DECL
DBN_DECL
{
- char FAR *orec;
+ char *orec;
INT crt;
#ifndef SINGLE_USER
int dbopen_sv;
#endif
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
if ( ! curr_own[set] )
#endif
/* Read current owner */
- dio_read(curr_own[set], (char FAR * FAR *)&orec, NOPGHOLD);
+ dio_read(curr_own[set], (char * *)&orec, NOPGHOLD);
#ifndef SINGLE_USER
dbopen = dbopen_sv;
#endif
*/
int
d_crget(dba TASK_PARM DBN_PARM)
-DB_ADDR FAR *dba; /* db address of record to become current */
+DB_ADDR *dba; /* db address of record to become current */
TASK_DECL
DBN_DECL
{
int
d_crread(field, data TASK_PARM DBN_PARM)
long field; /* Field constant */
-char FAR *data; /* Data area to contain field contents */
+char *data; /* Data area to contain field contents */
TASK_DECL
DBN_DECL /* database number */
{
#ifndef SINGLE_USER
int dbopen_sv;
#endif
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
- if (nfld_check(field, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY)
+ if (nfld_check(field, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY)
RETURN( db_status );
/* Make sure we have a current record */
#endif
/* Read current record */
- dio_read( curr_rec, (char FAR * FAR *)&crloc , NOPGHOLD);
+ dio_read( curr_rec, (char * *)&crloc , NOPGHOLD);
#ifndef SINGLE_USER
dbopen = dbopen_sv;
#endif
*/
int
d_crset(dba TASK_PARM DBN_PARM)
-DB_ADDR FAR *dba; /* db address of record to become current */
+DB_ADDR *dba; /* db address of record to become current */
TASK_DECL
DBN_DECL
{
*/
int
d_crtype(crtype TASK_PARM DBN_PARM)
-int FAR *crtype;
+int *crtype;
TASK_DECL
DBN_DECL
{
#endif
/* Read current record */
- dio_read(curr_rec, (char FAR * FAR *)&crloc, NOPGHOLD);
+ dio_read(curr_rec, (char * *)&crloc, NOPGHOLD);
#ifndef SINGLE_USER
dbopen = dbopen_sv;
#endif
int
d_crwrite(field, data TASK_PARM DBN_PARM)
long field; /* field constant */
-char FAR *data; /* data area to contain field contents */
+char *data; /* data area to contain field contents */
TASK_DECL
DBN_DECL /* database number */
{
ULONG timestamp;
#endif
int stat, fld, rec;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nfld_check(field, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY)
+ if (nfld_check(field, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY)
RETURN( db_status );
/* compound keys cannot be updated directly */
RETURN( dberr(S_NOCR) );
/* Read current record */
- if ( dio_read( curr_rec, (char FAR * FAR *)&crloc , PGHOLD) != S_OKAY )
+ if ( dio_read( curr_rec, (char * *)&crloc , PGHOLD) != S_OKAY )
RETURN( db_status );
/* check out the field */
int
d_csmget(set, dba TASK_PARM DBN_PARM)
int set; /* Set table entry */
-DB_ADDR FAR *dba; /* db address of record to become current */
+DB_ADDR *dba; /* db address of record to become current */
TASK_DECL
DBN_DECL /* database number */
{
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_NOIO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
if ( ! (*dba = curr_mem[set]) )
d_csmread(set, field, data TASK_PARM DBN_PARM)
int set; /* Set constant */
long field; /* Field constant */
-char FAR *data; /* Data area to contain field contents */
+char *data; /* Data area to contain field contents */
TASK_DECL
DBN_DECL /* database number */
{
#ifndef SINGLE_USER
int dbopen_sv;
#endif
- char FAR *recp;
- SET_ENTRY FAR *set_ptr;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ char *recp;
+ SET_ENTRY *set_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if ((nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY) ||
- (nfld_check(field, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY))
+ if ((nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY) ||
+ (nfld_check(field, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY))
RETURN( db_status );
/* Make sure we have a current member */
#endif
/* Read current member */
- dio_read( curr_mem[set], (char FAR * FAR *)&recp , NOPGHOLD);
+ dio_read( curr_mem[set], (char * *)&recp , NOPGHOLD);
#ifndef SINGLE_USER
dbopen = dbopen_sv;
#endif
int
d_csmset(set, dba TASK_PARM DBN_PARM)
int set; /* Set table entry */
-DB_ADDR FAR *dba; /* db address of record to become current */
+DB_ADDR *dba; /* db address of record to become current */
TASK_DECL
DBN_DECL /* database number */
{
INT type;
- char FAR *ptr;
- SET_ENTRY FAR *set_ptr;
- MEMBER_ENTRY FAR *mem_ptr;
+ char *ptr;
+ SET_ENTRY *set_ptr;
+ MEMBER_ENTRY *mem_ptr;
int mem, memtot;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
if ( dba == NULL ) {
}
else if ( check_dba(*dba) == S_OKAY ) {
/* get the record type */
- if ( dio_read( *dba, (char FAR * FAR *)&ptr, NOPGHOLD ) ) RETURN( db_status );
+ if ( dio_read( *dba, (char * *)&ptr, NOPGHOLD ) ) RETURN( db_status );
bytecpy( &type, ptr, sizeof(INT) );
type &= ~RLBMASK;
#ifndef ONE_DB
d_csmwrite(set, field, data TASK_PARM DBN_PARM)
int set; /* Set constant */
long field; /* Field constant */
-CONST char FAR *data; /* Data area to contain field contents */
+CONST char *data; /* Data area to contain field contents */
TASK_DECL
DBN_DECL /* database number */
{
ULONG timestamp;
#endif
int stat, fld, rec;
- char FAR *recp;
- SET_ENTRY FAR *set_ptr;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
- DB_ADDR FAR *cm_ptr;
+ char *recp;
+ SET_ENTRY *set_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
+ DB_ADDR *cm_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if ((nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY) ||
- (nfld_check(field, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY))
+ if ((nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY) ||
+ (nfld_check(field, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY))
RETURN( db_status );
/* compound keys cannot be updated directly */
RETURN( dberr(S_NOCM) );
/* Read current member */
- if ( dio_read( *cm_ptr, (char FAR * FAR *)&recp , PGHOLD) != S_OKAY )
+ if ( dio_read( *cm_ptr, (char * *)&recp , PGHOLD) != S_OKAY )
RETURN( db_status );
/* check out the field */
int
d_csoget(set, dba TASK_PARM DBN_PARM)
int set; /* Set table entry */
-DB_ADDR FAR *dba; /* db address of record to become current */
+DB_ADDR *dba; /* db address of record to become current */
TASK_DECL
DBN_DECL /* database number */
{
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_NOIO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
if ( ! (*dba = curr_own[set]) )
d_csoread(set, field, data TASK_PARM DBN_PARM)
int set; /* Set constant */
long field; /* Field constant */
-char FAR *data; /* Data area to contain field contents */
+char *data; /* Data area to contain field contents */
TASK_DECL
DBN_DECL /* database number */
{
#ifndef SINGLE_USER
int dbopen_sv;
#endif
- char FAR *recp;
- SET_ENTRY FAR *set_ptr;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ char *recp;
+ SET_ENTRY *set_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if ((nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY) ||
- (nfld_check(field, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY))
+ if ((nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY) ||
+ (nfld_check(field, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY))
RETURN( db_status );
/* Make sure we have a current owner */
#endif
/* Read current owner */
- dio_read( curr_own[set], (char FAR * FAR *)&recp , NOPGHOLD);
+ dio_read( curr_own[set], (char * *)&recp , NOPGHOLD);
#ifndef SINGLE_USER
dbopen = dbopen_sv;
#endif
int
d_csoset(set, dba TASK_PARM DBN_PARM)
int set; /* Set table entry */
-DB_ADDR FAR *dba; /* db address of record to become current */
+DB_ADDR *dba; /* db address of record to become current */
TASK_DECL
DBN_DECL /* database number */
{
INT type;
- char FAR *ptr;
- SET_ENTRY FAR *set_ptr;
+ char *ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
if ( dba == NULL ) {
}
else if ( check_dba(*dba) == S_OKAY ) {
/* get the record type */
- if ( dio_read( *dba, (char FAR * FAR *)&ptr , NOPGHOLD) ) RETURN( db_status );
+ if ( dio_read( *dba, (char * *)&ptr , NOPGHOLD) ) RETURN( db_status );
bytecpy( &type, ptr, sizeof(INT) );
type &= ~RLBMASK;
#ifndef ONE_DB
d_csowrite(set, field, data TASK_PARM DBN_PARM)
int set; /* Set constant */
long field; /* Field constant */
-CONST char FAR *data; /* Data area to contain field contents */
+CONST char *data; /* Data area to contain field contents */
TASK_DECL
DBN_DECL /* database number */
{
ULONG timestamp;
#endif
int stat, fld, rec;
- char FAR *recp;
- SET_ENTRY FAR *set_ptr;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
- DB_ADDR FAR *co_ptr;
+ char *recp;
+ SET_ENTRY *set_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
+ DB_ADDR *co_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if ((nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY) ||
- (nfld_check(field, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY))
+ if ((nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY) ||
+ (nfld_check(field, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY))
RETURN( db_status );
/* compound keys cannot be updated directly */
RETURN( dberr(S_NOCO) );
/* Read current owner */
- if ( dio_read( *co_ptr, (char FAR * FAR *)&recp , PGHOLD) != S_OKAY )
+ if ( dio_read( *co_ptr, (char * *)&recp , PGHOLD) != S_OKAY )
RETURN( db_status );
/* check out the field */
bytecpy( recp + RECUPTIME, ×tamp, sizeof(LONG));
}
#endif
- dio_write(*co_ptr, (char FAR *)NULL, PGFREE);
+ dio_write(*co_ptr, (char *)NULL, PGFREE);
#ifndef NO_TIMESTAMP
if (( db_status == S_OKAY ) && ( rec_ptr->rt_flags & TIMESTAMPED ))
co_time[set] = timestamp;
*/
d_ctscm(set, timestamp TASK_PARM DBN_PARM)
int set;
-ULONG FAR *timestamp;
+ULONG *timestamp;
TASK_DECL
DBN_DECL
{
INT rec;
- char FAR *rptr;
- SET_ENTRY FAR *set_ptr;
+ char *rptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current member */
RETURN( dberr(S_NOCM) );
/* read current member */
- if ( dio_read( curr_mem[set], (char FAR * FAR *)&rptr , NOPGHOLD) != S_OKAY )
+ if ( dio_read( curr_mem[set], (char * *)&rptr , NOPGHOLD) != S_OKAY )
RETURN( db_status );
/* get record id */
*/
d_ctsco(set, timestamp TASK_PARM DBN_PARM)
int set;
-ULONG FAR *timestamp;
+ULONG *timestamp;
TASK_DECL
DBN_DECL
{
INT rec;
- char FAR *rptr;
- SET_ENTRY FAR *set_ptr;
+ char *rptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current owner */
RETURN( dberr(S_NOCO) );
/* read current owner */
- if ( dio_read( curr_own[set], (char FAR * FAR *)&rptr , NOPGHOLD) != S_OKAY )
+ if ( dio_read( curr_own[set], (char * *)&rptr , NOPGHOLD) != S_OKAY )
RETURN( db_status );
/* get record id */
/* Get creation timestamp of current record
*/
d_ctscr(timestamp TASK_PARM)
-ULONG FAR *timestamp;
+ULONG *timestamp;
TASK_DECL
{
INT rec;
RETURN( dberr(S_NOCR) );
/* read current record */
- if ( dio_read( curr_rec, (char FAR * FAR *)&crloc , NOPGHOLD) != S_OKAY )
+ if ( dio_read( curr_rec, (char * *)&crloc , NOPGHOLD) != S_OKAY )
RETURN( db_status );
/* get record id */
int
d_decode_dba(dba, file, slot)
DB_ADDR dba; /* database address */
-int FAR *file; /* returned file number */
-long FAR *slot; /* returned slot number */
+int *file; /* returned file number */
+long *slot; /* returned slot number */
{
*file = (int)(FILEMASK & (dba >> FILESHIFT));
*slot = ADDRMASK & dba;
d_encode_dba(file, slot, dba)
int file; /* returned file number */
long slot; /* returned slot number */
-DB_ADDR FAR *dba; /* database address */
+DB_ADDR *dba; /* database address */
{
*dba = ((FILEMASK & file) << FILESHIFT) | slot;
return ( db_status = S_OKAY );
*/
int
d_dbdpath(path TASK_PARM)
-CONST char FAR *path;
+CONST char *path;
TASK_DECL
{
DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(LOCK_NONE));
*/
int
d_dbfpath(path TASK_PARM)
-CONST char FAR *path;
+CONST char *path;
TASK_DECL
{
DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(LOCK_NONE));
#endif
#ifdef MULTI_TASK
-DB_TASK Currtask = {POINTER_ASSIGN((TASK FAR *)&db_global), POINTER_ASSIGN((char FAR *)NULL)};
+DB_TASK Currtask = {POINTER_ASSIGN((TASK *)&db_global), POINTER_ASSIGN((char *)NULL)};
#endif
extern CHAR_P Dbpgbuff; /* allocated by dio_init used by o_update */
/* Internal function prototypes */
#ifndef SINGLE_USER
-static void pr_lock_descr(P1(struct lock_descr FAR *) Pi(int)
- Pi(CONST char FAR *));
-static int process_lock(P1(struct lock_descr FAR *) Pi(char));
-static int keep_locks(P1(struct lock_descr FAR *));
-static int free_files(P1(struct lock_descr FAR *));
+static void pr_lock_descr(P1(struct lock_descr *) Pi(int)
+ Pi(CONST char *));
+static int process_lock(P1(struct lock_descr *) Pi(char));
+static int keep_locks(P1(struct lock_descr *));
+static int free_files(P1(struct lock_descr *));
#endif
static int bld_lock_tables(P0);
static int initses(P0);
-static int lock_files(P1(int) Pi(LOCK_REQUEST FAR *));
+static int lock_files(P1(int) Pi(LOCK_REQUEST *));
static int send_lock(P0);
static int send_free(P0);
static void reset_locks(P0);
if ( dbopen == 1 ) {
sto.fcn = L_SETTIME;
sto.secs = secs;
- if ( nw_send(lsn, (MESSAGE FAR *)&sto, sizeof(LM_SETTIME)) )
+ if ( nw_send(lsn, (MESSAGE *)&sto, sizeof(LM_SETTIME)) )
RETURN( neterr() );
db_timeout = secs;
}
*/
int
d_open(dbnames, opentype TASK_PARM)
-CONST char FAR *dbnames;
-CONST char FAR *opentype;
+CONST char *dbnames;
+CONST char *opentype;
TASK_DECL
{
DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(LOCK_ALL));
/* Initialize a task structure
*/
int taskinit(tsk)
-TASK FAR *tsk;
+TASK *tsk;
{
byteset(tsk, '\0', sizeof(TASK));
#ifndef ONE_DB
*/
int
initdbt(dbnames )
-CONST char FAR *dbnames;
+CONST char *dbnames;
{
int dbt_lc; /* loop control */
char dbfile [DtSrFILENMLEN];
- char FAR *ptr;
+ char *ptr;
#ifndef ONE_DB
- CONST char FAR *cp;
+ CONST char *cp;
int i;
#endif
if ( db_lockmgr ) {
/* tell lock manager that we're done */
trend_pkt.fcn = L_RECDONE;
- if ( nw_send(lsn, (MESSAGE FAR *)&trend_pkt, sizeof(LM_TREND)) )
+ if ( nw_send(lsn, (MESSAGE *)&trend_pkt, sizeof(LM_TREND)) )
neterr();
}
#endif
int send_size, recv_size, recvd_sz;
struct stat stbuf;
LM_FILEID *fi_ptr;
- FILE_ENTRY FAR *file_ptr;
- FILE_NO FAR *fref_ptr;
- INT FAR *rcv_fref_ptr;
+ FILE_ENTRY *file_ptr;
+ FILE_NO *fref_ptr;
+ INT *rcv_fref_ptr;
if ( (net_status=nw_addnm(dbuserid, (int *)NULL) ) != N_OKAY )
if ( net_status == N_DUPNAME ) {
#else /* GENERAL */
send_size = sizeof(LM_DBOPEN) + (size_ft-1)*sizeof(LM_FILEID);
#endif /* GENERAL */
- send_pkt = (LM_DBOPEN FAR *)ALLOC(&Send_pkt, send_size, "send_pkt");
+ send_pkt = (LM_DBOPEN *)ALLOC(&Send_pkt, send_size, "send_pkt");
recv_size = sizeof(LR_DBOPEN) + (size_ft-1)*sizeof(INT);
- recv_pkt = (LR_DBOPEN FAR *)ALLOC(&Recv_pkt, recv_size, "recv_pkt");
+ recv_pkt = (LR_DBOPEN *)ALLOC(&Recv_pkt, recv_size, "recv_pkt");
if (send_pkt == NULL || recv_pkt == NULL) {
nw_hangup(lsn);
return(dberr(S_NOMEMORY));
#endif
}
send_open:
- if (nw_send(lsn, (MESSAGE FAR *)send_pkt, send_size) ||
- nw_rcvmsg(lsn, (MESSAGE FAR *)recv_pkt, recv_size, &recvd_sz)) {
+ if (nw_send(lsn, (MESSAGE *)send_pkt, send_size) ||
+ nw_rcvmsg(lsn, (MESSAGE *)recv_pkt, recv_size, &recvd_sz)) {
nw_hangup(lsn);
return(neterr());
}
if ( recv_pkt->status == L_RECOVER ) {
/* perform auto-recovery */
- d_recover( (CONST char FAR *)recv_pkt->logfile CURRTASK_PARM );
+ d_recover( (CONST char *)recv_pkt->logfile CURRTASK_PARM );
/* tell lock mgr we're done */
trend_pkt.fcn = L_RECDONE;
- if ( nw_send(lsn, (MESSAGE FAR *)&trend_pkt, sizeof(LM_TREND)) ) {
+ if ( nw_send(lsn, (MESSAGE *)&trend_pkt, sizeof(LM_TREND)) ) {
nw_hangup(lsn);
return(neterr());
}
int mem, memtot;
FILE_NO i;
FILE_NO fl_cnt;
- struct lock_descr FAR *ld_ptr;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
- SET_ENTRY FAR *set_ptr;
- MEMBER_ENTRY FAR *mem_ptr;
- int FAR *fu_ptr;
- FILE_NO FAR *fl_ptr;
+ struct lock_descr *ld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
+ SET_ENTRY *set_ptr;
+ MEMBER_ENTRY *mem_ptr;
+ int *fu_ptr;
+ FILE_NO *fl_ptr;
unsigned new_size;
unsigned old_size;
int old_keyl_cnt;
ld_ptr->fl_cnt = fl_cnt;
ld_ptr->fl_list.ptr =
/* Macro references must be on one line for some compilers */
- (FILE_NO FAR *)ALLOC(&ld_ptr->fl_list, fl_cnt*sizeof(FILE_NO), db_avname);
+ (FILE_NO *)ALLOC(&ld_ptr->fl_list, fl_cnt*sizeof(FILE_NO), db_avname);
if ( ld_ptr->fl_list.ptr == NULL ) return( dberr(S_NOMEMORY) );
fl_ptr = ld_ptr->fl_list.ptr;
for (i = 0, fu_ptr = file_used; i < size_ft; ++i, ++fu_ptr) {
ld_ptr->fl_cnt = fl_cnt;
ld_ptr->fl_list.ptr =
/* Macro references must be on one line for some compilers */
- (FILE_NO FAR *)ALLOC(&ld_ptr->fl_list, fl_cnt*sizeof(FILE_NO), db_avname);
+ (FILE_NO *)ALLOC(&ld_ptr->fl_list, fl_cnt*sizeof(FILE_NO), db_avname);
if ( ld_ptr->fl_list.ptr == NULL ) return( dberr(S_NOMEMORY) );
fl_ptr = ld_ptr->fl_list.ptr;
for (i = 0, fu_ptr = file_used; i < size_ft; ++i, ++fu_ptr) {
ld_ptr->fl_prev = 'f'; /*[367] init to free */
ld_ptr->fl_kept = FALSE;
ld_ptr->fl_cnt = 1;
- ld_ptr->fl_list.ptr = (FILE_NO FAR *)ALLOC(&ld_ptr->fl_list, ld_ptr->fl_cnt*sizeof(FILE_NO), "fl_list");
+ ld_ptr->fl_list.ptr = (FILE_NO *)ALLOC(&ld_ptr->fl_list, ld_ptr->fl_cnt*sizeof(FILE_NO), "fl_list");
if ( ld_ptr->fl_list.ptr == NULL ) return( dberr(S_NOMEMORY) );
*(ld_ptr->fl_list.ptr) = fld_ptr->fd_keyfile;
FL_LIST_DEACCESS(ld_ptr);
}
lp_size = sizeof(LM_LOCK) + (size_ft-1)*sizeof(LM_LOCKREQ);
fp_size = sizeof(LM_FREE) + (size_ft-1)*sizeof(INT);
- lock_pkt = (LM_LOCK FAR *)ALLOC(&db_global.Lock_pkt, lp_size, "lock_pkt");
- free_pkt = (LM_FREE FAR *)ALLOC(&db_global.Free_pkt, fp_size, "free_pkt");
+ lock_pkt = (LM_LOCK *)ALLOC(&db_global.Lock_pkt, lp_size, "lock_pkt");
+ free_pkt = (LM_FREE *)ALLOC(&db_global.Free_pkt, fp_size, "free_pkt");
if ( !lock_pkt || !free_pkt ) return( dberr(S_NOMEMORY) );
lock_pkt->fcn = L_LOCK;
free_pkt->fcn = L_FREE;
LM_DBCLOSE_P Send_pkt;
int ft_lc; /* loop control */
int send_size;
- FILE_NO FAR *fref_ptr;
- INT FAR *snd_fref_ptr;
+ FILE_NO *fref_ptr;
+ INT *snd_fref_ptr;
if ( session_active ) {
send_size = sizeof(LM_DBCLOSE) + (size_ft-1)*sizeof(INT);
- send_pkt = (LM_DBCLOSE FAR *)ALLOC(&Send_pkt, send_size, "send_pkt");
+ send_pkt = (LM_DBCLOSE *)ALLOC(&Send_pkt, send_size, "send_pkt");
if ( send_pkt == NULL ) return( dberr(S_NOMEMORY) );
send_pkt->fcn = L_DBCLOSE;
send_pkt->nfiles = size_ft;
snd_fref_ptr = send_pkt->frefs;
--ft_lc >= 0; ++fref_ptr, ++snd_fref_ptr)
*snd_fref_ptr = *fref_ptr;
- if ( nw_send(lsn, (MESSAGE FAR *)send_pkt, send_size) )
+ if ( nw_send(lsn, (MESSAGE *)send_pkt, send_size) )
return( neterr() );
nw_hangup(lsn);
{
#ifndef SINGLE_USER
int i;
- struct lock_descr FAR *ld_ptr;
+ struct lock_descr *ld_ptr;
#endif
/* free all allocated memory */
*/
d_reclock(rec, lock_type TASK_PARM DBN_PARM)
int rec;
-char FAR *lock_type;
+char *lock_type;
TASK_DECL
DBN_DECL
{
*/
d_setlock(set, lock_type TASK_PARM DBN_PARM)
int set;
-char FAR *lock_type;
+char *lock_type;
TASK_DECL
DBN_DECL
{
*/
d_keylock(key, lock_type TASK_PARM DBN_PARM)
long key; /* field number of key */
-char FAR *lock_type;
+char *lock_type;
TASK_DECL
DBN_DECL
{
#else
int fld, rec;
LOCK_REQUEST lr;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(LOCK_IO));
- if (nfld_check(key, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY)
+ if (nfld_check(key, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY)
RETURN( db_status );
if (fld_ptr->fd_key == NOKEY)
*/
d_reclstat(rec, lstat TASK_PARM DBN_PARM)
int rec;
-char FAR *lstat;
+char *lstat;
TASK_DECL
DBN_DECL
{
*lstat = 'f';
return( db_status = S_OKAY );
#else
- RECORD_ENTRY FAR *rec_ptr;
+ RECORD_ENTRY *rec_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(LOCK_NOIO));
- if (nrec_check(rec, &rec, (RECORD_ENTRY FAR * FAR *)&rec_ptr) != S_OKAY)
+ if (nrec_check(rec, &rec, (RECORD_ENTRY * *)&rec_ptr) != S_OKAY)
RETURN( db_status );
if ( dbopen >= 2 )
*/
d_setlstat(set, lstat TASK_PARM DBN_PARM)
int set;
-char FAR *lstat;
+char *lstat;
TASK_DECL
DBN_DECL
{
*lstat = 'f';
return (db_status = S_OKAY);
#else
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(LOCK_NOIO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
if ( dbopen >= 2 )
*/
d_keylstat(key, lstat TASK_PARM DBN_PARM)
long key;
-char FAR *lstat;
+char *lstat;
TASK_DECL
DBN_DECL
{
return (db_status = S_OKAY);
#else
int fld, rec;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(LOCK_NOIO));
- if (nfld_check(key, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY)
+ if (nfld_check(key, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY)
RETURN( db_status );
if (fld_ptr->fd_key == NOKEY)
*/
d_lock(count, lrpkt TASK_PARM DBN_PARM)
int count;
-LOCK_REQUEST FAR *lrpkt;
+LOCK_REQUEST *lrpkt;
TASK_DECL
DBN_DECL
{
#else
int item;
int i;
- LOCK_REQUEST FAR *lrpkt_ptr;
- struct lock_descr FAR *ld_ptr;
+ LOCK_REQUEST *lrpkt_ptr;
+ struct lock_descr *ld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(LOCK_IO));
/* Process set/record lock
*/
static process_lock(ld_ptr, type )
-struct lock_descr FAR *ld_ptr;
+struct lock_descr *ld_ptr;
char type;
{
int fl_lc; /* loop control */
int fno;
int i;
- LM_LOCKREQ FAR *lockreq_ptr;
- FILE_NO FAR *fl_ptr, fref;
+ LM_LOCKREQ *lockreq_ptr;
+ FILE_NO *fl_ptr, fref;
db_status = S_OKAY;
ld_ptr->fl_prev = ld_ptr->fl_type;
*/
static lock_files(count, lrpkt )
int count;
-LOCK_REQUEST FAR *lrpkt;
+LOCK_REQUEST *lrpkt;
{
#ifndef SINGLE_USER
int fl_lc; /* loop control */
- struct lock_descr FAR *ld_ptr;
+ struct lock_descr *ld_ptr;
FILE_NO fno;
int item;
int l;
- LOCK_REQUEST FAR *lrpkt_ptr;
- int FAR *appl_ptr, FAR *excl_ptr;
- FILE_NO FAR *fl_ptr;
+ LOCK_REQUEST *lrpkt_ptr;
+ int *appl_ptr, *excl_ptr;
+ FILE_NO *fl_ptr;
lock_reply.status = L_OKAY;
if ( lock_pkt->nfiles == 0 ) goto skip_send;
#ifdef MONITOR
printf("nw_send(lsn,lock_pkt->fcn=%ld,size=%d\n",lock_pkt->fcn,send_size);
#endif
- if ( nw_send(lsn, (MESSAGE FAR *)lock_pkt, send_size) )
+ if ( nw_send(lsn, (MESSAGE *)lock_pkt, send_size) )
return( neterr() );
- if ( nw_rcvmsg(lsn, (MESSAGE FAR *)&lock_reply, sizeof(LR_LOCK), &recv_size) )
+ if ( nw_rcvmsg(lsn, (MESSAGE *)&lock_reply, sizeof(LR_LOCK), &recv_size) )
return( neterr() );
#ifdef MONITOR
printf("nw_rcvmsg(lock_reply.fcn=%ld,lock_reply.status=%d\n",
/* tell lock mgr we're done */
trend_pkt.fcn = L_RECDONE;
- if (nw_send(lsn, (MESSAGE FAR *)&trend_pkt, sizeof(LM_TREND)))
+ if (nw_send(lsn, (MESSAGE *)&trend_pkt, sizeof(LM_TREND)))
return( neterr() );
/* re-issue lock request */
return (db_status = S_OKAY);
#else
int fld, rec;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
- struct lock_descr FAR *ld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
+ struct lock_descr *ld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(LOCK_IO));
- if (nfld_check(key, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY)
+ if (nfld_check(key, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY)
RETURN( db_status );
if ( fld_ptr->fd_key == NOKEY )
/* Setup table to keep locks after transaction end
*/
static keep_locks( ld_ptr )
-struct lock_descr FAR *ld_ptr; /* Lock descriptor */
+struct lock_descr *ld_ptr; /* Lock descriptor */
{
int fl_lc; /* loop control */
- FILE_NO FAR *fl_ptr;
+ FILE_NO *fl_ptr;
/* Mark lock as kept */
ld_ptr->fl_kept = TRUE;
#ifdef SINGLE_USER
return (db_status = S_OKAY);
#else
- RECORD_ENTRY FAR *rec_ptr;
- struct lock_descr FAR *ld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ struct lock_descr *ld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(LOCK_IO));
- if (nrec_check(rec, &rec, (RECORD_ENTRY FAR * FAR *)&rec_ptr) != S_OKAY)
+ if (nrec_check(rec, &rec, (RECORD_ENTRY * *)&rec_ptr) != S_OKAY)
RETURN( db_status );
if ( dbopen >= 2 ) /* exclusive access needs no locks */
#ifdef SINGLE_USER
return (db_status = S_OKAY);
#else
- SET_ENTRY FAR *set_ptr;
- struct lock_descr FAR *ld_ptr;
+ SET_ENTRY *set_ptr;
+ struct lock_descr *ld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(LOCK_IO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
if ( dbopen >= 2 ) /* exclusive access needs no locks */
/* Free read-locked files associated with record or set
*/
static int free_files(ld_ptr)
-struct lock_descr FAR *ld_ptr;
+struct lock_descr *ld_ptr;
{
int fl_lc; /* loop control */
FILE_NO fno;
- LM_LOCKREQ FAR *lockreq_ptr;
- int FAR *appl_ptr;
+ LM_LOCKREQ *lockreq_ptr;
+ int *appl_ptr;
FILE_NO fref;
- FILE_NO FAR *fl_ptr;
+ FILE_NO *fl_ptr;
/* fill free packet */
lock_pkt->nfiles = free_pkt->nfiles = 0;
return (db_status = S_OKAY);
#else
int i;
- FILE_NO FAR *fref_ptr;
- int FAR *appl_ptr;
+ FILE_NO *fref_ptr;
+ int *appl_ptr;
DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(LOCK_IO));
{
int beg, end;
int i;
- struct lock_descr FAR *ld_ptr;
+ struct lock_descr *ld_ptr;
/* reset record lock descriptors */
beg = 0;
if ( send_size > fp_size )
return ( dberr(S_SYSERR) );
- if ( nw_send(lsn, (MESSAGE FAR *)free_pkt, send_size) )
+ if ( nw_send(lsn, (MESSAGE *)free_pkt, send_size) )
return( neterr() );
}
#endif
/* Begin transaction
*/
d_trbegin(tid TASK_PARM)
-CONST char FAR *tid;
+CONST char *tid;
TASK_DECL
{
DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(LOCK_IO));
int ft_lc; /* loop control */
LM_TRCOMMIT trcom_pkt;
LM_TREND trend_pkt;
- LM_LOCKREQ FAR *lockreq_ptr;
- FILE_NO FAR *fref_ptr;
- int FAR *appl_ptr, FAR *keptl_ptr, FAR *excl_ptr;
+ LM_LOCKREQ *lockreq_ptr;
+ FILE_NO *fref_ptr;
+ int *appl_ptr, *keptl_ptr, *excl_ptr;
#endif
DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(LOCK_IO));
#ifndef SINGLE_USER
trcom_pkt.fcn = L_TRCOMMIT;
strcpy(trcom_pkt.logfile, dblog);
- if ( nw_send(lsn, (MESSAGE FAR *)&trcom_pkt, sizeof(LM_TRCOMMIT)) )
+ if ( nw_send(lsn, (MESSAGE *)&trcom_pkt, sizeof(LM_TRCOMMIT)) )
RETURN( neterr() );
#endif
trcommit = TRUE;
}
#ifndef SINGLE_USER
trend_pkt.fcn = L_TREND;
- if ( nw_send(lsn, (MESSAGE FAR *)&trend_pkt, sizeof(LM_TREND)) )
+ if ( nw_send(lsn, (MESSAGE *)&trend_pkt, sizeof(LM_TREND)) )
RETURN( neterr() );
#endif
trcommit = FALSE;
RETURN (db_status = S_OKAY);
#else
int i;
- int FAR *keptl_ptr;
- struct lock_descr FAR *ld_ptr;
+ int *keptl_ptr;
+ struct lock_descr *ld_ptr;
DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(LOCK_IO));
#endif
int alloc_table(Table, new_size, old_size )
-CHAR_P FAR *Table;
+CHAR_P *Table;
#define table Table->ptr
unsigned new_size;
unsigned old_size;
/* Set database log file name/path
*/
d_dblog(log TASK_PARM)
-CONST char FAR *log;
+CONST char *log;
TASK_DECL
{
DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(LOCK_NONE));
/* Set database transaction activity file name/path
*/
d_dbtaf(taf TASK_PARM)
-CONST char FAR *taf;
+CONST char *taf;
TASK_DECL
{
char dbtaf[FILENMLEN];
#define TASK_PARM_DBN task ,
#define TASK_ONLY task
#define TASK_DECL DB_TASK task;
-#define TASK_PTR_DECL DB_TASK FAR *task;
+#define TASK_PTR_DECL DB_TASK *task;
#define TASK_DBN_ONLY task DBN_PARM
#else
#define TASK_PARM /**/
#define DB_WRITE write
#define DB_READ read
-typedef struct {FILE_NO FAR *ptr; LOCK_DESC} FILE_NO_P;
-typedef struct {int FAR *ptr; LOCK_DESC} INT_P;
-typedef struct {struct NODE_PATH_S FAR *ptr; LOCK_DESC} NODE_PATH_P;
+typedef struct {FILE_NO *ptr; LOCK_DESC} FILE_NO_P;
+typedef struct {int *ptr; LOCK_DESC} INT_P;
+typedef struct {struct NODE_PATH_S *ptr; LOCK_DESC} NODE_PATH_P;
#ifndef SINGLE_USER
-typedef struct {struct lock_descr FAR *ptr; LOCK_DESC} LOCK_DESCR_P;
-typedef struct {struct LM_LOCK_S FAR *ptr; LOCK_DESC} LM_LOCK_P;
-typedef struct {struct LM_FREE_S FAR *ptr; LOCK_DESC} LM_FREE_P;
-typedef struct {struct LM_DBOPEN_S FAR *ptr; LOCK_DESC} LM_DBOPEN_P;
-typedef struct {struct LM_DBCLOSE_S FAR *ptr; LOCK_DESC} LM_DBCLOSE_P;
-typedef struct {struct LR_DBOPEN_S FAR *ptr; LOCK_DESC} LR_DBOPEN_P;
+typedef struct {struct lock_descr *ptr; LOCK_DESC} LOCK_DESCR_P;
+typedef struct {struct LM_LOCK_S *ptr; LOCK_DESC} LM_LOCK_P;
+typedef struct {struct LM_FREE_S *ptr; LOCK_DESC} LM_FREE_P;
+typedef struct {struct LM_DBOPEN_S *ptr; LOCK_DESC} LM_DBOPEN_P;
+typedef struct {struct LM_DBCLOSE_S *ptr; LOCK_DESC} LM_DBCLOSE_P;
+typedef struct {struct LR_DBOPEN_S *ptr; LOCK_DESC} LR_DBOPEN_P;
#endif
-typedef struct {struct KEY_INFO_S FAR *ptr; LOCK_DESC} KEY_INFO_P;
-typedef struct {struct ren_entry FAR *ptr; LOCK_DESC} REN_ENTRY_P;
-typedef struct {struct RN_ENTRY_S FAR *ptr; LOCK_DESC} RN_ENTRY_P;
-typedef struct {struct LOOKUP_ENTRY_S FAR *ptr; LOCK_DESC} LOOKUP_ENTRY_P;
-typedef struct {struct page_entry FAR *ptr; LOCK_DESC} PAGE_ENTRY_P;
-typedef struct {struct DB_ENTRY_S FAR *ptr; LOCK_DESC} DB_ENTRY_P;
-typedef struct {struct FILE_ENTRY_S FAR *ptr; LOCK_DESC} FILE_ENTRY_P;
-typedef struct {struct RECORD_ENTRY_S FAR *ptr; LOCK_DESC} RECORD_ENTRY_P;
-typedef struct {struct SET_ENTRY_S FAR *ptr; LOCK_DESC} SET_ENTRY_P;
-typedef struct {struct MEMBER_ENTRY_S FAR *ptr; LOCK_DESC} MEMBER_ENTRY_P;
-typedef struct {struct SORT_ENTRY_S FAR *ptr; LOCK_DESC} SORT_ENTRY_P;
-typedef struct {struct FIELD_ENTRY_S FAR *ptr; LOCK_DESC} FIELD_ENTRY_P;
-typedef struct {struct KEY_ENTRY_S FAR *ptr; LOCK_DESC} KEY_ENTRY_P;
-typedef struct {struct PGZERO_S FAR *ptr; LOCK_DESC} PGZERO_P;
-typedef struct {struct RI_ENTRY_S FAR *ptr; LOCK_DESC} RI_ENTRY_P;
-typedef struct {ULONG FAR *ptr; LOCK_DESC} ULONG_P;
-typedef struct {LONG FAR *ptr; LOCK_DESC} LONG_P;
+typedef struct {struct KEY_INFO_S *ptr; LOCK_DESC} KEY_INFO_P;
+typedef struct {struct ren_entry *ptr; LOCK_DESC} REN_ENTRY_P;
+typedef struct {struct RN_ENTRY_S *ptr; LOCK_DESC} RN_ENTRY_P;
+typedef struct {struct LOOKUP_ENTRY_S *ptr; LOCK_DESC} LOOKUP_ENTRY_P;
+typedef struct {struct page_entry *ptr; LOCK_DESC} PAGE_ENTRY_P;
+typedef struct {struct DB_ENTRY_S *ptr; LOCK_DESC} DB_ENTRY_P;
+typedef struct {struct FILE_ENTRY_S *ptr; LOCK_DESC} FILE_ENTRY_P;
+typedef struct {struct RECORD_ENTRY_S *ptr; LOCK_DESC} RECORD_ENTRY_P;
+typedef struct {struct SET_ENTRY_S *ptr; LOCK_DESC} SET_ENTRY_P;
+typedef struct {struct MEMBER_ENTRY_S *ptr; LOCK_DESC} MEMBER_ENTRY_P;
+typedef struct {struct SORT_ENTRY_S *ptr; LOCK_DESC} SORT_ENTRY_P;
+typedef struct {struct FIELD_ENTRY_S *ptr; LOCK_DESC} FIELD_ENTRY_P;
+typedef struct {struct KEY_ENTRY_S *ptr; LOCK_DESC} KEY_ENTRY_P;
+typedef struct {struct PGZERO_S *ptr; LOCK_DESC} PGZERO_P;
+typedef struct {struct RI_ENTRY_S *ptr; LOCK_DESC} RI_ENTRY_P;
+typedef struct {ULONG *ptr; LOCK_DESC} ULONG_P;
+typedef struct {LONG *ptr; LOCK_DESC} LONG_P;
#ifndef NO_COUNTRY
-typedef struct {struct CNTRY_TBL_S FAR *ptr; LOCK_DESC} CNTRY_TBL_P;
+typedef struct {struct CNTRY_TBL_S *ptr; LOCK_DESC} CNTRY_TBL_P;
#endif
struct sk {
INT sk_fld;
CHAR_P sk_val;
} __SK__;
-typedef struct { struct sk FAR *ptr; LOCK_DESC } SK_P;
+typedef struct { struct sk *ptr; LOCK_DESC } SK_P;
/* node key search path stack entry: one per level per key field */
typedef struct NODE_PATH_S {
#define RETURN(x) return( x )
#define ALLOC(l, b, v) d_alloc(b)
#define CALLOC(l, i, s, v) d_calloc(i, s)
-#define MEM_LOCK(cp) d_memlock((CHAR_P FAR *)(cp))
-#define MEM_UNLOCK(cp) d_memunlock((CHAR_P FAR *)(cp))
-#define FREE(cp) d_free((CHAR_P FAR *)(cp))
+#define MEM_LOCK(cp) d_memlock((CHAR_P *)(cp))
+#define MEM_UNLOCK(cp) d_memunlock((CHAR_P *)(cp))
+#define FREE(cp) d_free((CHAR_P *)(cp))
/* Lock sets are defined in dblfcns.c */
#define LOCK_NONE -1
typedef struct LOOKUP_ENTRY_S {
#ifdef MULTI_TASK
- TASK FAR *task; /* task pointer */
+ TASK *task; /* task pointer */
#endif
FILE_NO file; /* file table entry number (0..size_ft-1) */
F_ADDR pageno; /* database page number */
*/
int
d_dbuserid(id TASK_PARM)
-CONST char FAR *id;
+CONST char *id;
TASK_DECL
{
- CONST char FAR *chk_id;
+ CONST char *chk_id;
DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(LOCK_NONE));
#define old_no_of_dbs 0
#endif
-extern char FAR *crloc; /* location in page buffer of current record */
+extern char *crloc; /* location in page buffer of current record */
typedef struct TASK_S {
/* The following global variables came from dblfcns.c */
INT_P Excl_locks; /* excl_locks = NULL */
INT_P Kept_locks; /* kept_locks = NULL */
#endif
- CONST char FAR *Trans_id; /* trans_id = NULL */
+ CONST char *Trans_id; /* trans_id = NULL */
char Dblog[FILENMLEN]; /* dblog = "" */
#ifndef SINGLE_USER
LOCK_DESCR_P Rec_locks; /* rec_locks = NULL */
INT Page_size;
#ifndef ONE_DB
int Curr_db;
- DB_ENTRY FAR *Curr_db_table;
+ DB_ENTRY *Curr_db_table;
#endif
DB_ADDR Curr_rec; /* current record address */
DB_ADDR_P Curr_own; /* current set owners array */
BOOLEAN Setdb_on;
INT No_of_dbs;
RN_ENTRY_P Rn_table;
- RN_ENTRY FAR *Curr_rn_table;
+ RN_ENTRY *Curr_rn_table;
#else
DB_ADDR rn_dba; /* last computed dba by recfrst/recset/recnext */
INT rn_type; /* last record type supplied to recfrst/recset */
{
int st_lc, mt_lc; /* loop control */
INT i, rt;
- char FAR *ptr;
- SET_ENTRY FAR *set_ptr;
- MEMBER_ENTRY FAR *mem_ptr;
- DB_ADDR FAR *co_ptr, FAR *cm_ptr;
+ char *ptr;
+ SET_ENTRY *set_ptr;
+ MEMBER_ENTRY *mem_ptr;
+ DB_ADDR *co_ptr, *cm_ptr;
#ifndef NO_TIMESTAMP
- ULONG FAR *cots_ptr, FAR *cmts_ptr, FAR *sts_ptr;
+ ULONG *cots_ptr, *cmts_ptr, *sts_ptr;
#endif
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
if ( ! curr_rec ) RETURN( dberr( S_NOCR ) );
/* get the record type of the current record */
- if ( dio_read( curr_rec, (char FAR * FAR *)&ptr , NOPGHOLD) != S_OKAY )
+ if ( dio_read( curr_rec, (char * *)&ptr , NOPGHOLD) != S_OKAY )
RETURN( db_status );
bytecpy( &rt, ptr, sizeof(INT) );
if (rt < 0)
*/
int
d_destroy(dbname TASK_PARM)
-CONST char FAR *dbname;
+CONST char *dbname;
TASK_DECL
{
int ft_lc; /* loop control */
- FILE_ENTRY FAR *file_ptr;
+ FILE_ENTRY *file_ptr;
#ifndef NO_TRANS
int ovfl_save;
#endif
static struct
{
#ifdef MULTI_TASK
- TASK FAR *task;
+ TASK *task;
#endif
FILE_NO file;
F_ADDR pageno;
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 FAR *)
- Pi(PAGE_ENTRY FAR *) Pi(int));
+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);
#ifdef NO_TRANS
-static int dio_in(P1(PAGE_ENTRY FAR *) Pi(LOOKUP_ENTRY FAR *));
+static int dio_in(P1(PAGE_ENTRY *) Pi(LOOKUP_ENTRY *));
#else
-static int dio_in(P1(PAGE_ENTRY FAR *) Pi(LOOKUP_ENTRY FAR *)
+static int dio_in(P1(PAGE_ENTRY *) Pi(LOOKUP_ENTRY *)
Pi(BOOLEAN));
#endif
dio_open( fno )
FILE_NO fno;
{
- FILE_ENTRY FAR *file_ptr, FAR *lru_file_ptr;
- int FAR *uf_ptr;
+ FILE_ENTRY *file_ptr, *lru_file_ptr;
+ int *uf_ptr;
file_ptr = &file_table[fno];
if ( file_ptr->ft_status == CLOSED ) {
dio_close( fno )
FILE_NO fno;
{
- FILE_ENTRY FAR *file_ptr;
+ FILE_ENTRY *file_ptr;
file_ptr = &file_table[fno];
if ( file_ptr->ft_status == OPEN ) {
used_files =
/* Macro references must be on one line for some compilers */
- (int FAR *)ALLOC(&Used_files, (size_ft+1)*sizeof(int), "used_files");
+ (int *)ALLOC(&Used_files, (size_ft+1)*sizeof(int), "used_files");
db_lookup =
/* Macro references must be on one line for some compilers */
- (LOOKUP_ENTRY FAR *)
+ (LOOKUP_ENTRY *)
ALLOC(&Db_lookup, db_pgtab_sz*sizeof(LOOKUP_ENTRY), "db_lookup");
dbpg_table =
/* Macro references must be on one line for some compilers */
- (PAGE_ENTRY FAR *)
+ (PAGE_ENTRY *)
ALLOC(&Dbpg_table, db_pgtab_sz*sizeof(PAGE_ENTRY), "dbpg_table");
#ifdef DEBUG_DIO
if (debugging_dio_init) {
if ( use_ovfl ) {
ix_lookup =
/* Macro references must be on one line for some compilers */
- (LOOKUP_ENTRY FAR *)
+ (LOOKUP_ENTRY *)
ALLOC(&Ix_lookup, ix_pgtab_sz*sizeof(LOOKUP_ENTRY),"ix_lookup");
ixpg_table =
/* Macro references must be on one line for some compilers */
- (PAGE_ENTRY FAR *)
+ (PAGE_ENTRY *)
ALLOC(&Ixpg_table, ix_pgtab_sz*sizeof(PAGE_ENTRY), "ixpg_table");
if ( !ix_lookup || !ixpg_table )
return( dberr(S_NOMEMORY) );
static void cache_init (pg_cnt, lu_ptr, pg_ptr, pgsize)
int pg_cnt;
-LOOKUP_ENTRY FAR * lu_ptr;
-PAGE_ENTRY FAR * pg_ptr;
+LOOKUP_ENTRY * lu_ptr;
+PAGE_ENTRY * pg_ptr;
int pgsize;
{
int pg_no;
void dio_free()
{
int pgt_lc; /* loop control */
- PAGE_ENTRY FAR *pg_ptr;
+ PAGE_ENTRY *pg_ptr;
#ifdef MULTI_TASK
if ( task_count > 1 ) {
FILE_NO s_file; /* start file to be cleared */
FILE_NO e_file; /* end file (+1) to be cleared */
int i;
- LOOKUP_ENTRY FAR *lu_ptr, FAR *lu2_ptr;
+ LOOKUP_ENTRY *lu_ptr, *lu2_ptr;
int pg_slot;
- PAGE_ENTRY FAR *pg_ptr;
- PGZERO FAR *pgzero_ptr;
- FILE_ENTRY FAR *file_ptr;
+ PAGE_ENTRY *pg_ptr;
+ PGZERO *pgzero_ptr;
+ FILE_ENTRY *file_ptr;
#ifndef SINGLE_USER
- int FAR *appl_ptr, FAR *excl_ptr;
+ int *appl_ptr, *excl_ptr;
#endif
#ifndef SINGLE_USER
#ifndef NO_TRANS
int fno;
#endif
- PAGE_ENTRY FAR *pg_ptr;
- LOOKUP_ENTRY FAR *lu_ptr;
+ PAGE_ENTRY *pg_ptr;
+ LOOKUP_ENTRY *lu_ptr;
#ifdef DEBUG_DIO
if (debugging_dio_close) {
int
dio_get( page_no, page_ptr, hold )
F_ADDR page_no;
-char FAR * FAR *page_ptr;
+char * *page_ptr;
int hold;
{
- PAGE_ENTRY FAR *pg_ptr;
+ PAGE_ENTRY *pg_ptr;
#ifndef SINGLE_USER
if ( dbopen == 1 ) {
dio_touch( page_no )
F_ADDR page_no;
{
- PAGE_ENTRY FAR *pg_ptr;
+ PAGE_ENTRY *pg_ptr;
#ifndef NO_TRANS
/* ensure overflow data is initialized when exclusive db access */
int
dio_read( dba, recptr, hold )
DB_ADDR dba;
-char FAR * FAR *recptr;
+char * *recptr;
int hold;
{
FILE_NO file;
int offset;
F_ADDR us1, us2;
- FILE_ENTRY FAR *file_ptr;
- PAGE_ENTRY FAR *pg_ptr;
+ FILE_ENTRY *file_ptr;
+ PAGE_ENTRY *pg_ptr;
file = NUM2INT((FILE_NO)((dba >> FILESHIFT) & FILEMASK), ft_offset);
file_ptr = &file_table[file];
int
dio_write( dba, recptr, release )
DB_ADDR dba;
-CONST char FAR *recptr;
+CONST char *recptr;
int release;
{
FILE_NO file;
F_ADDR us1, us2;
int offset;
- FILE_ENTRY FAR *file_ptr;
- PAGE_ENTRY FAR *pg_ptr;
+ FILE_ENTRY *file_ptr;
+ PAGE_ENTRY *pg_ptr;
file = NUM2INT((FILE_NO)((dba >> FILESHIFT) & FILEMASK), ft_offset);
{
FILE_NO file;
F_ADDR us1, us2;
- PAGE_ENTRY FAR *pg_ptr;
+ PAGE_ENTRY *pg_ptr;
file = NUM2INT((FILE_NO)((dba >> FILESHIFT) & FILEMASK), ft_offset);
us1 = ADDRMASK & dba;
F_ADDR sno; /* slot number */
F_ADDR spp; /* slots per page */
F_ADDR offset; /* lseek address - offset from start of file */
- FILE_ENTRY FAR *file_ptr;
+ FILE_ENTRY *file_ptr;
file = NUM2INT((FILE_NO)((dba >> FILESHIFT) & FILEMASK), ft_offset);
if ( dio_open(file) == S_OKAY ) {
offset = PGHDRSIZE + page*file_ptr->ft_pgsize +
(sno - 1 - (page - 1)*spp)*file_ptr->ft_slsize;
DB_LSEEK(file_ptr->ft_desc, (off_t)offset, 0);
- if ( DB_READ(file_ptr->ft_desc, (char FAR *)rid, sizeof(INT))
+ if ( DB_READ(file_ptr->ft_desc, (char *)rid, sizeof(INT))
!= sizeof(INT) ) {
dberr(S_BADREAD);
}
F_ADDR offset; /* offset from start of page or file */
int clr_in_tx; /* true if called from d_rlbclr in trx */
INT trid; /* [333] working rid */
- FILE_ENTRY FAR *file_ptr;
- PAGE_ENTRY FAR *pg_ptr;
+ FILE_ENTRY *file_ptr;
+ PAGE_ENTRY *pg_ptr;
file = NUM2INT((FILE_NO)((dba >> FILESHIFT) & FILEMASK), ft_offset);
file_ptr = &file_table[file];
/* read rid from disk, and set/clear rlb accordingly */
DB_LSEEK(file_ptr->ft_desc, (off_t)offset, 0);
- if ( DB_READ(file_ptr->ft_desc, (char FAR *)&trid, sizeof(INT))
+ if ( DB_READ(file_ptr->ft_desc, (char *)&trid, sizeof(INT))
!= sizeof(INT) ) {
dberr(S_BADREAD);
}
/* write original rid out with modified rlb */
trid = htons (rid); /* make a copy in trid for byte swap */
DB_LSEEK(file_ptr->ft_desc, (off_t)offset, 0); /* reseek */
- if ( DB_WRITE(file_ptr->ft_desc, (char FAR *)&trid, sizeof(INT)) !=
+ if ( DB_WRITE(file_ptr->ft_desc, (char *)&trid, sizeof(INT)) !=
sizeof(INT) )
dberr(S_BADWRITE);
}
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 FAR *pg_table; /* = dbpg_table, ixpg_table, or NULL */
-PAGE_ENTRY FAR * FAR *xpg_ptr; /* pointer to page table entry for found page */
-LOOKUP_ENTRY FAR * FAR *xlu_ptr;/* pointer to lookup table slot for found page*/
+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*/
{
#ifdef MULTI_TASK
CHAR_P Tempbuff;
#define tempbuff Tempbuff.ptr
#endif
- LOOKUP_ENTRY FAR *lookup; /* = db_lookup or ix_lookup */
+ LOOKUP_ENTRY *lookup; /* = db_lookup or ix_lookup */
int pgtab_sz; /* = db_pgtab_sz or ix_pgtab_sz */
long cmp;
int cnt;
int lu_slot, l, u;
- LOOKUP_ENTRY FAR *lu_ptr, FAR *replu_ptr;
- PAGE_ENTRY FAR *pg_ptr;
+ LOOKUP_ENTRY *lu_ptr, *replu_ptr;
+ PAGE_ENTRY *pg_ptr;
int *lru_ptr;
int pg_slot;
#ifndef NO_TRANS
#else
dio_out(pg_ptr, lu_ptr)
#endif
-PAGE_ENTRY FAR *pg_ptr; /* page table entry to be output */
-LOOKUP_ENTRY FAR *lu_ptr; /* corresponding lookup table entry */
+PAGE_ENTRY *pg_ptr; /* page table entry to be output */
+LOOKUP_ENTRY *lu_ptr; /* corresponding lookup table entry */
#ifndef NO_TRANS
BOOLEAN db_cache; /* TRUE if pg_ptr is in db page cache */
#endif
/* Read in a page to the buffer
*/
static int dio_in(pg_ptr, lu_ptr)
-PAGE_ENTRY FAR *pg_ptr; /* page table entry to be input */
-LOOKUP_ENTRY FAR *lu_ptr; /* corresponding to pg_ptr */
+PAGE_ENTRY *pg_ptr; /* page table entry to be input */
+LOOKUP_ENTRY *lu_ptr; /* corresponding to pg_ptr */
#else
/* Read in a page to the buffer
*/
static int dio_in(pg_ptr, lu_ptr, db_cache )
-PAGE_ENTRY FAR *pg_ptr; /* page table entry to be input */
-LOOKUP_ENTRY FAR *lu_ptr; /* corresponding to pg_ptr */
+PAGE_ENTRY *pg_ptr; /* page table entry to be input */
+LOOKUP_ENTRY *lu_ptr; /* corresponding to pg_ptr */
BOOLEAN db_cache; /* TRUE if pg_ptr in db cache */
#endif
{
int fno; /* file number */
int pgsize; /* page size */
long addr; /* file address */
- PGZERO FAR *pgzero_ptr;
- FILE_ENTRY FAR *file_ptr;
+ PGZERO *pgzero_ptr;
+ FILE_ENTRY *file_ptr;
int r;
file_ptr = &file_table[fno = lu_ptr->file];
FILE_NO fno;
{
ULONG ts;
- PGZERO FAR *pgzero_ptr;
+ PGZERO *pgzero_ptr;
if ( db_tsrecs || db_tssets ) {
pgzero_ptr = &pgzero[fno];
static int dio_pzinit()
{
FILE_NO i;
- PGZERO FAR *pgzero_ptr;
+ PGZERO *pgzero_ptr;
#ifdef DEBUG_DIO
if (debugging_dio_init) {
{
FILE_NO i;
int desc;
- PGZERO FAR *pgzero_ptr;
- FILE_ENTRY FAR *file_ptr;
+ PGZERO *pgzero_ptr;
+ FILE_ENTRY *file_ptr;
LONG align_LONG;
char *cptr;
int j;
}
desc = file_ptr->ft_desc;
DB_LSEEK(desc, (off_t)0L, 0);
- if (DB_WRITE(desc, (char FAR *)pgzero_ptr, PGZEROSZ) != PGZEROSZ)
+ if (DB_WRITE(desc, (char *)pgzero_ptr, PGZEROSZ) != PGZEROSZ)
return( dberr(S_BADWRITE) );
pgzero_ptr->pz_modified = FALSE;
#ifndef NO_TRANS
if ( trlog_flag )
- d_trlog(i, 0, (char FAR *)pgzero_ptr, PGZEROSZ);
+ d_trlog(i, 0, (char *)pgzero_ptr, PGZEROSZ);
#endif
}
#ifdef CLOSE_FILES
dio_pzread(fno)
FILE_NO fno; /* file number */
{
- FILE_ENTRY FAR *file_ptr;
- PGZERO FAR *pgzero_ptr;
+ FILE_ENTRY *file_ptr;
+ PGZERO *pgzero_ptr;
pgzero_ptr = &pgzero[fno];
file_ptr = &file_table[fno];
/* seek to and read page zero */
DB_LSEEK(file_ptr->ft_desc, (off_t)0L, 0);
- if ( DB_READ(file_ptr->ft_desc, (char FAR *)pgzero_ptr, PGZEROSZ)
+ if ( DB_READ(file_ptr->ft_desc, (char *)pgzero_ptr, PGZEROSZ)
!= PGZEROSZ ) {
return( dberr(S_BADREAD) );
}
{
DB_ADDR dba;
F_ADDR pg;
- char FAR *ptr;
- PGZERO FAR *pgzero_ptr;
+ char *ptr;
+ PGZERO *pgzero_ptr;
#ifndef SINGLE_USER
/* check shared access privileges */
}
else {
pg = pgzero_ptr->pz_dchain;
- if ( dio_get( pg, (char FAR * FAR *)&ptr, NOPGHOLD ) != S_OKAY )
+ if ( dio_get( pg, (char * *)&ptr, NOPGHOLD ) != S_OKAY )
return( db_status );
/* Get the first key node on the delete chain.
* (sizeof external timestamp set to 4 bytes)
else {
pg = pgzero_ptr->pz_dchain;
dba = ((NUM2EXT(fno, ft_offset) & FILEMASK) << FILESHIFT) | pg;
- if ( dio_read(dba, (char FAR * FAR *)&ptr, NOPGHOLD) != S_OKAY )
+ if ( dio_read(dba, (char * *)&ptr, NOPGHOLD) != S_OKAY )
return( db_status );
bytecpy(&pgzero_ptr->pz_dchain, ptr+sizeof(INT), sizeof(F_ADDR));
}
{
DB_ADDR dba;
INT recnum;
- char FAR *ptr;
- PGZERO FAR *pgzero_ptr;
+ char *ptr;
+ PGZERO *pgzero_ptr;
#ifndef SINGLE_USER
/* check shared access privileges */
if ( file_table[fno].ft_type == KEY ) {
if ( working_file != fno )
return( dberr(S_NOWORK) );
- if ( dio_get( loc, (char FAR * FAR *)&ptr, PGHOLD ) != S_OKAY )
+ if ( dio_get( loc, (char * *)&ptr, PGHOLD ) != S_OKAY )
return( db_status );
/*********************************************
* Delete chain ptr in key node page is in location
}
else {
dba = ((NUM2EXT(fno, ft_offset) & FILEMASK) << FILESHIFT) | loc;
- if ( dio_read( dba, (char FAR * FAR *)&ptr , NOPGHOLD) != S_OKAY )
+ if ( dio_read( dba, (char * *)&ptr , NOPGHOLD) != S_OKAY )
return( db_status );
bytecpy(&recnum, ptr, sizeof(INT));
recnum = ~recnum; /* indicates deleted record */
void dio_pzclr()
{
FILE_NO i;
- PGZERO FAR *pgzero_ptr;
+ PGZERO *pgzero_ptr;
for (i = 0, pgzero_ptr = pgzero; i < size_ft; i++, pgzero_ptr++) {
if (pgzero_ptr->pz_modified) {
SET_PTR cosp; /* current owner's set pointer */
MEM_PTR cmmp; /* member's member pointer */
MEM_PTR npmp; /* next or previous member's member pointer */
- char FAR *orec; /* ptr to current owner record contents in cache */
- char FAR *mrec = NULL; /* ptr to member record contents in cache */
- char FAR *nprec = NULL; /* ptr to next or prev record contents in cache */
+ char *orec; /* ptr to current owner record contents in cache */
+ char *mrec = NULL; /* ptr to member record contents in cache */
+ char *nprec = NULL; /* ptr to next or prev record contents in cache */
DB_ADDR mdba; /* db address of member record */
DB_ADDR npdba; /* db address of next or previous member */
int set; /* set_table entry */
#ifndef NO_TIMESTAMP
FILE_NO file; /* file containing owner record */
#endif
- SET_ENTRY FAR *set_ptr;
- DB_ADDR FAR *co_ptr, FAR *cm_ptr;
+ SET_ENTRY *set_ptr;
+ DB_ADDR *co_ptr, *cm_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(nset, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(nset, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current owner */
/* read member record */
mdba = *cm_ptr;
- if ( dio_read(mdba, (char FAR * FAR *)&mrec, PGHOLD) != S_OKAY )
+ if ( dio_read(mdba, (char * *)&mrec, PGHOLD) != S_OKAY )
RETURN( db_status );
/* ensure record is connected */
- if ( (stat = r_gmem(set, mrec, (char FAR *)&cmmp)) != S_OKAY )
+ if ( (stat = r_gmem(set, mrec, (char *)&cmmp)) != S_OKAY )
goto quit_b;
if ( cmmp.owner == NULL_DBA ) { /* checks owner pointer */
stat = S_NOTCON;
goto quit_b;
}
/* read owner record */
- if ( (stat = dio_read(*co_ptr, (char FAR * FAR *)&orec, PGHOLD)) != S_OKAY )
+ if ( (stat = dio_read(*co_ptr, (char * *)&orec, PGHOLD)) != S_OKAY )
goto quit_b;
/* get set pointer from owner */
- if ( r_gset(set, orec, (char FAR *)&cosp) != S_OKAY )
+ if ( r_gset(set, orec, (char *)&cosp) != S_OKAY )
goto quit_a;
if ( cmmp.next == NULL_DBA )
else {
/* set next record's prev to current member's prev */
npdba = cmmp.next;
- if ((dio_read(npdba, (char FAR * FAR *)&nprec, NOPGHOLD) != S_OKAY) ||
- (r_gmem(set, nprec, (char FAR *)&npmp) != S_OKAY))
+ if ((dio_read(npdba, (char * *)&nprec, NOPGHOLD) != S_OKAY) ||
+ (r_gmem(set, nprec, (char *)&npmp) != S_OKAY))
goto quit_a;
npmp.prev = cmmp.prev;
- if ((r_pmem(set, nprec, (char FAR *)&npmp) != S_OKAY) ||
+ if ((r_pmem(set, nprec, (char *)&npmp) != S_OKAY) ||
(dio_write(npdba, NULL, NOPGFREE) != S_OKAY))
goto quit_a;
}
else {
/* set previous record's next to current member's next */
npdba = cmmp.prev;
- if ((dio_read(npdba, (char FAR * FAR *)&nprec, NOPGHOLD) != S_OKAY) ||
- (r_gmem(set, nprec, (char FAR *)&npmp) != S_OKAY))
+ if ((dio_read(npdba, (char * *)&nprec, NOPGHOLD) != S_OKAY) ||
+ (r_gmem(set, nprec, (char *)&npmp) != S_OKAY))
goto quit_a;
npmp.next = cmmp.next;
- if ((r_pmem(set, nprec, (char FAR *)&npmp) != S_OKAY) ||
+ if ((r_pmem(set, nprec, (char *)&npmp) != S_OKAY) ||
(dio_write(npdba, NULL, NOPGFREE) != S_OKAY))
goto quit_a;
}
--cosp.total;
/* update owner record's set pointer */
- if ((r_pset(set, orec, (char FAR *)&cosp) != S_OKAY) ||
+ if ((r_pset(set, orec, (char *)&cosp) != S_OKAY) ||
(dio_write(*co_ptr, NULL, PGFREE) != S_OKAY))
RETURN( db_status );
cmmp.owner = cmmp.prev = cmmp.next = NULL_DBA;
/* update member record */
- if ((r_pmem(set, mrec, (char FAR *)&cmmp) != S_OKAY) ||
+ if ((r_pmem(set, mrec, (char *)&cmmp) != S_OKAY) ||
(dio_write(mdba, NULL, PGFREE) != S_OKAY))
RETURN( db_status );
#ifndef NO_TIMESTAMP
int rectype, nset, cset;
int set, mem;
DB_ADDR dba, odba, mdba;
- DB_ADDR FAR *co_ptr, FAR *cm_ptr;
- SET_ENTRY FAR *set_ptr;
- MEMBER_ENTRY FAR *mem_ptr;
+ DB_ADDR *co_ptr, *cm_ptr;
+ SET_ENTRY *set_ptr;
+ MEMBER_ENTRY *mem_ptr;
int memtot;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
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 FAR *) Pi(int));
+int d_trlog(P1(int) Pi(int) Pi(CONST char *) Pi(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 FAR *) Pi(long FAR *));
+int d_decode_dba(P1(DB_ADDR) Pi(int *) Pi(long *));
/* dbacode.c */
-int d_encode_dba(P1(int) Pi(long) Pi(DB_ADDR FAR *));
+int d_encode_dba(P1(int) Pi(long) Pi(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 FAR * d_alloc(P1(unsigned)); /* alloc.c */
-char FAR * d_calloc(P1(unsigned) Pi(unsigned)); /* alloc.c */
-void d_free(P1(CHAR_P FAR *)); /* alloc.c */
+char * d_alloc(P1(unsigned)); /* alloc.c */
+char * d_calloc(P1(unsigned) Pi(unsigned)); /* alloc.c */
+void d_free(P1(CHAR_P *)); /* alloc.c */
#ifndef MULTI_TASK /* MULTI_TASK */
#define dt_opentask(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 FAR *) DBN_Dn); /* cmtype.c */
+int d_cmtype(P1(int) Pi(int *) DBN_Dn); /* cmtype.c */
int d_connect(P1(int) DBN_Dn); /* connect.c */
#ifndef NO_TIMESTAMP /* NO_TIMESTAMP */
int d_costat(P1(int) DBN_Dn); /* costat.c */
#endif /* NO_TIMESTAMP */
-int d_cotype(P1(int) Pi(int FAR *) DBN_Dn); /* cotype.c */
-int d_crget(P1(DB_ADDR FAR *) DBN_Dn); /* crget.c */
-int d_crread(P1(long) Pi(char FAR *) DBN_Dn); /* crread.c */
-int d_crset(P1(DB_ADDR FAR *) DBN_Dn); /* crset.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 */
#ifndef NO_TIMESTAMP /* NO_TIMESTAMP */
int d_crstat(P0); /* crstat.c */
#endif /* NO_TIMESTAMP */
-int d_crtype(P1(int FAR *) DBN_Dn); /* crtype.c */
-int d_crwrite(P1(long) Pi(char FAR *) DBN_Dn); /* crwrite.c */
-int d_csmget(P1(int) Pi(DB_ADDR FAR *) DBN_Dn); /* csmget.c */
-int d_csmread(P1(int) Pi(long) Pi(char FAR *) DBN_Dn);
+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);
/* csmread.c */
-int d_csmset(P1(int) Pi(DB_ADDR FAR *) DBN_Dn); /* csmset.c */
-int d_csmwrite(P1(int) Pi(long) Pi(CONST char FAR *) DBN_Dn);
+int d_csmset(P1(int) Pi(DB_ADDR *) DBN_Dn); /* csmset.c */
+int d_csmwrite(P1(int) Pi(long) Pi(CONST char *) DBN_Dn);
/* csmwrite.c */
-int d_csoget(P1(int) Pi(DB_ADDR FAR *) DBN_Dn); /* csoget.c */
-int d_csoread(P1(int) Pi(long) Pi(char FAR *) DBN_Dn);
+int d_csoget(P1(int) Pi(DB_ADDR *) DBN_Dn); /* csoget.c */
+int d_csoread(P1(int) Pi(long) Pi(char *) DBN_Dn);
/* csoread.c */
-int d_csoset(P1(int) Pi(DB_ADDR FAR *) DBN_Dn); /* csoset.c */
-int d_csowrite(P1(int) Pi(long) Pi(CONST char FAR *) DBN_Dn);
+int d_csoset(P1(int) Pi(DB_ADDR *) DBN_Dn); /* csoset.c */
+int d_csowrite(P1(int) Pi(long) Pi(CONST char *) DBN_Dn);
/* csowrite.c */
#ifndef NO_TIMESTAMP /* NO_TIMESTAMP */
int d_csstat(P1(int) DBN_Dn); /* csstat.c */
-int d_ctscm(P1(int) Pi(ULONG FAR *) DBN_Dn); /* ctscm.c */
-int d_ctsco(P1(int) Pi(ULONG FAR *) DBN_Dn); /* ctsco.c */
-int d_ctscr(P1(ULONG FAR *)); /* ctscr.c */
+int d_ctscm(P1(int) Pi(ULONG *) DBN_Dn); /* ctscm.c */
+int d_ctsco(P1(int) Pi(ULONG *) DBN_Dn); /* ctsco.c */
+int d_ctscr(P1(ULONG *)); /* ctscr.c */
#endif /* NO_TIMESTAMP */
#ifndef NO_COUNTRY
-int d_ctbpath(P1(CONST char FAR *)); /* pathfcns.c */
+int d_ctbpath(P1(CONST char *)); /* pathfcns.c */
#endif /* NO_COUNTRY */
-int d_dbdpath(P1(CONST char FAR *)); /* dbdpath.c */
-int d_dbfpath(P1(CONST char FAR *)); /* dbfpath.c */
-int d_dblog(P1(CONST char FAR *)); /* dblog.c */
-int d_dbtaf(P1(CONST char FAR *)); /* dbtaf.c */
-int d_dbuserid(P1(CONST char FAR *)); /* dbuserid.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 FAR *)); /* destroy.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 FAR *) DBN_Dn); /* fillnew.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_findpm(P1(int) DBN_Dn); /* findpm.c */
int d_freeall(P0); /* dblfcns.c */
#ifndef NO_TIMESTAMP /* NO_TIMESTAMP */
-int d_gtscm(P1(int) Pi(ULONG FAR *) DBN_Dn); /* gtscm.c */
-int d_gtsco(P1(int) Pi(ULONG FAR *) DBN_Dn); /* gtsco.c */
-int d_gtscr(P1(ULONG FAR *)); /* gtscr.c */
-int d_gtscs(P1(int) Pi(ULONG FAR *) DBN_Dn); /* gtscs.c */
+int d_gtscm(P1(int) Pi(ULONG *) DBN_Dn); /* gtscm.c */
+int d_gtsco(P1(int) Pi(ULONG *) DBN_Dn); /* gtsco.c */
+int d_gtscr(P1(ULONG *)); /* gtscr.c */
+int d_gtscs(P1(int) Pi(ULONG *) DBN_Dn); /* gtscs.c */
#endif /* NO_TIMESTAMP */
int d_initialize(DBN_D1); /* initial.c */
int d_initfile(P1(FILE_NO) DBN_Dn); /* initial.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 FAR *) DBN_Dn);
+int d_keyfind(P1(long) Pi(CONST char *) DBN_Dn);
/* 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 FAR *) DBN_Dn); /* dblfcns.c */
-int d_keylstat(P1(long) Pi(char FAR *) DBN_Dn); /* dblfcns.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 FAR *)); /* keyfcns.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 FAR *) DBN_Dn); /* dblfcns.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 FAR *) Pi(unsigned char)); /* mapchar.c */
-int d_members(P1(int) Pi(LONG FAR *) DBN_Dn); /* members.c */
+ 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 FAR *) Pi(CONST char FAR *));
+int d_open(P1(CONST char *) Pi(CONST char *));
/* dblfcns.c */
-int d_rerdcurr(P1(DB_ADDR FAR **)); /* rwcurr.c */
-int d_rdcurr(P1(DB_ADDR FAR **) Pi(int FAR *)); /* rwcurr.c */
-int d_wrcurr(P1(DB_ADDR FAR *)); /* rwcurr.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 FAR *) DBN_Dn); /* dblfcns.c */
-int d_reclstat(P1(int) Pi(char FAR *) DBN_Dn); /* dblfcns.c */
-int d_recover(P1(CONST char FAR *)); /* recover.c */
-int d_recread(P1(char FAR *) DBN_Dn); /* recread.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 */
#ifndef NO_TIMESTAMP /* NO_TIMESTAMP */
int d_recstat(P1(DB_ADDR) Pi(ULONG)); /* recstat.c */
#endif /* NO_TIMESTAMP */
-int d_recwrite(P1(CONST char FAR *) DBN_Dn); /* recwrite.c */
-int d_renfile(P1(CONST char FAR *) Pi(FILE_NO)
- Pi(CONST char FAR *)); /* renfile.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_setdb(P1(int)); /* setdb.c */
#endif /* ONE_DB */
int d_setfree(P1(int) DBN_Dn); /* dblfcns.c */
-int d_setkey(P1(long) Pi(CONST char FAR *) DBN_Dn); /* makenew.c */
-int d_setlock(P1(int) Pi(char FAR *) DBN_Dn); /* dblfcns.c */
-int d_setlstat(P1(int) Pi(char FAR *) 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 */
#endif /* NO_TIMESTAMP */
int d_timeout(P1(int)); /* dblfcns.c */
int d_trabort(P0); /* dblfcns.c */
-int d_trbegin(P1(CONST char FAR *)); /* dblfcns.c */
+int d_trbegin(P1(CONST char *)); /* dblfcns.c */
int d_trend(P0); /* dblfcns.c */
#ifndef NO_TIMESTAMP /* NO_TIMESTAMP */
-int d_utscm(P1(int) Pi(ULONG FAR *) DBN_Dn); /* utscm.c */
-int d_utsco(P1(int) Pi(ULONG FAR *) DBN_Dn); /* utsco.c */
-int d_utscr(P1(ULONG FAR *)); /* utscr.c */
-int d_utscs(P1(int) Pi(ULONG FAR *) DBN_Dn); /* utscs.c */
+int d_utscm(P1(int) Pi(ULONG *) DBN_Dn); /* utscm.c */
+int d_utsco(P1(int) Pi(ULONG *) DBN_Dn); /* utsco.c */
+int d_utscr(P1(ULONG *)); /* utscr.c */
+int d_utscs(P1(int) Pi(ULONG *) DBN_Dn); /* utscs.c */
#endif /* NO_TIMESTAMP */
#endif /* MULTI_TASK */
int
d_fillnew( nrec, recval TASK_PARM DBN_PARM )
int nrec; /* record number */
-CONST char FAR *recval; /* record value */
+CONST char *recval; /* record value */
TASK_DECL
DBN_DECL /* database number */
{
INT recnum, stat;
FILE_NO file;
F_ADDR rec_addr;
- char FAR *ptr;
+ char *ptr;
char key[256];
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
int fld, fldtot;
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
- if (nrec_check(nrec, &nrec, (RECORD_ENTRY FAR * FAR *)&rec_ptr) != S_OKAY)
+ if (nrec_check(nrec, &nrec, (RECORD_ENTRY * *)&rec_ptr) != S_OKAY)
RETURN( db_status );
recnum = NUM2EXT(nrec, rt_offset);
++fld, ++fld_ptr) {
if ((fld_ptr->fd_key == UNIQUE) && !(fld_ptr->fd_flags & OPTKEYMASK)) {
if (fld_ptr->fd_type != COMKEY)
- ptr = (char FAR *)recval + fld_ptr->fd_ptr - rec_ptr->rt_data;
+ ptr = (char *)recval + fld_ptr->fd_ptr - rec_ptr->rt_data;
else
- key_bldcom(fld, (char FAR *)recval, ptr = key, FALSE); /* Don't complement */
+ key_bldcom(fld, (char *)recval, ptr = key, FALSE); /* Don't complement */
d_keyfind(FLDMARK*(long)recnum + (fld - rec_ptr->rt_fields), ptr
TASK_PARM DBN_PARM);
curr_rec = db_addr;
db_addr |= rec_addr;
/* read record */
- if (dio_read(db_addr, (char FAR * FAR *)&ptr, PGHOLD) != S_OKAY)
+ if (dio_read(db_addr, (char * *)&ptr, PGHOLD) != S_OKAY)
RETURN( db_status );
/* zero fill the record */
++fld, ++fld_ptr) {
if ((fld_ptr->fd_key != 'n') && !(fld_ptr->fd_flags & OPTKEYMASK)) {
if ( fld_ptr->fd_type != COMKEY )
- ptr = (char FAR *)recval + fld_ptr->fd_ptr - rec_ptr->rt_data;
+ ptr = (char *)recval + fld_ptr->fd_ptr - rec_ptr->rt_data;
else
- key_bldcom(fld, (char FAR *)recval, ptr = key, TRUE);
+ key_bldcom(fld, (char *)recval, ptr = key, TRUE);
if ((stat = key_insert(fld, ptr, db_addr)) != S_OKAY) {
r_delrec( nrec, db_addr );
dio_write(db_addr, NULL, PGFREE);
int set;
char mem[MEMPSIZE];
DB_ADDR own;
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(nset, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(nset, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* Make sure we have a current record */
RETURN( dberr(S_NOCR) );
/* Read current record */
- if ( dio_read(curr_rec, (char FAR * FAR *)&crloc, NOPGHOLD) != S_OKAY )
+ if ( dio_read(curr_rec, (char * *)&crloc, NOPGHOLD) != S_OKAY )
RETURN( db_status );
/* Get the member ptr for this set */
{
char setp[SETPSIZE];
DB_ADDR mem;
- char FAR *recp;
+ char *recp;
int set;
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(nset, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(nset, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current owner */
RETURN( dberr(S_NOCO) );
/* read current owner of set */
- if ( dio_read(curr_own[set], (char FAR * FAR *)&recp, NOPGHOLD) != S_OKAY )
+ if ( dio_read(curr_own[set], (char * *)&recp, NOPGHOLD) != S_OKAY )
RETURN( db_status );
/* get set pointer from record */
{
char setp[SETPSIZE];
DB_ADDR mem;
- char FAR *recp;
+ char *recp;
int set;
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(nset, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(nset, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current owner */
RETURN( dberr(S_NOCO) );
/* read current owner of set */
- if ( dio_read(curr_own[set], (char FAR * FAR *)&recp, NOPGHOLD) != S_OKAY )
+ if ( dio_read(curr_own[set], (char * *)&recp, NOPGHOLD) != S_OKAY )
RETURN( db_status );
/* get set pointer from record */
int set;
char memp[MEMPSIZE];
DB_ADDR mem;
- char FAR *recp;
- DB_ADDR FAR *cm_ptr;
- SET_ENTRY FAR *set_ptr;
+ char *recp;
+ DB_ADDR *cm_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(nset, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(nset, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current owner */
RETURN( d_findfm(nset TASK_PARM DBN_PARM) );
/* read current member of set and get member pointer from record */
- if ((dio_read(*cm_ptr, (char FAR * FAR *)&recp, NOPGHOLD) != S_OKAY) ||
+ if ((dio_read(*cm_ptr, (char * *)&recp, NOPGHOLD) != S_OKAY) ||
(r_gmem(set, recp, memp) != S_OKAY))
RETURN( db_status );
int set;
char memp[MEMPSIZE];
DB_ADDR mem;
- char FAR *recp;
- DB_ADDR FAR *cm_ptr;
- SET_ENTRY FAR *set_ptr;
+ char *recp;
+ DB_ADDR *cm_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(nset, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(nset, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current owner */
RETURN( d_findlm(nset TASK_PARM DBN_PARM) );
/* read current member of set and get member pointer from record */
- if ((dio_read(*cm_ptr, (char FAR * FAR *)&recp, NOPGHOLD) != S_OKAY) ||
+ if ((dio_read(*cm_ptr, (char * *)&recp, NOPGHOLD) != S_OKAY) ||
(r_gmem(set, recp, memp) != S_OKAY))
RETURN( db_status );
*/
d_gtscm(set, timestamp TASK_PARM DBN_PARM)
int set;
-ULONG FAR *timestamp;
+ULONG *timestamp;
TASK_DECL
DBN_DECL
{
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_NOIO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current member */
*/
d_gtsco(set, timestamp TASK_PARM DBN_PARM)
int set;
-ULONG FAR *timestamp;
+ULONG *timestamp;
TASK_DECL
DBN_DECL
{
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_NOIO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current owner */
/* Get timestamp of current record
*/
d_gtscr(timestamp TASK_PARM)
-ULONG FAR *timestamp;
+ULONG *timestamp;
TASK_DECL
{
DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(RECORD_NOIO));
*/
d_gtscs(set, timestamp TASK_PARM DBN_PARM)
int set;
-ULONG FAR *timestamp;
+ULONG *timestamp;
TASK_DECL
DBN_DECL
{
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_NOIO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current owner */
} pg1;
} INIT_PAGE;
-typedef struct {union INIT_PAGE_U FAR *ptr; LOCK_DESC} INIT_PAGE_P;
+typedef struct {union INIT_PAGE_U *ptr; LOCK_DESC} INIT_PAGE_P;
static char nulls[5] = "\0\0\0\0";
static int dbfile;
F_ADDR addr;
ULONG ts;
INT rno, rec;
- FILE_ENTRY FAR *file_ptr;
- RECORD_ENTRY FAR *rec_ptr;
+ FILE_ENTRY *file_ptr;
+ RECORD_ENTRY *rec_ptr;
time_t local_timestamp;
LONG extern_timestamp;
if ((dbfile = DB_OPEN(file_ptr->ft_name, O_RDWR | O_CREAT | O_TRUNC)) < 0)
RETURN( dberr(S_NOFILE) );
- page = (INIT_PAGE FAR *)ALLOC(&Page, file_ptr->ft_pgsize, "page");
+ page = (INIT_PAGE *)ALLOC(&Page, file_ptr->ft_pgsize, "page");
if ( page == NULL ) RETURN( dberr(S_NOMEMORY) );
/*--------- Init PAGE 0 ---------*/
page->pg0.dchain = htonl ((LONG) NONE);
page->pg0.next = htonl (2);
page->pg0.timestamp = 0; /* not really used by key file */
- DB_WRITE(dbfile, (char FAR *)page, (int)file_ptr->ft_pgsize);
+ DB_WRITE(dbfile, (char *)page, (int)file_ptr->ft_pgsize);
/*--------- Write KEY FILE PAGE 1 ---------*/
byteset(page, '\0', file_ptr->ft_pgsize);
/* node 1, NONE page pointer */
addr = -1;
bytecpy(page->pg1.init_addr, &addr, sizeof(F_ADDR));
- DB_WRITE(dbfile, (char FAR *)page, (int)file_ptr->ft_pgsize);
+ DB_WRITE(dbfile, (char *)page, (int)file_ptr->ft_pgsize);
}
else {
/*--------- Init DATA PAGE 0 ---------
/*---Write special DATA FILE PAGE 0 for system record file ---*/
page->pg0.next = htonl (2);
- DB_WRITE(dbfile, (char FAR *)page, (int)file_ptr->ft_pgsize);
+ DB_WRITE(dbfile, (char *)page, (int)file_ptr->ft_pgsize);
/*--------- Write DATA FILE PAGE 1 for system record ---------*/
byteset(page, '\0', file_ptr->ft_pgsize);
bytecpy(page->pg1.init_crts, &ts, sizeof(ULONG));
bytecpy(page->pg1.init_upts, &ts, sizeof(ULONG));
}
- DB_WRITE(dbfile, (char FAR *)page, (int)file_ptr->ft_pgsize);
+ DB_WRITE(dbfile, (char *)page, (int)file_ptr->ft_pgsize);
break;
}
}
*/
if (rec == size_rt) {
page->pg0.next = htonl (1);
- DB_WRITE(dbfile, (char FAR *)page, (int)file_ptr->ft_pgsize);
+ DB_WRITE(dbfile, (char *)page, (int)file_ptr->ft_pgsize);
}
}
/* close database file */
char dbfile[DtSrFILENMLEN], dbd_ver[DBD_COMPAT_LEN + 1];
char dbname[FILENMLEN]; /* Temporary working space */
int dbf;
- FILE_ENTRY FAR *file_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ FILE_ENTRY *file_ptr;
+ FIELD_ENTRY *fld_ptr;
#ifndef ONE_DB
#define DB_ENABLE 1
#else
#define TS_ENABLE 0
#endif
#if DB_ENABLE | TS_ENABLE
- RECORD_ENTRY FAR *rec_ptr;
- SET_ENTRY FAR *set_ptr;
+ RECORD_ENTRY *rec_ptr;
+ SET_ENTRY *set_ptr;
#endif
#ifndef ONE_DB
- MEMBER_ENTRY FAR *mem_ptr;
- SORT_ENTRY FAR *srt_ptr;
- KEY_ENTRY FAR *key_ptr;
+ MEMBER_ENTRY *mem_ptr;
+ SORT_ENTRY *srt_ptr;
+ KEY_ENTRY *key_ptr;
#endif
#ifndef NO_TIMESTAMP
goodver:
/* Read in database page size */
- DB_READ(dbf, (char FAR *)&DB_REF(Page_size), sizeof(INT));
+ DB_READ(dbf, (char *)&DB_REF(Page_size), sizeof(INT));
NTOHS (DB_REF(Page_size));
/* Read in table sizes */
- DB_READ(dbf, (char FAR *)&DB_REF(Size_ft), sizeof(INT));
+ DB_READ(dbf, (char *)&DB_REF(Size_ft), sizeof(INT));
NTOHS (DB_REF(Size_ft));
- DB_READ(dbf, (char FAR *)&DB_REF(Size_rt), sizeof(INT));
+ DB_READ(dbf, (char *)&DB_REF(Size_rt), sizeof(INT));
NTOHS (DB_REF(Size_rt));
- DB_READ(dbf, (char FAR *)&DB_REF(Size_fd), sizeof(INT));
+ DB_READ(dbf, (char *)&DB_REF(Size_fd), sizeof(INT));
NTOHS (DB_REF(Size_fd));
- DB_READ(dbf, (char FAR *)&DB_REF(Size_st), sizeof(INT));
+ DB_READ(dbf, (char *)&DB_REF(Size_st), sizeof(INT));
NTOHS (DB_REF(Size_st));
- DB_READ(dbf, (char FAR *)&DB_REF(Size_mt), sizeof(INT));
+ DB_READ(dbf, (char *)&DB_REF(Size_mt), sizeof(INT));
NTOHS (DB_REF(Size_mt));
- DB_READ(dbf, (char FAR *)&DB_REF(Size_srt), sizeof(INT));
+ DB_READ(dbf, (char *)&DB_REF(Size_srt), sizeof(INT));
NTOHS (DB_REF(Size_srt));
- DB_READ(dbf, (char FAR *)&DB_REF(Size_kt), sizeof(INT));
+ DB_READ(dbf, (char *)&DB_REF(Size_kt), sizeof(INT));
NTOHS (DB_REF(Size_kt));
close(dbf); /* end of PASS 1 */
DB_LSEEK(dbf, (off_t)(DBD_COMPAT_LEN + 8L*sizeof(INT)), 0);
/*----------------- FILE TABLE -------------------*/
- DB_READ(dbf, (char FAR *)&file_table[ORIGIN(ft_offset)],
+ DB_READ(dbf, (char *)&file_table[ORIGIN(ft_offset)],
(DB_REF(Size_ft)*sizeof(FILE_ENTRY)));
/* Invalid if sizeof(xxxx_ENTRY) diff on each machine */
for ( i = 0, file_ptr = &file_table[ORIGIN(ft_offset)];
}
/*----------------- RECORD TABLE -------------------*/
- DB_READ(dbf, (char FAR *)&record_table[ORIGIN(rt_offset)],
+ DB_READ(dbf, (char *)&record_table[ORIGIN(rt_offset)],
(DB_REF(Size_rt)*sizeof(RECORD_ENTRY)));
for ( i = 0, rec_ptr = &record_table[ORIGIN(rt_offset)];
i < DB_REF(Size_rt);
}
/*----------------- FIELD TABLE -------------------*/
- DB_READ(dbf, (char FAR *)&field_table[ORIGIN(fd_offset)],
+ DB_READ(dbf, (char *)&field_table[ORIGIN(fd_offset)],
(DB_REF(Size_fd)*sizeof(FIELD_ENTRY)));
for ( i = 0, fld_ptr = &field_table[ORIGIN(fd_offset)];
i < DB_REF(Size_fd);
}
/*----------------- SET TABLE -------------------*/
- DB_READ(dbf, (char FAR *)&set_table[ORIGIN(st_offset)],
+ DB_READ(dbf, (char *)&set_table[ORIGIN(st_offset)],
(DB_REF(Size_st)*sizeof(SET_ENTRY)));
for ( i = 0, set_ptr = &set_table[ORIGIN(st_offset)];
i < DB_REF(Size_st);
}
/*----------------- MEMBER TABLE -------------------*/
- DB_READ(dbf, (char FAR *)&member_table[ORIGIN(mt_offset)],
+ DB_READ(dbf, (char *)&member_table[ORIGIN(mt_offset)],
(DB_REF(Size_mt)*sizeof(MEMBER_ENTRY)));
for ( i = 0, mem_ptr = &member_table[ORIGIN(mt_offset)];
i < DB_REF(Size_mt);
}
- DB_READ(dbf, (char FAR *)&sort_table[ORIGIN(srt_offset)],
+ DB_READ(dbf, (char *)&sort_table[ORIGIN(srt_offset)],
(DB_REF(Size_srt)*sizeof(SORT_ENTRY)));
/* Member sort tables not used by DtSearch @@@ */
if (DB_REF(Size_srt)) {
NTOHS (srt_ptr->se_set);
}
- DB_READ(dbf, (char FAR *)&key_table[ORIGIN(kt_offset)],
+ DB_READ(dbf, (char *)&key_table[ORIGIN(kt_offset)],
(DB_REF(Size_kt)*sizeof(KEY_ENTRY)));
/* Compound key tables not used by DtSearch @@@ */
if (DB_REF(Size_kt)) {
int new_size;
int extra_file = 0;
#ifndef ONE_DB
- DB_ENTRY FAR *db_ptr;
+ DB_ENTRY *db_ptr;
#endif
/* allocate and initialize file_table */
{
int dbt_lc; /* loop control */
int rec, i;
- RECORD_ENTRY FAR *rec_ptr;
- SET_ENTRY FAR *set_ptr;
- DB_ADDR FAR *co_ptr;
+ RECORD_ENTRY *rec_ptr;
+ SET_ENTRY *set_ptr;
+ DB_ADDR *co_ptr;
int old_size;
int new_size;
/* database dictionary tables */
INT largest_page = 0;
-char FAR *crloc = NULL;
+char *crloc = NULL;
#ifndef ONE_DB
INT old_size_ft = 0;
DBN_DECL /* database number */
{
char crmp[MEMPSIZE]; /* current record's member pointer */
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* Make sure we have a current record */
RETURN( dberr(S_NOCR) );
/* Read current record and check connection */
- if ((dio_read( curr_rec, (char FAR * FAR *)&crloc , NOPGHOLD) == S_OKAY) &&
+ if ((dio_read( curr_rec, (char * *)&crloc , NOPGHOLD) == S_OKAY) &&
(r_gmem(set, crloc, crmp) == S_OKAY) &&
null_dba(crmp + MP_OWNER))
db_status = S_EOS; /* end-of-set if curr rec not owned */
DBN_DECL /* database number */
{
char crsp[SETPSIZE]; /* current record's set pointer */
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* Make sure we have a current record */
RETURN( dberr(S_NOCR) );
/* Read current record and check for members */
- if ((dio_read( curr_rec, (char FAR * FAR *)&crloc, NOPGHOLD) == S_OKAY) &&
+ if ((dio_read( curr_rec, (char * *)&crloc, NOPGHOLD) == S_OKAY) &&
(r_gset(set, crloc, crsp) == S_OKAY) &&
null_dba(crsp + SP_FIRST))
db_status = S_EOS; /* end-of-set if curr rec not owner */
{
int fld; /* field number */
int rec, rn; /* record type of current record */
- char FAR *rptr; /* pointer to current record */
- CONST char FAR *fptr; /* pointer to field contents */
+ char *rptr; /* pointer to current record */
+ CONST char *fptr; /* pointer to field contents */
char ckey[256]; /* compound key data */
int stat;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
- if (nfld_check(field, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY)
+ if (nfld_check(field, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY)
RETURN( db_status );
/* ensure current record is valid for this field */
RETURN( dberr(S_NOTOPTKEY) );
/* read current record */
- if ( (stat = dio_read(curr_rec, (char FAR * FAR *)&rptr, PGHOLD)) == S_OKAY ) {
+ if ( (stat = dio_read(curr_rec, (char * *)&rptr, PGHOLD)) == S_OKAY ) {
/* Make sure that the key has been stored */
if ( r_tstopt( fld_ptr, rptr ) == S_OKAY ) {
if ( dio_release( curr_rec ) != S_OKAY )
{
int fld; /* field number */
int rec, rn; /* record type of current record */
- char FAR *rptr; /* pointer to current record */
+ char *rptr; /* pointer to current record */
int stat;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
- if (nfld_check(field, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY)
+ if (nfld_check(field, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY)
RETURN( db_status );
/* ensure current record is valid for this field */
RETURN( dberr(S_NOTOPTKEY) );
/* read current record */
- if ( (stat = dio_read(curr_rec, (char FAR * FAR *)&rptr, NOPGHOLD)) == S_OKAY ) {
+ if ( (stat = dio_read(curr_rec, (char * *)&rptr, NOPGHOLD)) == S_OKAY ) {
/* Check the bit map and return S_OKAY if already stored,
else S_NOTFOUND */
if ((stat = r_tstopt(fld_ptr, rptr)) == S_OKAY)
#define KEYREPOS 3
/* Internal function prototypes */
-static int node_search(P1(CONST char FAR *) Pi(DB_ADDR FAR *)
- Pi(NODE FAR *) Pi(int *) Pi(int *)
+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 FAR *) Pi(KEY_SLOT FAR *)
- Pi(DB_ADDR FAR *));
-static int expand(P1(CONST char FAR *) Pi(DB_ADDR) Pi(F_ADDR));
-static int split_root(P1(NODE FAR *));
-static int split_node(P1(F_ADDR) Pi(NODE FAR *));
+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 FAR *) Pi(int) Pi(int));
-static void close_slots(P1(NODE FAR *) Pi(int) Pi(int));
+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 *));
#ifdef ONE_DB
#define prefix keyno
#endif
-static KEY_INFO FAR *curkey;
+static KEY_INFO *curkey;
static int key_len;
static int key_data;
static int slot_len;
static int mid_slot;
static int keyfile;
static INT fldno;
-static FIELD_ENTRY FAR *cfld_ptr;
+static FIELD_ENTRY *cfld_ptr;
static INT keyno;
#ifndef ONE_DB
static INT prefix;
long t; /* total keys thru level l */
int l; /* level number */
int i; /* field subscript */
- FIELD_ENTRY FAR *fld_ptr;
- KEY_INFO FAR *ki_ptr;
- FILE_ENTRY FAR *file_ptr;
+ FIELD_ENTRY *fld_ptr;
+ KEY_INFO *ki_ptr;
+ FILE_ENTRY *file_ptr;
/* child ptr key number */
key_data = sizeof(F_ADDR) + sizeof(INT);
if ( no_of_keys ) {
key_info =
/* Macro references must be on one line for some compilers */
- (KEY_INFO FAR *)
+ (KEY_INFO *)
ALLOC(&db_global.Key_info, no_of_keys*sizeof(KEY_INFO), "key_info");
if ( ! key_info )
return( dberr(S_NOMEMORY) );
t *= file_ptr->ft_slots;
ki_ptr->max_lvls = ++l;
ki_ptr->node_path =
- (NODE_PATH FAR *)
+ (NODE_PATH *)
ALLOC(&ki_ptr->Node_path, l*sizeof(NODE_PATH), db_avname);
if ( ! ki_ptr->node_path )
return( dberr(S_NOMEMORY) );
void key_close()
{
int k;
- KEY_INFO FAR *ki_ptr;
+ KEY_INFO *ki_ptr;
if ( key_info ) {
/* free memory allocated for key functions */
key_init(field )
int field; /* field number to be processed */
{
- FIELD_ENTRY FAR *fld_ptr;
- FILE_ENTRY FAR *file_ptr;
+ FIELD_ENTRY *fld_ptr;
+ FILE_ENTRY *file_ptr;
fld_ptr = &field_table[field];
if ( fld_ptr->fd_key == NOKEY )
FILE_NO fno;
{
int i;
- KEY_INFO FAR *ki_ptr;
+ KEY_INFO *ki_ptr;
for (i = 0, ki_ptr = key_info; i < no_of_keys; ++i, ++ki_ptr) {
if (((fno == size_ft) || (ki_ptr->keyfile == fno)) &&
*/
int
key_locpos(key_val, dba)
-CONST char FAR *key_val; /* key search value */
-DB_ADDR FAR *dba; /* database address of located key */
+CONST char *key_val; /* key search value */
+DB_ADDR *dba; /* database address of located key */
{
- NODE FAR *node; /* pointer to current node */
+ NODE *node; /* pointer to current node */
F_ADDR child; /* page number of child node */
F_ADDR pg; /* page number of current node */
int stat; /* saves node search status */
int slot, slot_pos;
int match_lvl; /* lowest level with duplicate key */
- NODE_PATH FAR *np_ptr;
- char FAR *node_slot_ptr;
+ NODE_PATH *np_ptr;
+ char *node_slot_ptr;
match_lvl = -1;
MEM_LOCK(&curkey->Node_path);
TRUE;
++curkey->level, ++np_ptr, pg = child) {
/* read in next node */
- if ( dio_get(pg, (char FAR * FAR *)&node, NOPGHOLD) != S_OKAY ) {
+ if ( dio_get(pg, (char * *)&node, NOPGHOLD) != S_OKAY ) {
MEM_UNLOCK(&curkey->Node_path);
return( db_status );
}
*/
static int node_search(key_val, dba, node, slotno, slot_offset,
child)
-CONST char FAR *key_val; /* key being searched */
-DB_ADDR FAR *dba; /* database address included in comparison if not null */
-NODE FAR *node; /* node being searched */
+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 FAR *node_slot_ptr;
+ char *node_slot_ptr;
/* perform binary search on node */
l = 0;
while ( u >= l ) {
i = (l + u)/2;
node_slot_ptr = &node->slots[slot_pos = i*slot_len];
- if ( (cmp = keycmp(key_val, (KEY_SLOT FAR *)node_slot_ptr, dba)) < 0 )
+ if ( (cmp = keycmp(key_val, (KEY_SLOT *)node_slot_ptr, dba)) < 0 )
u = i - 1;
else if ( cmp > 0 )
l = i + 1;
else if ( i && !unique && !dba ) {
/* backup to lowest duplicate in node */
- while (keycmp(key_val, (KEY_SLOT FAR *)(node_slot_ptr -= slot_len),
+ while (keycmp(key_val, (KEY_SLOT *)(node_slot_ptr -= slot_len),
dba) == 0) {
slot_pos -= slot_len;
if (--i == 0) goto have_slot;
/* Compare key value
*/
static int keycmp(key_val, slot, dba)
-CONST char FAR *key_val; /* key value */
-KEY_SLOT FAR *slot; /* pointer to key slot to be compared */
-DB_ADDR FAR *dba; /* database address included in comparison if not null */
+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
*/
int cmp;
- if (((cmp = INTcmp((char FAR *)&prefix, (char FAR *)&slot->keyno)) == 0) &&
+ if (((cmp = INTcmp((char *)&prefix, (char *)&slot->keyno)) == 0) &&
((cmp = fldcmp(cfld_ptr, key_val, slot->data)) == 0) &&
dba)
- cmp = ADDRcmp(dba, (DB_ADDR FAR *)&slot->data[key_len]);
+ cmp = ADDRcmp(dba, (DB_ADDR *)&slot->data[key_len]);
return( cmp );
}
DB_ADDR *dba; /* db address of scanned record */
{
F_ADDR child;
- NODE FAR *node;
- NODE_PATH FAR *np_ptr;
- char FAR *node_slot_ptr;
+ NODE *node;
+ NODE_PATH *np_ptr;
+ char *node_slot_ptr;
/* locate next key on file */
switch ( curkey->lstat ) {
}
MEM_LOCK(&curkey->Node_path);
np_ptr = &curkey->node_path[curkey->level];
- if (dio_get(np_ptr->node, (char FAR * FAR *)&node, NOPGHOLD) != S_OKAY) {
+ if (dio_get(np_ptr->node, (char * *)&node, NOPGHOLD) != S_OKAY) {
MEM_UNLOCK(&curkey->Node_path);
return( db_status );
}
}
--curkey->level;
node_slot_ptr = NULL;
- if (dio_get((--np_ptr)->node, (char FAR * FAR *)&node,
+ if (dio_get((--np_ptr)->node, (char * *)&node,
NOPGHOLD) != S_OKAY) {
MEM_UNLOCK(&curkey->Node_path);
return( db_status );
node_slot_ptr = &node->slots[np_ptr->slot*slot_len];
}
else do { /* move down to leaf node */
- if ( dio_get(child, (char FAR * FAR *)&node, NOPGHOLD) != S_OKAY ) {
+ if ( dio_get(child, (char * *)&node, NOPGHOLD) != S_OKAY ) {
MEM_UNLOCK(&curkey->Node_path);
return( db_status );
}
DB_ADDR *dba; /* to get dba of first or last key */
{
F_ADDR pg; /* node number */
- NODE FAR *node; /* pointer to node contents in cache */
+ NODE *node; /* pointer to node contents in cache */
int cmp; /* keycmp result */
int match_lvl; /* lowest level containing matched key */
int lvl; /* node_path level variable */
int slot; /* slot position in node */
- NODE_PATH FAR *np_ptr;
- char FAR *node_slot_ptr;
+ NODE_PATH *np_ptr;
+ char *node_slot_ptr;
if ( fcn == KEYFIND ) {
curkey->lstat = KEYINIT;
MEM_LOCK(&curkey->Node_path);
for (lvl = 0; TRUE; ++lvl) {
/* read next node */
- if ( dio_get(pg, (char FAR * FAR *)&node, NOPGHOLD) != S_OKAY ) {
+ if ( dio_get(pg, (char * *)&node, NOPGHOLD) != S_OKAY ) {
MEM_UNLOCK(&curkey->Node_path);
return( db_status );
}
for (slot = 0, node_slot_ptr = node->slots;
slot < node->used_slots;
++slot, node_slot_ptr += slot_len) {
- if ((cmp = INTcmp((char FAR *)&prefix,
- (char FAR *)(node_slot_ptr + sizeof(F_ADDR)))) <= 0)
+ if ((cmp = INTcmp((char *)&prefix,
+ (char *)(node_slot_ptr + sizeof(F_ADDR)))) <= 0)
break;
}
}
node_slot_ptr = &node->slots[slot*slot_len];
slot >= 0;
--slot, node_slot_ptr -= slot_len) {
- if ((cmp = INTcmp((char FAR *)&prefix,
- (char FAR *)(node_slot_ptr + sizeof(F_ADDR)))) >= 0)
+ if ((cmp = INTcmp((char *)&prefix,
+ (char *)(node_slot_ptr + sizeof(F_ADDR)))) >= 0)
break;
}
}
int
key_insert(fld, key_val, dba )
int fld; /* key field number */
-CONST char FAR *key_val; /* key value */
+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 FAR *key_val; /* key value */
+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 FAR *node;
- NODE_PATH FAR *np_ptr;
+ NODE *node;
+ NODE_PATH *np_ptr;
int slot_pos;
- char FAR *node_slot_ptr;
+ char *node_slot_ptr;
MEM_LOCK(&curkey->Node_path);
np_ptr = &curkey->node_path[curkey->level];
- if (dio_get(pg = np_ptr->node, (char FAR * FAR *)&node, PGHOLD) != S_OKAY) {
+ if (dio_get(pg = np_ptr->node, (char * *)&node, PGHOLD) != S_OKAY) {
MEM_UNLOCK(&curkey->Node_path);
return( db_status );
}
*/
static int split_node(l_pg, l_node )
F_ADDR l_pg; /* left node's page number */
-NODE FAR *l_node; /* left node buffer */
+NODE *l_node; /* left node buffer */
{
F_ADDR r_pg;
- NODE FAR *r_node;
+ NODE *r_node;
char key_val[256];
DB_ADDR dba;
- char FAR *l_node_slot_ptr;
+ char *l_node_slot_ptr;
/* extract middle key */
l_node_slot_ptr = &l_node->slots[mid_slot*slot_len];
/* allocate new right node */
if ((dio_pzalloc(keyfile, &r_pg) != S_OKAY) ||
- (dio_get(r_pg, (char FAR * FAR *)&r_node, PGHOLD) != S_OKAY))
+ (dio_get(r_pg, (char * *)&r_node, PGHOLD) != S_OKAY))
return( db_status );
/* copy slots from left node at slot mid_slot+1 into right node */
/* Split root node
*/
static int split_root(node )
-NODE FAR *node;
+NODE *node;
{
F_ADDR l_pg, r_pg;
- NODE FAR *l_node, FAR *r_node;
+ NODE *l_node, *r_node;
int slot_pos;
- char FAR *node_slot_ptr;
+ char *node_slot_ptr;
/* allocate two new nodes */
if ((dio_pzalloc(keyfile, &l_pg) != S_OKAY) ||
(dio_pzalloc(keyfile, &r_pg) != S_OKAY) ||
- (dio_get(l_pg, (char FAR * FAR *)&l_node, PGHOLD) != S_OKAY) ||
- (dio_get(r_pg, (char FAR * FAR *)&r_node, PGHOLD) != S_OKAY))
+ (dio_get(l_pg, (char * *)&l_node, PGHOLD) != S_OKAY) ||
+ (dio_get(r_pg, (char * *)&r_node, PGHOLD) != S_OKAY))
return( db_status );
/* copy 0..max_slots/2-1 keys from root into left node */
int
key_delete(fld, key_val, dba )
int fld;
-char CONST FAR *key_val;
+char CONST *key_val;
DB_ADDR dba;
{
int stat;
static int delete()
{
F_ADDR pg, p_pg, l_pg, r_pg;
- NODE FAR *node;
- NODE FAR *p_node;
- NODE FAR *l_node;
- NODE FAR *r_node;
+ NODE *node;
+ NODE *p_node;
+ NODE *l_node;
+ NODE *r_node;
int amt, slot_pos;
- NODE_PATH FAR *np_ptr;
- char FAR *node_slot_ptr;
- char FAR *p_node_slot_ptr;
- char FAR *l_node_slot_ptr;
- char FAR *r_node_slot_ptr;
+ NODE_PATH *np_ptr;
+ char *node_slot_ptr;
+ char *p_node_slot_ptr;
+ char *l_node_slot_ptr;
+ char *r_node_slot_ptr;
MEM_LOCK(&curkey->Node_path);
np_ptr = &curkey->node_path[curkey->level];
/* read node containing key to be deleted */
- if (dio_get(pg = np_ptr->node, (char FAR * FAR *)&node, PGHOLD) != S_OKAY) {
+ if (dio_get(pg = np_ptr->node, (char * *)&node, PGHOLD) != S_OKAY) {
MEM_UNLOCK(&curkey->Node_path);
return( db_status );
}
/* find leftmost descendent of right sub-tree */
++np_ptr->slot;
do {
- if ( dio_get(r_pg, (char FAR * FAR *)&r_node, NOPGHOLD) != S_OKAY ) {
+ if ( dio_get(r_pg, (char * *)&r_node, NOPGHOLD) != S_OKAY ) {
MEM_UNLOCK(&curkey->Node_path);
return( db_status );
}
/* (this is more efficient than a recursive call) */
slot_pos = 0;
node_slot_ptr = node->slots;
- if (dio_get(pg = np_ptr->node, (char FAR * FAR *)&node, PGHOLD) != S_OKAY) {
+ if (dio_get(pg = np_ptr->node, (char * *)&node, PGHOLD) != S_OKAY) {
MEM_UNLOCK(&curkey->Node_path);
return( db_status );
}
/* check if necessary to adjust nodes */
if ((curkey->level > 0) && (node->used_slots < mid_slot)) {
/* read in parent node */
- if (dio_get(p_pg = (np_ptr - 1)->node, (char FAR * FAR *)&p_node,
+ if (dio_get(p_pg = (np_ptr - 1)->node, (char * *)&p_node,
PGHOLD) != S_OKAY) {
MEM_UNLOCK(&curkey->Node_path);
return( db_status );
/* read left node */
p_node_slot_ptr = &p_node->slots[slot_pos];
bytecpy(&l_pg, p_node_slot_ptr, sizeof(F_ADDR));
- if ( dio_get(l_pg, (char FAR * FAR *)&l_node, PGHOLD) != S_OKAY ) {
+ if ( dio_get(l_pg, (char * *)&l_node, PGHOLD) != S_OKAY ) {
MEM_UNLOCK(&curkey->Node_path);
return( db_status );
}
/* read right node */
p_node_slot_ptr = &p_node->slots[slot_pos + slot_len];
bytecpy(&r_pg, p_node_slot_ptr, sizeof(F_ADDR));
- if (dio_get(r_pg, (char FAR * FAR *)&r_node, PGHOLD) != S_OKAY) {
+ if (dio_get(r_pg, (char * *)&r_node, PGHOLD) != S_OKAY) {
MEM_UNLOCK(&curkey->Node_path);
return( db_status );
}
/* Open n slots in node
*/
static void open_slots(node, slot_pos, n)
-NODE FAR *node;
+NODE *node;
int slot_pos;
int n;
{
- char FAR *dst, FAR *src;
+ char *dst, *src;
int amt, w, nw;
nw = NODE_WIDTH(node);
/* Close n slots in node
*/
static void close_slots(node, slot_pos, n)
-NODE FAR *node;
+NODE *node;
int slot_pos;
int n;
{
- char FAR *dst, FAR *src;
+ char *dst, *src;
int w, amt;
node->used_slots -= n;
*/
int
d_keyread(key_val TASK_PARM)
-char FAR *key_val;
+char *key_val;
TASK_DECL
{
int kt_lc; /* loop control */
float fv;
double dv;
#endif
- char FAR *fptr;
- char FAR *kptr;
- FIELD_ENTRY FAR *fld_ptr;
- KEY_ENTRY FAR *key_ptr;
+ char *fptr;
+ char *kptr;
+ FIELD_ENTRY *fld_ptr;
+ KEY_ENTRY *key_ptr;
DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(RECORD_IO));
int
key_bldcom(fld, rec, key, cflag )
int fld; /* compound key field number */
-char FAR *rec; /* ptr to record data */
-char FAR *key; /* ptr to array to recv constructed key */
+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 */
float fv;
double dv;
#endif
- char FAR *fptr;
- FIELD_ENTRY FAR *fld_ptr, FAR *kfld_ptr;
- KEY_ENTRY FAR *key_ptr;
+ char *fptr;
+ FIELD_ENTRY *fld_ptr, *kfld_ptr;
+ KEY_ENTRY *key_ptr;
/* clear key area */
fld_ptr = &field_table[fld];
/* Complement and copy bytes
*/
void key_cmpcpy(s1, s2, n)
-char FAR *s1;
-char FAR *s2;
+char *s1;
+char *s2;
INT n;
{
while ( n-- ) {
#include "dbtype.h"
/* Internal function prototypes */
-static void chk_desc_key(P1(int) Pi(FIELD_ENTRY FAR *)
- Pi(CONST char FAR *) Pi(char FAR *));
+static void chk_desc_key(P1(int) Pi(FIELD_ENTRY *)
+ Pi(CONST char *) Pi(char *));
/* Find record thru key field
*/
int
d_keyfind(field, fldval TASK_PARM DBN_PARM)
long field; /* field constant */
-CONST char FAR *fldval; /* value of the data field */
+CONST char *fldval; /* value of the data field */
TASK_DECL
DBN_DECL /* database number */
{
int fld, rec;
DB_ADDR dba;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
char ckey[256];
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
- if ((nfld_check(field, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY) ||
+ if ((nfld_check(field, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY) ||
/* initialize key function operation */
(key_init(fld) != S_OKAY))
RETURN( db_status );
*/
static void chk_desc_key(fld, fld_ptr, fldval, ckey)
int fld;
-FIELD_ENTRY FAR *fld_ptr;
-CONST char FAR *fldval;
-char FAR *ckey;
+FIELD_ENTRY *fld_ptr;
+CONST char *fldval;
+char *ckey;
{
int kt_lc; /* loop control */
#ifndef NO_FLOAT
float fv;
double dv;
#endif
- char FAR *fptr;
- char FAR *tptr;
- FIELD_ENTRY FAR *kfld_ptr;
- KEY_ENTRY FAR *key_ptr;
+ char *fptr;
+ char *tptr;
+ FIELD_ENTRY *kfld_ptr;
+ KEY_ENTRY *key_ptr;
/* complement descending compound key values */
for (kt_lc = size_kt - fld_ptr->fd_ptr,
key_ptr = &key_table[fld_ptr->fd_ptr];
(--kt_lc >= 0) && (key_ptr->kt_key == fld); ++key_ptr) {
kfld_ptr = &field_table[key_ptr->kt_field];
- fptr = (char FAR *)fldval + key_ptr->kt_ptr;
+ fptr = (char *)fldval + key_ptr->kt_ptr;
tptr = ckey + key_ptr->kt_ptr;
if ( key_ptr->kt_sort == 'd' ) {
switch ( kfld_ptr->fd_type ) {
{
int fld, rec;
DB_ADDR dba;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
- if ((nfld_check(field, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY) ||
+ if ((nfld_check(field, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY) ||
/* initialize key function operation */
(key_init(fld) != S_OKAY))
RETURN( db_status );
{
int fld, rec;
DB_ADDR dba;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
- if ((nfld_check(field, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY) ||
+ if ((nfld_check(field, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY) ||
/* initialize key function operation */
(key_init(fld) != S_OKAY))
RETURN( db_status );
{
int fld, rec;
DB_ADDR dba;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
- if ((nfld_check(field, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY) ||
+ if ((nfld_check(field, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY) ||
/* initialize key function operation */
(key_init(fld) != S_OKAY))
RETURN( db_status );
{
int fld, rec;
DB_ADDR dba;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
- if ((nfld_check(field, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY) ||
+ if ((nfld_check(field, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY) ||
/* initialize key function operation */
(key_init(fld) != S_OKAY))
RETURN( db_status );
{
int fld; /* field number */
int rec, rn; /* record type of current record */
- char FAR *rptr; /* pointer to current record */
- char FAR *fptr; /* pointer to field contents */
+ char *rptr; /* pointer to current record */
+ char *fptr; /* pointer to field contents */
char ckey[256]; /* compound key */
int stat;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
- if (nfld_check(field, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY)
+ if (nfld_check(field, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY)
RETURN( db_status );
/* Make sure we have a current record */
RETURN( dberr(S_NOTOPTKEY) );
/* read current record */
- if ( (stat = dio_read(curr_rec, (char FAR * FAR *)&rptr, PGHOLD)) == S_OKAY ) {
+ if ( (stat = dio_read(curr_rec, (char * *)&rptr, PGHOLD)) == S_OKAY ) {
/* Make sure that the key has not already been stored */
if ( (stat = r_tstopt( fld_ptr, rptr )) != S_OKAY ) {
if ( dio_release( curr_rec ) != S_OKAY )
/* Internal function prototypes */
static int rec_okay(P1(int) Pi(int *)
- Pi(RECORD_ENTRY FAR * FAR *));
+ Pi(RECORD_ENTRY * *));
static int ctblcmp(P1(CONST unsigned char FAR*)
Pi(CONST unsigned char FAR*) Pi(int));
nset_check(nset, set, set_ptr )
int nset;
int *set;
-SET_ENTRY FAR * FAR *set_ptr;
+SET_ENTRY * *set_ptr;
{
nset -= SETMARK;
if ((nset < 0) || (nset >= TABLE_SIZE(Size_st)))
long nfld;
int *rec;
int *fld;
-RECORD_ENTRY FAR * FAR *rec_ptr;
-FIELD_ENTRY FAR * FAR *fld_ptr;
+RECORD_ENTRY * *rec_ptr;
+FIELD_ENTRY * *fld_ptr;
{
int trec;
int tfld;
- if (!rec_okay(trec = (int)(nfld/FLDMARK), rec, (RECORD_ENTRY FAR * FAR *)rec_ptr) ||
+ if (!rec_okay(trec = (int)(nfld/FLDMARK), rec, (RECORD_ENTRY * *)rec_ptr) ||
((tfld = (int)(nfld - trec*FLDMARK)) < 0) ||
(tfld >= TABLE_SIZE(Size_fd)))
return( dberr(S_INVFLD) );
nrec_check(nrec, rec, rec_ptr)
int nrec;
int *rec;
-RECORD_ENTRY FAR * FAR *rec_ptr;
+RECORD_ENTRY * *rec_ptr;
{
- if (rec_okay(nrec - RECMARK, rec, (RECORD_ENTRY FAR * FAR *)rec_ptr))
+ if (rec_okay(nrec - RECMARK, rec, (RECORD_ENTRY * *)rec_ptr))
db_status = S_OKAY;
else
dberr(S_INVREC);
static int rec_okay(nrec, rec, rec_ptr)
int nrec;
int *rec;
-RECORD_ENTRY FAR * FAR *rec_ptr;
+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 FAR *fld_ptr;
-CONST char FAR *f1; /* pointer to field 1 */
-CONST char FAR *f2; /* pointer to field 2 */
+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,
float F1, F2;
double d1, d2;
#endif
- FIELD_ENTRY FAR *fld_max;
- FIELD_ENTRY FAR *sfld_ptr;
- KEY_ENTRY FAR *key_ptr;
- INT FAR *dim_ptr;
+ FIELD_ENTRY *fld_max;
+ FIELD_ENTRY *sfld_ptr;
+ KEY_ENTRY *key_ptr;
+ INT *dim_ptr;
len = fld_ptr->fd_len;
#endif
case DBADDR:
for ( result = elt = 0; result == 0 && elt < entries; ++elt ) {
- result = ADDRcmp((DB_ADDR FAR *)(f1+(elt*sizeof(DB_ADDR))),
- (DB_ADDR FAR *)(f2+(elt*sizeof(DB_ADDR))));
+ result = ADDRcmp((DB_ADDR *)(f1+(elt*sizeof(DB_ADDR))),
+ (DB_ADDR *)(f2+(elt*sizeof(DB_ADDR))));
}
break;
case GROUPED:
/* compare the INT variables
*/
int INTcmp( i1, i2 )
-CONST char FAR *i1, FAR *i2;
+CONST char *i1, *i2;
{
INT I1, I2;
/* compare two DB_ADDR variables
*/
int ADDRcmp( d1, d2 )
-CONST DB_ADDR FAR *d1, FAR *d2;
+CONST DB_ADDR *d1, *d2;
{
DB_ADDR a1, a2;
FILE_NO f1, f2;
*/
int
null_dba( db_addr )
-CONST char FAR *db_addr;
+CONST char *db_addr;
{
DB_ADDR dba;
/* Compare two strings with sorting according to char-table
*/
static int ctblcmp(s, t, n)
-CONST unsigned char FAR *s; /* String 1 */
-CONST unsigned char FAR *t; /* String 2 */
+CONST unsigned char *s; /* String 1 */
+CONST unsigned char *t; /* String 2 */
int n; /* Max. String length */
{
int x;
*/
/* The functions in this file are defined in alloc.c */
-typedef struct {struct ll_elem FAR *ptr; LOCK_DESC} LL_P;
+typedef struct {struct ll_elem *ptr; LOCK_DESC} LL_P;
typedef struct ll_elem {
LL_P next;
typedef struct {
LL_P head;
LL_P tail;
- LL_P FAR *curr;
+ LL_P *curr;
} llist;
#define LLIST_INIT() { POINTER_INIT(), POINTER_INIT(), NULL }
-BOOLEAN ll_access(P1(llist FAR *));
-int ll_append(P1(llist FAR *) Pi(CHAR_P FAR *));
+BOOLEAN ll_access(P1(llist *));
+int ll_append(P1(llist *) Pi(CHAR_P *));
#define ll_deaccess(ll) /**/
-CHAR_P FAR *ll_first(P1(llist FAR *));
-void ll_free(P1(llist FAR *));
-CHAR_P FAR *ll_next(P1(llist FAR *));
-int ll_prepend(P1(llist FAR *) Pi(CHAR_P FAR *));
+CHAR_P *ll_first(P1(llist *));
+void ll_free(P1(llist *));
+CHAR_P *ll_next(P1(llist *));
+int ll_prepend(P1(llist *) Pi(CHAR_P *));
/* vpp -nOS2 -dUNIX -nBSD -nVANILLA_BSD -nVMS -nMEMLOCK -nWINDOWS -nFAR_ALLOC -f/usr/users/master/config/nonwin ll.h */
int
d_setkey( field, fldvalue TASK_PARM DBN_PARM )
long field;
-CONST char FAR *fldvalue;
+CONST char *fldvalue;
TASK_DECL
DBN_DECL
{
- SK_P FAR *sk_ptr;
+ SK_P *sk_ptr;
SK_P sk_p;
int fld, rec;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_NOIO));
- if (nfld_check(field, &rec, &fld, (RECORD_ENTRY FAR * FAR *)&rec_ptr, (FIELD_ENTRY FAR * FAR *)&fld_ptr) != S_OKAY)
+ if (nfld_check(field, &rec, &fld, (RECORD_ENTRY * *)&rec_ptr, (FIELD_ENTRY * *)&fld_ptr) != S_OKAY)
RETURN( db_status );
if ( fld_ptr->fd_key == 'n' )
RETURN( dberr(S_NOTKEY) );
ll_access(&sk_list);
- while ((sk_ptr = (SK_P FAR *)ll_next(&sk_list)) != NULL) {
+ while ((sk_ptr = (SK_P *)ll_next(&sk_list)) != NULL) {
if ( sk_ptr->ptr->sk_fld == fld ) {
MEM_LOCK(&sk_ptr->ptr->sk_val);
if ( fld_ptr->fd_type != CHARACTER || fld_ptr->fd_dim[1] )
}
}
/* need to allocate a slot for a new fld */
- sk_p.ptr = (struct sk FAR *)ALLOC(&sk_p, sizeof(struct sk), "sk_ptr->ptr");
+ sk_p.ptr = (struct sk *)ALLOC(&sk_p, sizeof(struct sk), "sk_ptr->ptr");
if ( sk_p.ptr == NULL )
RETURN( dberr( S_NOMEMORY ) );
- if ( ll_prepend(&sk_list, (CHAR_P FAR *)&sk_p) != S_OKAY ) {
+ if ( ll_prepend(&sk_list, (CHAR_P *)&sk_p) != S_OKAY ) {
RETURN( db_status );
}
sk_p.ptr->sk_fld = fld;
*/
int sk_free()
{
- SK_P FAR *sk_ptr;
+ SK_P *sk_ptr;
ll_access(&sk_list);
- while ((sk_ptr = (SK_P FAR *)ll_next(&sk_list)) != NULL) {
+ while ((sk_ptr = (SK_P *)ll_next(&sk_list)) != NULL) {
MEM_UNLOCK(&sk_ptr->ptr->sk_val);
FREE(&sk_ptr->ptr->sk_val);
}
INT recnum, fld, stat;
FILE_NO file;
F_ADDR rec_addr;
- char FAR *ptr;
- SK_P FAR *sk_ptr;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ char *ptr;
+ SK_P *sk_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
int fldtot;
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
- if (nrec_check(nrec, &nrec, (RECORD_ENTRY FAR * FAR *)&rec_ptr) != S_OKAY)
+ if (nrec_check(nrec, &nrec, (RECORD_ENTRY * *)&rec_ptr) != S_OKAY)
RETURN( db_status );
recnum = NUM2EXT(nrec, rt_offset);
if ((fld_ptr->fd_key == UNIQUE) && !(fld_ptr->fd_flags & OPTKEYMASK)) {
/* locate the key value in the set_key table */
ll_access(&sk_list);
- while (((sk_ptr = (SK_P FAR *)ll_next(&sk_list)) != NULL) &&
+ while (((sk_ptr = (SK_P *)ll_next(&sk_list)) != NULL) &&
(sk_ptr->ptr->sk_fld != fld))
; /* NOP */
if (sk_ptr == NULL) {
db_addr |= rec_addr;
/* read record */
- if ( dio_read( db_addr, (char FAR * FAR *)&ptr, PGHOLD) != S_OKAY )
+ if ( dio_read( db_addr, (char * *)&ptr, PGHOLD) != S_OKAY )
RETURN( db_status );
/* zero fill the record */
if ((fld_ptr->fd_key != 'n') && !(fld_ptr->fd_flags & OPTKEYMASK)) {
/* locate the key value in the set_key table */
ll_access(&sk_list);
- sk_ptr = (SK_P FAR *)ll_first(&sk_list);
+ sk_ptr = (SK_P *)ll_first(&sk_list);
while (sk_ptr != NULL) {
if ( sk_ptr->ptr->sk_fld == fld ) {
MEM_LOCK(&sk_ptr->ptr->sk_val);
MEM_UNLOCK(&sk_ptr->ptr->sk_val);
break;
}
- sk_ptr = (SK_P FAR *)ll_next(&sk_list);
+ sk_ptr = (SK_P *)ll_next(&sk_list);
}
ll_deaccess(&sk_list);
if ( sk_ptr == NULL ) RETURN( dberr( S_KEYREQD ) );
int d_mapchar(inchar,outchar,sort_str,subsort TASK_PARM)
unsigned char inchar; /* value of character to be mapped */
unsigned char outchar; /* output character as ... */
-CONST char FAR *sort_str; /* sort string (max. len = 2) */
+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) */
TASK_DECL
*/
int ctbl_alloc()
{
- if ((db_global.country_tbl.ptr = (CNTRY_TBL FAR *)
+ if ((db_global.country_tbl.ptr = (CNTRY_TBL *)
ALLOC(&db_global.country_tbl,256*sizeof(CNTRY_TBL)+1,"country_tbl"))
== NULL ) return( dberr(S_NOMEMORY) );
int
d_members(set, tot TASK_PARM DBN_PARM)
int set; /* Set table entry */
-LONG FAR *tot; /* total members of set */
+LONG *tot; /* total members of set */
TASK_DECL
DBN_DECL /* database number */
{
char setp[SETPSIZE];
- char FAR *recp;
+ char *recp;
LONG total;
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* Make sure we have a current owner */
RETURN( dberr(S_NOCO) );
/* Read owner record */
- if ( dio_read( curr_own[set], (char FAR * FAR *)&recp, NOPGHOLD) != S_OKAY )
+ if ( dio_read( curr_own[set], (char * *)&recp, NOPGHOLD) != S_OKAY )
RETURN( db_status );
/* Get set pointer from owner record */
char retcode; /* Return value (some enumerated below) */
char lsn; /* Local session number */
char num; /* Name number */
- char FAR *buffer_off; /* Message buffer offset */
+ char *buffer_off; /* Message buffer offset */
#ifdef SMALL_DATA
int buffer_seg; /* Message buffer segment */
#endif
char name[NETNAME_LEN]; /* My name */
char rto; /* Receive timeout (500ms units) */
char sto; /* Send timeout (500ms units) */
- char FAR *post_off; /* Post function offset */
+ char *post_off; /* Post function offset */
#ifdef SMALL_DATA
int post_seg; /* Post function segment */
#endif
/* Open a binary file for shared access
*/
int open_b(filenm, flags)
-CONST char FAR *filenm;
+CONST char *filenm;
int flags;
{
int desc;
/* ********************** FUNCTION PROTOTYPES ************************ */
-static int isabs(P1(char FAR *));
+static int isabs(P1(char *));
/* TRUE if path is absolute */
-static char FAR * remdrv(P1(char FAR *));
+static char * remdrv(P1(char *));
/* Removes drive spec from path */
-static char FAR * remfile(P1(char FAR *));
+static char * remfile(P1(char *));
/* Removes file from path */
/* ======================================================================
Construct the full path to the dictionary.
*/
int con_dbd(path_str,dbname,dbdpath)
-char FAR *path_str; /* (output) string to receive the full path to the
+char *path_str; /* (output) string to receive the full path to the
dictionary */
-char FAR *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 FAR *dbdpath; /* contains one element of the environment variable
+char *dbdpath; /* contains one element of the environment variable
DBDPATH. NULL means no DBDPATH defined. */
{
/*
Construct full path to data/key files
*/
int con_dbf(path_str, dbfile, dbname, dbfpath)
-char FAR *path_str; /* (output) receives full path to dictionary */
-char FAR *dbfile; /* path to database file (defn in schema) */
-char FAR *dbname; /* d_open dbname argument - path to dictionary */
-char FAR *dbfpath; /* one element from DBFPATH, or NULL for no path */
+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 FAR * get_element(dbxpath,num)
-char FAR *dbxpath; /* DBxPATH, elements separated by semicolons
+char * get_element(dbxpath,num)
+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) */
static char element[FILENMLEN+1]; /* return value */
int i;
- char FAR *save;
+ char *save;
if (dbxpath == NULL) return (NULL);
if (dbxpath[0] == '\0') return (NULL); /* NULL string? */
if ((dbxpath = strchr(dbxpath+1,';')) == NULL) return (NULL);
dbxpath++;
if ((save = strchr(dbxpath+1,';')) != NULL) *save = '\0';
- i = (dbxpath - (char FAR *)element) + strlen((CONST char FAR *)dbxpath);
+ i = (dbxpath - (char *)element) + strlen((CONST char *)dbxpath);
if (element[i-1] != DIRCHAR && element[i-1] != ':') {
element[i++] = DIRCHAR;
element[i] = '\0';
Returns TRUE of path is absolute
*/
static int isabs(path_str)
-char FAR *path_str; /* path to test, NULL causes iabs to return FALSE */
+char *path_str; /* path to test, NULL causes iabs to return FALSE */
{
/*
RETURNS: TRUE if path is absolute
ASSUMES: None.
*/
- char FAR *path; /* Points to path w/o drive spec */
+ char *path; /* Points to path w/o drive spec */
if (path_str == NULL) return (FALSE);
path = remdrv(path_str);
/* ======================================================================
Removes drive specifier from path
*/
-static char FAR * remdrv(path_str)
-char FAR *path_str; /* path to remove drive from */
+static char * remdrv(path_str)
+char *path_str; /* path to remove drive from */
{
/*
RETURNS: Pointer to string w/o drive specification. Note that
this simply points further into path_str.
ASSUMES: None.
*/
- char FAR *path; /* Return value */
+ char *path; /* Return value */
if ((path = strrchr(path_str,':')) == NULL) return (path_str);
return (path+1);
/* ======================================================================
Removes file from a path.
*/
-static char FAR * remfile(path_str)
-char FAR *path_str; /* Path to remove filename from */
+static char * remfile(path_str)
+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 TASK_PARM)
-CONST char FAR *ctb;
+CONST char *ctb;
TASK_DECL
{
int i;
void dbautorec(P0);
/* From dblfcns.c: */
-int taskinit(P1(TASK FAR *));
-int initdbt(P1(CONST char FAR *));
-int alloc_table(P1(CHAR_P FAR *) Pi(unsigned) Pi(unsigned));
-#define ALLOC_TABLE(t, n, o, v) alloc_table((CHAR_P FAR *)(t), n, o)
+int taskinit(P1(TASK *));
+int initdbt(P1(CONST char *));
+int alloc_table(P1(CHAR_P *) Pi(unsigned) Pi(unsigned));
+#define ALLOC_TABLE(t, n, o, v) alloc_table((CHAR_P *)(t), n, o)
#ifndef SINGLE_USER
int termses(P0);
#endif
int dio_clear(P0);
int dio_flush(P0);
void dio_setdef(P1(FILE_NO));
-int dio_get(P1(F_ADDR) Pi(char FAR * FAR *) Pi(int));
+int dio_get(P1(F_ADDR) Pi(char * *) Pi(int));
int dio_touch(P1(F_ADDR));
-int dio_read(P1(DB_ADDR) Pi(char FAR * FAR *) Pi(int));
-int dio_write(P1(DB_ADDR) Pi(CONST char FAR *) Pi(int));
+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 FAR *)
- Pi(PAGE_ENTRY FAR * FAR *)
- Pi(LOOKUP_ENTRY FAR * FAR *));
+int dio_findpg(P1(FILE_NO) Pi(F_ADDR) Pi(PAGE_ENTRY *)
+ Pi(PAGE_ENTRY * *)
+ Pi(LOOKUP_ENTRY * *));
#ifdef NO_TRANS
-int dio_out(P1(PAGE_ENTRY FAR *) Pi(LOOKUP_ENTRY FAR *));
+int dio_out(P1(PAGE_ENTRY *) Pi(LOOKUP_ENTRY *));
#else
-int dio_out(P1(PAGE_ENTRY FAR *) Pi(LOOKUP_ENTRY FAR *)
+int dio_out(P1(PAGE_ENTRY *) Pi(LOOKUP_ENTRY *)
Pi(BOOLEAN));
#endif
#ifndef NO_TIMESTAMP
void key_close(P0);
int key_init(P1(int));
int key_reset(P1(FILE_NO));
-int key_locpos(P1(CONST char FAR *) Pi(DB_ADDR FAR *));
+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 FAR *) Pi(DB_ADDR));
-int key_delete(P1(int) Pi(CONST char FAR *) 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));
/* 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 FAR *) Pi(char FAR *) Pi(int));
+int key_bldcom(P1(int) Pi(char *) Pi(char *) Pi(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 FAR *) Pi(char FAR *) Pi(INT));
+void key_cmpcpy(P1(char *) Pi(char *) Pi(INT));
/* From libfcns.c: */
#ifndef ONE_DB
int dbn_check(P1(int));
#endif
-int nset_check(P1(int) Pi(int *) Pi(SET_ENTRY FAR * FAR *));
+int nset_check(P1(int) Pi(int *) Pi(SET_ENTRY * *));
int nfld_check(P1(long) Pi(int *) Pi(int *)
- Pi(RECORD_ENTRY FAR * FAR *)
- Pi(FIELD_ENTRY FAR * FAR *));
-int nrec_check(P1(int) Pi(int *) Pi(RECORD_ENTRY FAR * FAR *));
-int fldcmp(P1(FIELD_ENTRY FAR *) Pi(CONST char FAR *)
- Pi(CONST char FAR *));
-int INTcmp(P1(CONST char FAR *) Pi(CONST char FAR *));
-int ADDRcmp(P1(CONST DB_ADDR FAR *) Pi(CONST DB_ADDR FAR *));
-int null_dba(P1(CONST char FAR *));
+ 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));
/* From makenew.c: */
/* From netwdos.c: */
int netbios_chk(P0);
int nw_reset(P1(int) Pi(int));
-int nw_addnm(P1(char FAR *) Pi(int *));
-int nw_cleanup(P1(char FAR *));
+int nw_addnm(P1(char *) Pi(int *));
+int nw_cleanup(P1(char *));
int nw_sestat(P0);
-int nw_delnm(P1(char FAR *));
-int nw_call(P1(char FAR *) Pi(char FAR *) Pi(int *));
+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 FAR *) Pi(int));
-int nw_rcvmsg(P1(int) Pi(MESSAGE FAR *) Pi(int) Pi(int *));
+int nw_send(P1(int) Pi(MESSAGE *) Pi(int));
+int nw_rcvmsg(P1(int) Pi(MESSAGE *) Pi(int) Pi(int *));
/* From opens.c: */
-int open_b(P1(CONST char FAR *) Pi(int));
+int open_b(P1(CONST char *) Pi(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 FAR *) Pi(LOOKUP_ENTRY FAR *));
+int o_write(P1(PAGE_ENTRY *) Pi(LOOKUP_ENTRY *));
int o_pzwrite(P1(FILE_NO));
int o_flush(P0);
int o_update(P0);
void o_free(P0);
/* From recfcns.c: */
-int r_chkfld(P1(INT) Pi(FIELD_ENTRY FAR *) Pi(char FAR *)
- Pi(CONST char FAR *));
+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 FAR *) Pi(char FAR *) Pi(char FAR *));
-int r_gmem(P1(int) Pi(char FAR *) Pi(char FAR *));
-int r_gset(P1(int) Pi(char FAR *) Pi(char FAR *));
-int r_pfld(P1(INT) Pi(FIELD_ENTRY FAR *) Pi(char FAR *)
- Pi(CONST char FAR *) Pi(DB_ADDR FAR *));
-int r_pmem(P1(int) Pi(char FAR *) Pi(char FAR *));
-int r_pset(P1(int) Pi(char FAR *) Pi(char FAR *));
-int r_smem(P1(DB_ADDR FAR *) Pi(INT));
-int r_setopt(P1(FIELD_ENTRY FAR *) Pi(char FAR *));
-int r_clropt(P1(FIELD_ENTRY FAR *) Pi(char FAR *));
-int r_tstopt(P1(FIELD_ENTRY FAR *) Pi(char FAR *));
+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 *));
/* From pathfcns.c */
-int con_dbd(P1(char FAR *) Pi(char FAR *) Pi(char FAR *));
-int con_dbf(P1(char FAR *) Pi(char FAR *) Pi(char FAR *)
- Pi(char FAR *));
-char FAR * get_element(P1(char FAR *) Pi(int));
+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));
/* From renfile.c: */
int renfiles(P0);
int taf_close(P0);
int taf_access(P0);
int taf_release(P0);
-int taf_add(P1(CONST char FAR *));
-int taf_del(P1(CONST char FAR *) );
+int taf_add(P1(CONST char *));
+int taf_del(P1(CONST char *) );
/* From task.c */
#ifdef MULTI_TASK
-void task_switch(P1(DB_TASK FAR *));
+void task_switch(P1(DB_TASK *));
#endif
/* From mapchar.c */
char * CDECL strrchr(P1(CONST char *) Pi(int));
#endif
-void CDECL free(P1(void FAR *)); /* AIXV3 - DPG 07/05/90 */
+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));
int
r_chkfld(field, fld_ptr, rec, data )
INT field; /* field_table entry number */
-FIELD_ENTRY FAR *fld_ptr; /* corresponds to field */
-char FAR *rec; /* pointer to record slot */
-CONST char FAR *data; /* pointer to data area containing field contents */
+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;
INT rn;
- char FAR *fptr, ckey[256];
+ char *fptr, ckey[256];
int i;
- FIELD_ENTRY FAR *sfld_ptr;
- RECORD_ENTRY FAR *rec_ptr;
+ FIELD_ENTRY *sfld_ptr;
+ RECORD_ENTRY *rec_ptr;
bytecpy(&rn, rec, sizeof(INT));
rn &= ~RLBMASK; /* mask off rlb */
INT rt;
DB_ADDR db_addr;
{
- char FAR *rec; /* ptr to record slot */
- char FAR *fptr; /* field data ptr */
+ char *rec; /* ptr to record slot */
+ char *fptr; /* field data ptr */
char ckey[256]; /* compound key data */
#ifndef NO_TIMESTAMP
ULONG timestamp;
FILE_NO fno;
F_ADDR rno;
int fld;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
- if ( dio_read( db_addr, (char FAR * FAR *)&rec, PGHOLD) != S_OKAY )
+ if ( dio_read( db_addr, (char * *)&rec, PGHOLD) != S_OKAY )
return( db_status );
rec_ptr = &record_table[rt];
*/
int
r_gfld(fld_ptr, rec, data )
-FIELD_ENTRY FAR *fld_ptr;
-char FAR *rec; /* pointer to record */
-char FAR *data; /* pointer to data area to contain field contents */
+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;
- FIELD_ENTRY FAR *kfld_ptr;
- KEY_ENTRY FAR *key_ptr;
+ FIELD_ENTRY *kfld_ptr;
+ KEY_ENTRY *key_ptr;
bytecpy(&rn, rec, sizeof(INT));
if ( rn < 0 )
int
r_gmem(set, rec, mem_addr )
int set; /* set table entry number */
-char FAR *rec; /* pointer to record */
-char FAR *mem_addr; /* pointer to member pointer */
+char *rec; /* pointer to record */
+char *mem_addr; /* pointer to member pointer */
{
INT rt;
int mem, memtot;
- SET_ENTRY FAR *set_ptr;
- MEMBER_ENTRY FAR *mem_ptr;
+ SET_ENTRY *set_ptr;
+ MEMBER_ENTRY *mem_ptr;
/* search member list of set for record */
set_ptr = &set_table[set];
int
r_gset(set, rec, setptr )
int set; /* set table entry number */
-char FAR *rec; /* pointer to record */
-char FAR *setptr; /* pointer to set pointer */
+char *rec; /* pointer to record */
+char *setptr; /* pointer to set pointer */
{
INT rt;
int len;
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
set_ptr = &set_table[set];
bytecpy(&rt, rec, sizeof(INT));
int
r_pfld(field, fld_ptr, rec, data, db_addr )
INT field; /* field_table entry number */
-FIELD_ENTRY FAR *fld_ptr; /* corresponds to field */
-char FAR *rec; /* pointer to existing record */
-CONST char FAR *data; /* pointer to data area containing new field contents */
-DB_ADDR FAR *db_addr;
+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;
char memp[MEMPSIZE];
- char FAR *fptr;
- CONST char FAR *tfptr;
+ char *fptr;
+ CONST char *tfptr;
int s, i, strfld;
- FIELD_ENTRY FAR *sfld_ptr;
- SORT_ENTRY FAR *srt_ptr;
- DB_ADDR FAR *co_ptr, FAR *cm_ptr;
+ FIELD_ENTRY *sfld_ptr;
+ SORT_ENTRY *srt_ptr;
+ DB_ADDR *co_ptr, *cm_ptr;
db_status = S_OKAY;
fptr = rec + fld_ptr->fd_ptr;
int
r_pmem(set, rec, mem_addr )
int set; /* set table entry number */
-char FAR *rec; /* pointer to record */
-char FAR *mem_addr; /* pointer to member pointer */
+char *rec; /* pointer to record */
+char *mem_addr; /* pointer to member pointer */
{
INT rt;
int mem, memtot;
- SET_ENTRY FAR *set_ptr;
- MEMBER_ENTRY FAR *mem_ptr;
+ SET_ENTRY *set_ptr;
+ MEMBER_ENTRY *mem_ptr;
/* search member list of set for record */
set_ptr = &set_table[set];
int
r_pset(set, rec, setptr )
int set; /* set table entry number */
-char FAR *rec; /* pointer to record */
-char FAR *setptr; /* pointer to set pointer */
+char *rec; /* pointer to record */
+char *setptr; /* pointer to set pointer */
{
INT rt;
int len;
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
set_ptr = &set_table[set];
bytecpy(&rt, rec, sizeof(INT));
*/
int
r_smem( db_addr, set )
-DB_ADDR FAR *db_addr;
+DB_ADDR *db_addr;
INT set;
{
#ifndef NO_TIMESTAMP
int nset;
#endif
- char mem[MEMPSIZE], FAR *ptr;
+ char mem[MEMPSIZE], *ptr;
DB_ADDR dba;
bytecpy(&dba, db_addr, DB_ADDR_SIZE);
/* make sure record is owned */
- if ((dio_read(dba, (char FAR * FAR *)&ptr, NOPGHOLD) != S_OKAY) ||
+ if ((dio_read(dba, (char * *)&ptr, NOPGHOLD) != S_OKAY) ||
(r_gmem(set, ptr, mem) != S_OKAY))
return( db_status );
/* Set the optional key field "stored" bit */
int
r_setopt( fld_ptr, rec )
-FIELD_ENTRY FAR *fld_ptr; /* field table entry of optional key */
-char FAR *rec; /* Pointer to record */
+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 FAR *fld_ptr; /* Field table entry of optional key */
-char FAR *rec; /* Pointer to record */
+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 FAR *fld_ptr; /* Field table entry of optional key */
-char FAR *rec; /* Pointer to record */
+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 */
INT rectype;
FILE_NO ftype;
DB_ADDR dba;
- char FAR *recptr;
+ char *recptr;
#ifndef SINGLE_USER
int dbopen_sv;
#endif
F_ADDR rno, last;
- RECORD_ENTRY FAR *rec_ptr;
+ RECORD_ENTRY *rec_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
- if (nrec_check(rec, &rec, (RECORD_ENTRY FAR * FAR *)&rec_ptr) != S_OKAY)
+ if (nrec_check(rec, &rec, (RECORD_ENTRY * *)&rec_ptr) != S_OKAY)
RETURN( db_status );
#ifndef ONE_DB
rec -= curr_db_table->rt_offset;
#endif
/* read the record */
- dio_read( dba, (char FAR * FAR *)&recptr, NOPGHOLD );
+ dio_read( dba, (char * *)&recptr, NOPGHOLD );
#ifndef SINGLE_USER
dbopen = dbopen_sv;
#endif
DB_ADDR dba; /* current database addr we're scanning */
FILE_NO ftype; /* file desc for file holding rec */
F_ADDR last; /* last slot in file */
- char FAR *recptr; /* record from database */
- RECORD_ENTRY FAR *rec_ptr; /* RECORD ENTRY for this record */
+ char *recptr; /* record from database */
+ RECORD_ENTRY *rec_ptr; /* RECORD ENTRY for this record */
INT rectype; /* record type from record */
F_ADDR rno; /* current slot we're scanning */
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
/* validate and convert record number */
- if ( nrec_check(rec, &rec, (RECORD_ENTRY FAR * FAR *)&rec_ptr) != S_OKAY)
+ if ( nrec_check(rec, &rec, (RECORD_ENTRY * *)&rec_ptr) != S_OKAY)
RETURN( db_status );
/* get the last record # for this file */
dbopen_sv = dbopen;
dbopen = 2; /* setup to allow unlocked read */
#endif
- dio_read(dba, (char FAR * FAR *)&recptr, NOPGHOLD);
+ dio_read(dba, (char * *)&recptr, NOPGHOLD);
#ifndef SINGLE_USER
dbopen = dbopen_sv;
#endif
int dbopen_sv;
#endif
int rec_ndx; /* Index into record table */
- RECORD_ENTRY FAR *rec_ptr; /* Pointer to record table */
- char FAR *recptr;
+ RECORD_ENTRY *rec_ptr; /* Pointer to record table */
+ char *recptr;
F_ADDR rno, last;
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
rno = RN_REF(rn_dba) & ADDRMASK;
}
else { /* No current rec - get fno from rn_type */
- nrec_check(RN_REF(rn_type) + RECMARK, &rec_ndx, (RECORD_ENTRY FAR * FAR *)&rec_ptr);
+ nrec_check(RN_REF(rn_type) + RECMARK, &rec_ndx, (RECORD_ENTRY * *)&rec_ptr);
fno = (FILE_NO)NUM2EXT(rec_ptr->rt_file, ft_offset);
fno = (int)((fno >> FILESHIFT) & FILEMASK);
rno = 1;
#endif
/* read the record */
- dio_read( dba, (char FAR * FAR *)&recptr, NOPGHOLD );
+ dio_read( dba, (char * *)&recptr, NOPGHOLD );
#ifndef SINGLE_USER
dbopen = dbopen_sv;
#endif
FILE_NO fno; /* current file we're scanning */
F_ADDR last; /* last slot in file */
int rec_ndx; /* index of RECORD ENTRY (not used) */
- char FAR *recptr; /* record from database */
- RECORD_ENTRY FAR *rec_ptr; /* RECORD ENTRY for this record */
+ char *recptr; /* record from database */
+ RECORD_ENTRY *rec_ptr; /* RECORD ENTRY for this record */
INT rectype; /* record type from record */
F_ADDR rno; /* current slot we're scanning */
FILE_NO ft; /* normalized file */
rno = RN_REF(rn_dba) & ADDRMASK;
}
else { /* no current rec, get fno from rn_type */
- nrec_check(RN_REF(rn_type) + RECMARK, &rec_ndx, (RECORD_ENTRY FAR * FAR *)&rec_ptr);
+ nrec_check(RN_REF(rn_type) + RECMARK, &rec_ndx, (RECORD_ENTRY * *)&rec_ptr);
fno = NUM2EXT(rec_ptr->rt_file, ft_offset);
fno = (int)((fno >> FILESHIFT) & FILEMASK);
dbopen_sv = dbopen;
dbopen = 2; /* setup to allow for unlocked read */
#endif
- dio_read(dba, (char FAR * FAR *)&recptr, NOPGHOLD);
+ dio_read(dba, (char * *)&recptr, NOPGHOLD);
#ifndef SINGLE_USER
dbopen = dbopen_sv;
#endif
*/
int
d_recread(rec TASK_PARM DBN_PARM)
-char FAR *rec; /* ptr to record area */
+char *rec; /* ptr to record area */
TASK_DECL
DBN_DECL
{
#ifndef SINGLE_USER
int dbopen_sv;
#endif
- RECORD_ENTRY FAR *rec_ptr;
+ RECORD_ENTRY *rec_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
#endif
/* read current record */
- dio_read( curr_rec, (char FAR * FAR *)&crloc, NOPGHOLD);
+ dio_read( curr_rec, (char * *)&crloc, NOPGHOLD);
#ifndef SINGLE_USER
dbopen = dbopen_sv;
#endif
FILE_NO rfile; /* file containing user specified rec */
FILE_NO fno; /* file containing current record */
int rec_ndx; /* Index into record table */
- RECORD_ENTRY FAR *rec_ptr; /* Pointer to record table */
+ RECORD_ENTRY *rec_ptr; /* Pointer to record table */
DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_NOIO));
/* Check rec parameter user passed */
- if (nrec_check(rec, &rec_ndx, (RECORD_ENTRY FAR * FAR *)&rec_ptr) != S_OKAY)
+ if (nrec_check(rec, &rec_ndx, (RECORD_ENTRY * *)&rec_ptr) != S_OKAY)
RETURN( db_status );
/* Check to make sure current record is in this file */
TASK_DECL
{
INT rec;
- char FAR *ptr;
+ char *ptr;
ULONG cts, uts;
DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(RECORD_IO));
- if ((check_dba(dba) != S_OKAY) || (dio_read(dba, (char FAR * FAR *)&ptr, NOPGHOLD) != S_OKAY))
+ if ((check_dba(dba) != S_OKAY) || (dio_read(dba, (char * *)&ptr, NOPGHOLD) != S_OKAY))
RETURN( db_status );
/* get record id */
*/
int
d_recwrite(rec TASK_PARM DBN_PARM)
-CONST char FAR *rec; /* ptr to record area */
+CONST char *rec; /* ptr to record area */
TASK_DECL
DBN_DECL
{
ULONG timestamp;
#endif
INT rt; /* record type */
- char FAR *fptr; /* field data pointer */
+ char *fptr; /* field data pointer */
char ckey[256]; /* current compound key data */
char nkey[256]; /* new compound key data */
int stat;
int fld;
- RECORD_ENTRY FAR *rec_ptr;
- FIELD_ENTRY FAR *fld_ptr;
+ RECORD_ENTRY *rec_ptr;
+ FIELD_ENTRY *fld_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
RETURN( dberr(S_NOCR) );
/* Read current record */
- if ( dio_read( curr_rec, (char FAR * FAR *)&crloc, PGHOLD) != S_OKAY )
+ if ( dio_read( curr_rec, (char * *)&crloc, PGHOLD) != S_OKAY )
RETURN( db_status );
/* Copy record type from record */
/* Build compound key for new data supplied by user. Note: cflag
must be the same here as in the 1st key_bldcom for r_chkfld */
if ( fld_ptr->fd_type == COMKEY ) {
- key_bldcom(fld, (char FAR *)rec, nkey, FALSE);
+ key_bldcom(fld, (char *)rec, nkey, FALSE);
fptr = nkey;
}
else
- fptr = (char FAR *)rec + fld_ptr->fd_ptr - rec_ptr->rt_data;
+ fptr = (char *)rec + fld_ptr->fd_ptr - rec_ptr->rt_data;
if ( ! (fld_ptr->fd_flags & STRUCTFLD) ) {
if ( (stat = r_chkfld(fld, fld_ptr, crloc, fptr)) != S_OKAY ) {
if ( fld_ptr->fd_type == COMKEY ) {
/* build old and new keys */
key_bldcom(fld, crloc + rec_ptr->rt_data, ckey, TRUE);
- key_bldcom(fld, (char FAR *)rec, nkey, TRUE);
+ key_bldcom(fld, (char *)rec, nkey, TRUE);
/* make sure value has changed */
if ((fldcmp(fld_ptr, ckey, nkey) != 0) &&
*/
int
d_renfile(dbn, fno, fnm TASK_PARM)
-CONST char FAR *dbn; /* database containing file to be renamed */
+CONST char *dbn; /* database containing file to be renamed */
FILE_NO fno; /* file id number for file to be renamed */
-CONST char FAR *fnm; /* new file name */
+CONST char *fnm; /* new file name */
TASK_DECL
{
REN_ENTRY_P r;
if ( dbopen ) RETURN( dberr(S_DBOPEN) );
- r.ptr = (REN_ENTRY FAR *)ALLOC(&r, sizeof(REN_ENTRY), "r");
+ r.ptr = (REN_ENTRY *)ALLOC(&r, sizeof(REN_ENTRY), "r");
if ( r.ptr == NULL )
RETURN( dberr(S_NOMEMORY) );
ll_access(&ren_list);
- if ( ll_append(&ren_list, (CHAR_P FAR *)&r) != S_OKAY ) {
+ if ( ll_append(&ren_list, (CHAR_P *)&r) != S_OKAY ) {
RETURN( db_status );
}
r.ptr->Ren_db_name.ptr =
renfiles()
{
int dbt_lc; /* loop control */
- REN_ENTRY_P FAR *rp;
+ REN_ENTRY_P *rp;
#ifndef ONE_DB
- DB_ENTRY FAR *db_ptr;
+ DB_ENTRY *db_ptr;
#endif
if ( ll_access(&ren_list) ) {
#ifndef ONE_DB
db_ptr = curr_db_table; /* Have to save it because of macros */
#endif
- while ((rp = (REN_ENTRY_P FAR *)ll_next(&ren_list)) != NULL) {
+ while ((rp = (REN_ENTRY_P *)ll_next(&ren_list)) != NULL) {
MEM_LOCK(&rp->ptr->Ren_db_name);
MEM_LOCK(&rp->ptr->File_name);
#ifndef ONE_DB
int
d_rdcurr(currbuff, currsize TASK_PARM)
DB_ADDR **currbuff;
-int FAR *currsize;
+int *currsize;
TASK_DECL
{
int cs;
DB_ADDR **currbuff;
TASK_DECL
{
- DB_ADDR FAR *cb_ptr;
+ DB_ADDR *cb_ptr;
DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(SET_NOIO));
DB_ADDR *currbuff;
TASK_DECL
{
- DB_ADDR FAR *cb_ptr;
+ DB_ADDR *cb_ptr;
DB_ENTER(NO_DB_ID TASK_ID LOCK_SET(SET_NOIO));
{
int cmtype; /* current member type */
int mem;
- SET_ENTRY FAR *set_ptr;
- MEMBER_ENTRY FAR *mem_ptr;
+ SET_ENTRY *set_ptr;
+ MEMBER_ENTRY *mem_ptr;
int memtot;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
if ((d_cmtype(sets, &cmtype TASK_PARM DBN_PARM) != S_OKAY) ||
- (nset_check(sett, &sett, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY))
+ (nset_check(sett, &sett, (SET_ENTRY * *)&set_ptr) != S_OKAY))
RETURN( db_status );
cmtype += NUM2INT(-RECMARK, rt_offset);
DBN_DECL /* database number */
{
int mem;
- SET_ENTRY FAR *setm_ptr, FAR *seto_ptr;
- MEMBER_ENTRY FAR *mem_ptr;
+ SET_ENTRY *setm_ptr, *seto_ptr;
+ MEMBER_ENTRY *mem_ptr;
int memtot;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if ((nset_check(seto, &seto, (SET_ENTRY FAR * FAR *)&seto_ptr) != S_OKAY) ||
- (nset_check(setm, &setm, (SET_ENTRY FAR * FAR *)&setm_ptr) != S_OKAY))
+ if ((nset_check(seto, &seto, (SET_ENTRY * *)&seto_ptr) != S_OKAY) ||
+ (nset_check(setm, &setm, (SET_ENTRY * *)&setm_ptr) != S_OKAY))
RETURN( db_status );
- if (null_dba((char FAR *)&curr_own[seto])) RETURN( dberr(S_NOCO) );
+ if (null_dba((char *)&curr_own[seto])) RETURN( dberr(S_NOCO) );
for (mem = setm_ptr->st_members, memtot = mem + setm_ptr->st_memtot,
mem_ptr = &member_table[mem];
{
int crtype; /* current record type */
int mem;
- SET_ENTRY FAR *set_ptr;
- MEMBER_ENTRY FAR *mem_ptr;
+ SET_ENTRY *set_ptr;
+ MEMBER_ENTRY *mem_ptr;
int memtot;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
if ( ! curr_rec )
{
int seto, setm;
int cmtype; /* current record type */
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
if ((d_cmtype(nsetm, &cmtype TASK_PARM DBN_PARM) != S_OKAY) ||
- (nset_check(nseto, &seto, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY))
+ (nset_check(nseto, &seto, (SET_ENTRY * *)&set_ptr) != S_OKAY))
RETURN( db_status );
cmtype += NUM2INT(-RECMARK, rt_offset);
setm = NUM2INT(nsetm - SETMARK, st_offset);
DBN_DECL /* database number */
{
int sett, sets;
- SET_ENTRY FAR *sett_ptr, FAR *sets_ptr;
+ SET_ENTRY *sett_ptr, *sets_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if ((nset_check(nsett, &sett, (SET_ENTRY FAR * FAR *)&sett_ptr) != S_OKAY) ||
- (nset_check(nsets, &sets, (SET_ENTRY FAR * FAR *)&sets_ptr) != S_OKAY))
+ if ((nset_check(nsett, &sett, (SET_ENTRY * *)&sett_ptr) != S_OKAY) ||
+ (nset_check(nsets, &sets, (SET_ENTRY * *)&sets_ptr) != S_OKAY))
RETURN( db_status );
if ( sett_ptr->st_own_rt != sets_ptr->st_own_rt )
RETURN( dberr( S_INVOWN ) );
- if (null_dba((char FAR *)&curr_own[sets]))
+ if (null_dba((char *)&curr_own[sets]))
RETURN( dberr(S_NOCO) );
curr_own[sett] = curr_own[sets];
{
int set;
int crtype; /* current record type */
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if ((nset_check(nset, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY) ||
+ if ((nset_check(nset, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY) ||
(d_crtype(&crtype TASK_PARM DBN_PARM) != S_OKAY))
RETURN( db_status );
TASK_DECL
DBN_DECL /* database number */
{
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_NOIO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
if ( ! curr_mem[set] )
TASK_DECL
DBN_DECL /* database number */
{
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_NOIO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
if ( ! curr_own[set] )
db_status = S_OKAY;
if ( ! db_glob_init ) {
#ifdef MULTI_TASK
- Currtask.v.ptr = (TASK FAR *)&db_global;
+ Currtask.v.ptr = (TASK *)&db_global;
#endif
taskinit(&db_global);
db_glob_init = 1;
TASK_DECL
DBN_DECL
{
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_NOIO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current member */
TASK_DECL
DBN_DECL
{
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_NOIO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current owner */
TASK_DECL
DBN_DECL
{
- SET_ENTRY FAR *set_ptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_NOIO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current owner */
*/
-int EXTERNAL_FIXED dt_opentask(P1(DB_TASK FAR *));
+int EXTERNAL_FIXED dt_opentask(P1(DB_TASK *));
int EXTERNAL_FIXED dt_closetask(P1(DB_TASK));
int EXTERNAL_FIXED dt_close(TASK_D1); /* dblfcns.c */
int EXTERNAL_DBN dt_cmstat(P1(int) TASK_Di DBN_Dn); /* cmstat.c */
-int EXTERNAL_DBN dt_cmtype(P1(int) Pi(int FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_cmtype(P1(int) Pi(int *) TASK_Di DBN_Dn);
/* cmtype.c */
int EXTERNAL_DBN dt_connect(P1(int) TASK_Di DBN_Dn); /* connect.c */
#ifndef NO_TIMESTAMP
int EXTERNAL_DBN dt_costat(P1(int) TASK_Di DBN_Dn); /* costat.c */
#endif
-int EXTERNAL_DBN dt_cotype(P1(int) Pi(int FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_cotype(P1(int) Pi(int *) TASK_Di DBN_Dn);
/* cotype.c */
-int EXTERNAL_DBN dt_crget(P1(DB_ADDR FAR *) TASK_Di DBN_Dn); /* crget.c */
-int EXTERNAL_DBN dt_crread(P1(long) Pi(char FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_crget(P1(DB_ADDR *) TASK_Di DBN_Dn); /* crget.c */
+int EXTERNAL_DBN dt_crread(P1(long) Pi(char *) TASK_Di DBN_Dn);
/* crread.c */
-int EXTERNAL_DBN dt_crset(P1(DB_ADDR FAR *) TASK_Di DBN_Dn); /* crset.c */
+int EXTERNAL_DBN dt_crset(P1(DB_ADDR *) TASK_Di DBN_Dn); /* crset.c */
#ifndef NO_TIMESTAMP
int EXTERNAL_FIXED dt_crstat(TASK_D1); /* crstat.c */
#endif
-int EXTERNAL_DBN dt_crtype(P1(int FAR *) TASK_Di DBN_Dn); /* crtype.c */
-int EXTERNAL_DBN dt_crwrite(P1(long) Pi(char FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_crtype(P1(int *) TASK_Di DBN_Dn); /* crtype.c */
+int EXTERNAL_DBN dt_crwrite(P1(long) Pi(char *) TASK_Di DBN_Dn);
/* crwrite.c */
-int EXTERNAL_DBN dt_csmget(P1(int) Pi(DB_ADDR FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_csmget(P1(int) Pi(DB_ADDR *) TASK_Di DBN_Dn);
/* csmget.c */
-int EXTERNAL_DBN dt_csmread(P1(int) Pi(long) Pi(char FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_csmread(P1(int) Pi(long) Pi(char *) TASK_Di DBN_Dn);
/* csmread.c */
-int EXTERNAL_DBN dt_csmset(P1(int) Pi(DB_ADDR FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_csmset(P1(int) Pi(DB_ADDR *) TASK_Di DBN_Dn);
/* csmset.c */
-int EXTERNAL_DBN dt_csmwrite(P1(int) Pi(long) Pi(CONST char FAR *) TASK_Di
+int EXTERNAL_DBN dt_csmwrite(P1(int) Pi(long) Pi(CONST char *) TASK_Di
DBN_Dn); /* csmwrite.c */
-int EXTERNAL_DBN dt_csoget(P1(int) Pi(DB_ADDR FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_csoget(P1(int) Pi(DB_ADDR *) TASK_Di DBN_Dn);
/* csoget.c */
-int EXTERNAL_DBN dt_csoread(P1(int) Pi(long) Pi(char FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_csoread(P1(int) Pi(long) Pi(char *) TASK_Di DBN_Dn);
/* csoread.c */
-int EXTERNAL_DBN dt_csoset(P1(int) Pi(DB_ADDR FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_csoset(P1(int) Pi(DB_ADDR *) TASK_Di DBN_Dn);
/* csoset.c */
-int EXTERNAL_DBN dt_csowrite(P1(int) Pi(long) Pi(CONST char FAR *) TASK_Di
+int EXTERNAL_DBN dt_csowrite(P1(int) Pi(long) Pi(CONST char *) TASK_Di
DBN_Dn); /* csowrite.c */
#ifndef NO_TIMESTAMP
int EXTERNAL_DBN dt_csstat(P1(int) TASK_Di DBN_Dn); /* csstat.c */
-int EXTERNAL_DBN dt_ctscm(P1(int) Pi(ULONG FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_ctscm(P1(int) Pi(ULONG *) TASK_Di DBN_Dn);
/* ctscm.c */
-int EXTERNAL_DBN dt_ctsco(P1(int) Pi(ULONG FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_ctsco(P1(int) Pi(ULONG *) TASK_Di DBN_Dn);
/* ctsco.c */
-int EXTERNAL_FIXED dt_ctscr(P1(ULONG FAR *) TASK_Di ); /* ctscr.c */
+int EXTERNAL_FIXED dt_ctscr(P1(ULONG *) TASK_Di ); /* ctscr.c */
#endif
#ifndef NO_COUNTRY
-int EXTERNAL_FIXED dt_ctbpath(P1(CONST char FAR *) TASK_Di); /* pathfcns.c */
+int EXTERNAL_FIXED dt_ctbpath(P1(CONST char *) TASK_Di); /* pathfcns.c */
#endif
-int EXTERNAL_FIXED dt_dbdpath(P1(CONST char FAR *) TASK_Di ); /* dbdpath.c */
-int EXTERNAL_FIXED dt_dbfpath(P1(CONST char FAR *) TASK_Di ); /* dbfpath.c */
-int EXTERNAL_FIXED dt_dblog(P1(CONST char FAR *) TASK_Di ); /* dblog.c */
-int EXTERNAL_FIXED dt_dbuserid(P1(CONST char FAR *) TASK_Di ); /* dbuserid.c */
+int EXTERNAL_FIXED dt_dbdpath(P1(CONST char *) TASK_Di ); /* dbdpath.c */
+int EXTERNAL_FIXED dt_dbfpath(P1(CONST char *) TASK_Di ); /* dbfpath.c */
+int EXTERNAL_FIXED dt_dblog(P1(CONST char *) TASK_Di ); /* dblog.c */
+int EXTERNAL_FIXED dt_dbuserid(P1(CONST char *) TASK_Di ); /* dbuserid.c */
int EXTERNAL_DBN dt_delete(TASK_D1 DBN_Dn); /* delete.c */
int EXTERNAL_DBN dt_disdel(TASK_D1 DBN_Dn); /* disdel.c */
int EXTERNAL_DBN dt_recnext(TASK_D1 DBN_Dn); /* recnext.c */
int EXTERNAL_DBN dt_recprev(TASK_D1 DBN_Dn); /* recprev.c */
-int EXTERNAL_FIXED dt_destroy(P1(CONST char FAR *) TASK_Di ); /* destroy.c */
+int EXTERNAL_FIXED dt_destroy(P1(CONST char *) TASK_Di ); /* destroy.c */
int EXTERNAL_DBN dt_discon(P1(int) TASK_Di DBN_Dn); /* discon.c */
-int EXTERNAL_DBN dt_fillnew(P1(int) Pi(CONST char FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_fillnew(P1(int) Pi(CONST char *) TASK_Di DBN_Dn);
/* fillnew.c */
int EXTERNAL_DBN dt_findco(P1(int) TASK_Di DBN_Dn); /* findco.c */
int EXTERNAL_DBN dt_findfm(P1(int) TASK_Di DBN_Dn); /* findfm.c */
int EXTERNAL_DBN dt_findpm(P1(int) TASK_Di DBN_Dn); /* findpm.c */
int EXTERNAL_FIXED dt_freeall(TASK_D1); /* dblfcns.c */
#ifndef NO_TIMESTAMP
-int EXTERNAL_DBN dt_gtscm(P1(int) Pi(ULONG FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_gtscm(P1(int) Pi(ULONG *) TASK_Di DBN_Dn);
/* gtscm.c */
-int EXTERNAL_DBN dt_gtsco(P1(int) Pi(ULONG FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_gtsco(P1(int) Pi(ULONG *) TASK_Di DBN_Dn);
/* gtsco.c */
-int EXTERNAL_FIXED dt_gtscr(P1(ULONG FAR *) TASK_Di ); /* gtscr.c */
-int EXTERNAL_DBN dt_gtscs(P1(int) Pi(ULONG FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_FIXED dt_gtscr(P1(ULONG *) TASK_Di ); /* gtscr.c */
+int EXTERNAL_DBN dt_gtscs(P1(int) Pi(ULONG *) TASK_Di DBN_Dn);
/* gtscs.c */
#endif
int EXTERNAL_DBN dt_initialize(TASK_D1 DBN_Dn); /* initial.c */
int EXTERNAL_DBN dt_isowner(P1(int) TASK_Di DBN_Dn); /* isowner.c */
int EXTERNAL_DBN dt_keydel(P1(long) TASK_Di DBN_Dn); /* keydel.c */
int EXTERNAL_DBN dt_keyexist(P1(long) TASK_Di DBN_Dn); /* keyexist.c */
-int EXTERNAL_DBN dt_keyfind(P1(long) Pi(CONST char FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_keyfind(P1(long) Pi(CONST char *) TASK_Di DBN_Dn);
/* keyfind.c */
int EXTERNAL_DBN dt_keyfree(P1(long) TASK_Di DBN_Dn); /* dblfcns.c */
int EXTERNAL_DBN dt_keyfrst(P1(long) TASK_Di DBN_Dn); /* keyfrst.c */
int EXTERNAL_DBN dt_keylast(P1(long) TASK_Di DBN_Dn); /* keylast.c */
-int EXTERNAL_DBN dt_keylock(P1(long) Pi(char FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_keylock(P1(long) Pi(char *) TASK_Di DBN_Dn);
/* dblfcns.c */
-int EXTERNAL_DBN dt_keylstat(P1(long) Pi(char FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_keylstat(P1(long) Pi(char *) TASK_Di DBN_Dn);
/* dblfcns.c */
int EXTERNAL_DBN dt_keynext(P1(long) TASK_Di DBN_Dn); /* keynext.c */
int EXTERNAL_DBN dt_keyprev(P1(long) TASK_Di DBN_Dn); /* keyprev.c */
-int EXTERNAL_FIXED dt_keyread(P1(char FAR *) TASK_Di ); /* keyfcns.c */
+int EXTERNAL_FIXED dt_keyread(P1(char *) TASK_Di ); /* keyfcns.c */
int EXTERNAL_DBN dt_keystore(P1(long) TASK_Di DBN_Dn); /* keystore.c */
-int EXTERNAL_DBN dt_lock(P1(int) Pi(LOCK_REQUEST FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_lock(P1(int) Pi(LOCK_REQUEST *) TASK_Di DBN_Dn);
/* dblfcns.c */
int EXTERNAL_DBN dt_makenew(P1(int) TASK_Di DBN_Dn); /* makenew.c */
int EXTERNAL_FIXED dt_mapchar(P1(unsigned char) Pi(unsigned char)
- Pi(CONST char FAR *) Pi(unsigned char) TASK_Di);
+ Pi(CONST char *) Pi(unsigned char) TASK_Di);
/* mapchar.c */
-int EXTERNAL_DBN dt_members(P1(int) Pi(LONG FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_members(P1(int) Pi(LONG *) TASK_Di DBN_Dn);
/* members.c */
int EXTERNAL_FIXED dt_off_opt(P1(int) TASK_Di ); /* options.c */
int EXTERNAL_FIXED dt_on_opt(P1(int) TASK_Di ); /* options.c */
-int EXTERNAL_FIXED dt_open(P1(CONST char FAR *) Pi(CONST char FAR *) TASK_Di);
+int EXTERNAL_FIXED dt_open(P1(CONST char *) Pi(CONST char *) TASK_Di);
/* dblfcns.c */
-int EXTERNAL_FIXED dt_rdcurr(P1(DB_ADDR FAR **) Pi(int FAR *) TASK_Di);
+int EXTERNAL_FIXED dt_rdcurr(P1(DB_ADDR **) Pi(int *) TASK_Di);
/* rwcurr.c */
-int EXTERNAL_FIXED dt_rerdcurr(P1(DB_ADDR FAR **) TASK_Di); /* rwcurr.c */
-int EXTERNAL_FIXED dt_wrcurr(P1(DB_ADDR FAR *) TASK_Di); /* rwcurr.c */
+int EXTERNAL_FIXED dt_rerdcurr(P1(DB_ADDR **) TASK_Di); /* rwcurr.c */
+int EXTERNAL_FIXED dt_wrcurr(P1(DB_ADDR *) TASK_Di); /* rwcurr.c */
int EXTERNAL_DBN dt_recfree(P1(int) TASK_Di DBN_Dn); /* dblfcns.c */
int EXTERNAL_DBN dt_recfrst(P1(int) TASK_Di DBN_Dn); /* recfrst.c */
int EXTERNAL_DBN dt_reclast(P1(int) TASK_Di DBN_Dn); /* reclast.c */
-int EXTERNAL_DBN dt_reclock(P1(int) Pi(char FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_reclock(P1(int) Pi(char *) TASK_Di DBN_Dn);
/* dblfcns.c */
-int EXTERNAL_DBN dt_reclstat(P1(int) Pi(char FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_reclstat(P1(int) Pi(char *) TASK_Di DBN_Dn);
/* dblfcns.c */
-int EXTERNAL_FIXED dt_recover(P1(CONST char FAR *) TASK_Di ); /* recover.c */
-int EXTERNAL_DBN dt_recread(P1(char FAR *) TASK_Di DBN_Dn); /* recread.c */
+int EXTERNAL_FIXED dt_recover(P1(CONST char *) TASK_Di ); /* recover.c */
+int EXTERNAL_DBN dt_recread(P1(char *) TASK_Di DBN_Dn); /* recread.c */
int EXTERNAL_DBN dt_recset(P1(int) TASK_Di DBN_Dn); /* recset.c */
#ifndef NO_TIMESTAMP
int EXTERNAL_FIXED dt_recstat(P1(DB_ADDR) Pi(ULONG) TASK_Di ); /* recstat.c */
#endif
-int EXTERNAL_DBN dt_recwrite(P1(CONST char FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_recwrite(P1(CONST char *) TASK_Di DBN_Dn);
/* recwrite.c */
-int EXTERNAL_FIXED dt_renfile(P1(CONST char FAR *) Pi(FILE_NO)
- Pi(CONST char FAR *) TASK_Di); /* renfile.c */
+int EXTERNAL_FIXED dt_renfile(P1(CONST char *) Pi(FILE_NO)
+ Pi(CONST char *) TASK_Di); /* renfile.c */
int EXTERNAL_FIXED dt_retries(P1(int) TASK_Di ); /* dblfcns.c */
int EXTERNAL_FIXED dt_rlbclr(TASK_D1); /* dblfcns.c */
int EXTERNAL_FIXED dt_rlbset(TASK_D1); /* dblfcns.c */
int EXTERNAL_FIXED dt_setdb(P1(int) TASK_Di); /* setdb.c */
#endif
int EXTERNAL_DBN dt_setfree(P1(int) TASK_Di DBN_Dn); /* dblfcns.c */
-int EXTERNAL_DBN dt_setkey(P1(long) Pi(CONST char FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_setkey(P1(long) Pi(CONST char *) TASK_Di DBN_Dn);
/* makenew.c */
-int EXTERNAL_DBN dt_setlock(P1(int) Pi(char FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_setlock(P1(int) Pi(char *) TASK_Di DBN_Dn);
/* dblfcns.c */
-int EXTERNAL_DBN dt_setlstat(P1(int) Pi(char FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_setlstat(P1(int) Pi(char *) TASK_Di DBN_Dn);
/* dblfcns.c */
int EXTERNAL_DBN dt_setmm(P1(int) Pi(int) TASK_Di DBN_Dn); /* setmm.c */
int EXTERNAL_DBN dt_setmo(P1(int) Pi(int) TASK_Di DBN_Dn); /* setmo.c */
#endif
int EXTERNAL_FIXED dt_timeout(P1(int) TASK_Di ); /* dblfcns.c */
int EXTERNAL_FIXED dt_trabort(TASK_D1); /* dblfcns.c */
-int EXTERNAL_FIXED dt_trbegin(P1(CONST char FAR *) TASK_Di); /* dblfcns.c */
+int EXTERNAL_FIXED dt_trbegin(P1(CONST char *) TASK_Di); /* dblfcns.c */
int EXTERNAL_FIXED dt_trend(TASK_D1); /* dblfcns.c */
#ifndef NO_TIMESTAMP
-int EXTERNAL_DBN dt_utscm(P1(int) Pi(ULONG FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_utscm(P1(int) Pi(ULONG *) TASK_Di DBN_Dn);
/* utscm.c */
-int EXTERNAL_DBN dt_utsco(P1(int) Pi(ULONG FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_DBN dt_utsco(P1(int) Pi(ULONG *) TASK_Di DBN_Dn);
/* utsco.c */
-int EXTERNAL_FIXED dt_utscr(P1(ULONG FAR *) TASK_Di ); /* utscr.c */
-int EXTERNAL_DBN dt_utscs(P1(int) Pi(ULONG FAR *) TASK_Di DBN_Dn);
+int EXTERNAL_FIXED dt_utscr(P1(ULONG *) TASK_Di ); /* utscr.c */
+int EXTERNAL_DBN dt_utscs(P1(int) Pi(ULONG *) TASK_Di DBN_Dn);
/* utscs.c */
#endif
*/
d_utscm(set, timestamp TASK_PARM DBN_PARM)
int set;
-ULONG FAR *timestamp;
+ULONG *timestamp;
TASK_DECL
DBN_DECL
{
INT rec;
- char FAR *rptr;
- SET_ENTRY FAR *set_ptr;
+ char *rptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current member */
RETURN( dberr(S_NOCM) );
/* read current member */
- if ( dio_read( curr_mem[set], (char FAR * FAR *)&rptr , NOPGHOLD) != S_OKAY )
+ if ( dio_read( curr_mem[set], (char * *)&rptr , NOPGHOLD) != S_OKAY )
RETURN( db_status );
/* get record id */
*/
d_utsco(set, timestamp TASK_PARM DBN_PARM)
int set;
-ULONG FAR *timestamp;
+ULONG *timestamp;
TASK_DECL
DBN_DECL
{
INT rec;
- char FAR *rptr;
- SET_ENTRY FAR *set_ptr;
+ char *rptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current owner */
RETURN( dberr(S_NOCO) );
/* read current owner */
- if ( dio_read( curr_own[set], (char FAR * FAR *)&rptr , NOPGHOLD) != S_OKAY )
+ if ( dio_read( curr_own[set], (char * *)&rptr , NOPGHOLD) != S_OKAY )
RETURN( db_status );
/* get record id */
/* Get update timestamp of current record
*/
d_utscr(timestamp TASK_PARM)
-ULONG FAR *timestamp;
+ULONG *timestamp;
TASK_DECL
{
INT rec;
dbopen_sv = dbopen;
dbopen = 2;
/* read current record */
- if ( dio_read( curr_rec, (char FAR * FAR *)&crloc , NOPGHOLD) != S_OKAY )
+ if ( dio_read( curr_rec, (char * *)&crloc , NOPGHOLD) != S_OKAY )
RETURN( db_status );
dbopen = dbopen_sv;
*/
d_utscs(set, timestamp TASK_PARM DBN_PARM)
int set;
-ULONG FAR *timestamp;
+ULONG *timestamp;
TASK_DECL
DBN_DECL
{
INT rec;
- char FAR *rptr;
- SET_ENTRY FAR *set_ptr;
+ char *rptr;
+ SET_ENTRY *set_ptr;
DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO));
- if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY)
+ if (nset_check(set, &set, (SET_ENTRY * *)&set_ptr) != S_OKAY)
RETURN( db_status );
/* make sure we have a current owner */
RETURN( dberr(S_NOCO) );
/* read current owner */
- if ( dio_read( curr_own[set], (char FAR * FAR *)&rptr , NOPGHOLD) != S_OKAY )
+ if ( dio_read( curr_own[set], (char * *)&rptr , NOPGHOLD) != S_OKAY )
RETURN( db_status );
/* get record id to ensure record not deleted */
#endif /* MSC */
#endif /* GENERAL lockmgr */
-#ifndef FAR
-#define FAR /**/
-#endif
-
#ifndef PASCAL
#define PASCAL /**/
#endif
#define CDECL /**/
#endif
-#define EXTERNAL_FIXED FAR PASCAL
-#define EXTERNAL_VARIABLE FAR CDECL
+#define EXTERNAL_FIXED PASCAL
+#define EXTERNAL_VARIABLE CDECL
#define INTERNAL_FIXED PASCAL
#define INTERNAL_VARIABLE CDECL
-typedef int (FAR PASCAL *FARPROC)();
+typedef int (PASCAL *FARPROC)();
typedef char *HANDLE;
#ifdef NO_DBN_PARM
#define POINTER_INIT() { NULL }
#define POINTER_ASSIGN(a) { a }
-typedef struct {char FAR *ptr; LOCK_DESC} CHAR_P;
-typedef struct {DB_ADDR FAR *ptr; LOCK_DESC} DB_ADDR_P;
+typedef struct {char *ptr; LOCK_DESC} CHAR_P;
+typedef struct {DB_ADDR *ptr; LOCK_DESC} DB_ADDR_P;
#ifdef MULTI_TASK
-typedef struct {struct TASK_S FAR *ptr; LOCK_DESC} TASK_P;
-typedef struct {char FAR *ptr; LOCK_DESC} QFAKE_P;
+typedef struct {struct TASK_S *ptr; LOCK_DESC} TASK_P;
+typedef struct {char *ptr; LOCK_DESC} QFAKE_P;
typedef struct {
TASK_P v;
QFAKE_P q;
#define TASK_DBN_D1 P1(DB_TASK) DBN_Dn
#define TASK_D1 P1(DB_TASK)
#define TASK_Di Pi(DB_TASK)
-#define TASK_PTR_D1 P1(DB_TASK FAR *)
-#define TASK_PTR_Di Pi(DB_TASK FAR *)
+#define TASK_PTR_D1 P1(DB_TASK *)
+#define TASK_PTR_Di Pi(DB_TASK *)
#define CURRTASK_PARM , Currtask
#define CURRTASK_ONLY Currtask
#else