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

libDtSearch: remove optional code MULTI_TASK that is not used on CDE

This commit is contained in:
Peter Howkins 2018-06-29 00:07:36 +01:00
parent af9f0e9033
commit 605a21046a
8 changed files with 0 additions and 186 deletions

View file

@ -174,10 +174,6 @@ int db_glob_init = 0;
static LR_LOCK lock_reply; /* This used to be in db_global */
#endif
#ifdef MULTI_TASK
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 */
extern LOOKUP_ENTRY_P Db_lookup; /* database page lookup table */
extern PAGE_ENTRY_P Dbpg_table; /* database page table */
@ -991,9 +987,6 @@ TASK_DECL
size_kt = 0;
no_of_keys = 0;
dbopen = 0;
#ifdef MULTI_TASK
bytecpy(task.v.ptr, &db_global, sizeof(TASK));
#endif
}
RETURN( db_status );
} /* d_close() */

View file

@ -380,21 +380,12 @@ typedef struct RN_ENTRY_S {
#define TABLE_SIZE(size) DB_REF(size)
/* DBN_PARM... and TASK_PARM... are used for function interfaces */
#ifdef MULTI_TASK
#define TASK_PARM , task
#define TASK_PARM_DBN task ,
#define TASK_ONLY task
#define TASK_DECL DB_TASK task;
#define TASK_PTR_DECL DB_TASK *task;
#define TASK_DBN_ONLY task DBN_PARM
#else
#define TASK_PARM /**/
#define TASK_PARM_DBN /**/
#define TASK_ONLY /**/
#define TASK_DECL /**/
#define TASK_PTR_DECL /**/
#define TASK_DBN_ONLY DBN_ONLY
#endif
#ifndef NO_COUNTRY
/* Country code table definition */
@ -546,25 +537,10 @@ typedef struct MESSAGE_S {
#define NO_DB_ID /**/
#endif /* NO_DBN */
#ifdef MULTI_TASK
#ifdef COMMA
#define TASK_ID , &task
#define TASK_PTR_ID , task
#define NO_TASK_ID , NULL
#define TASK_PARAM , c
#else
#define TASK_ID &task
#define TASK_PTR_ID task
#define NO_TASK_ID NULL
#define TASK_PARAM c
#define COMMA
#endif
#else
#define TASK_PARAM /**/
#define TASK_ID /**/
#define TASK_PTR_ID /**/
#define NO_TASK_ID /**/
#endif
#define LOCK_PARAM /**/
#define LOCK_PARM /**/
@ -606,9 +582,6 @@ typedef struct MESSAGE_S {
#include "dbxtrn.h"
typedef struct LOOKUP_ENTRY_S {
#ifdef MULTI_TASK
TASK *task; /* task pointer */
#endif
FILE_NO file; /* file table entry number (0..size_ft-1) */
F_ADDR pageno; /* database page number */
short pg_slot; /* page table slot pointing to this entry */
@ -632,11 +605,6 @@ typedef struct page_entry {
#define _STRING_H
#endif
#include "proto.h"
#ifdef MULTI_TASK
#ifdef NO_DT_COVER
#include "dtcover.h"
#endif
#endif
#ifndef SINGLE_USER
/* record/set lock descriptor */

View file

@ -277,12 +277,5 @@ typedef struct TASK_S {
extern TASK db_global;
extern int db_glob_init;
#ifdef MULTI_TASK
extern DB_TASK Currtask;
#endif
#ifdef MULTI_TASK
extern int task_count;
#endif
/* vpp -nOS2 -dUNIX -nBSD -nVANILLA_BSD -nVMS -nMEMLOCK -nWINDOWS -nFAR_ALLOC -f/usr/users/master/config/nonwin dbxtrn.h */

View file

@ -184,9 +184,6 @@ LOOKUP_ENTRY_P Db_lookup = POINTER_INIT(); /* database page lookup table */
PAGE_ENTRY_P Dbpg_table = POINTER_INIT(); /* database page table */
static struct
{
#ifdef MULTI_TASK
TASK *task;
#endif
FILE_NO file;
F_ADDR pageno;
int slot;
@ -401,9 +398,6 @@ dio_init()
return( dberr(S_NOMEMORY) );
byteset(used_files, 0, (size_ft + 1)*sizeof(*used_files));
#ifdef MULTI_TASK
last_dblu.task = NULL;
#endif
last_dblu.file = -1;
last_dblu.pageno = -1L;
last_dblu.slot = -1;
@ -470,9 +464,6 @@ int pgsize;
for (pg_no = 0; pg_no < pg_cnt; ++pg_no, ++lu_ptr, ++pg_ptr)
{
#ifdef MULTI_TASK
lu_ptr->task = NULL;
#endif
lu_ptr->file = -1;
lu_ptr->pageno = -1L;
lu_ptr->pg_slot = pg_no;
@ -514,11 +505,6 @@ void dio_free()
int pgt_lc; /* loop control */
PAGE_ENTRY *pg_ptr;
#ifdef MULTI_TASK
if ( task_count > 1 ) {
return;
}
#endif
MEM_UNLOCK(&db_global.Pgzero);
FREE(&db_global.Pgzero);
MEM_UNLOCK(&Used_files);
@ -630,9 +616,6 @@ FILE_NO to_file; /* ..to (not thru) file "to_file" */
dio_findpg(s_file, 0L, NULL, NULL, &lu_ptr);
dio_findpg(e_file, 0L, NULL, NULL, &lu2_ptr);
#ifdef MULTI_TASK
last_dblu.task = NULL;
#endif
last_dblu.file = -1;
last_dblu.pageno = -1L;
last_dblu.slot = -1;
@ -642,9 +625,6 @@ FILE_NO to_file; /* ..to (not thru) file "to_file" */
while ((lu_ptr > db_lookup) && ((--lu_ptr)->file >= 0)) {
--lu2_ptr;
#ifdef MULTI_TASK
lu2_ptr->task = lu_ptr->task;
#endif
lu2_ptr->file = lu_ptr->file;
lu2_ptr->pageno = lu_ptr->pageno;
/* exchange page slot numbers */
@ -660,9 +640,6 @@ FILE_NO to_file; /* ..to (not thru) file "to_file" */
while (lu_ptr < lu2_ptr) {
#ifdef MULTI_TASK
lu_ptr->task = NULL;
#endif
lu_ptr->file = -1;
lu_ptr->pageno = -1L;
pg_ptr = &dbpg_table[lu_ptr->pg_slot];
@ -731,11 +708,6 @@ int dio_flush()
continue;
}
lu_ptr = &db_lookup[pg_ptr->lu_slot];
#ifdef MULTI_TASK
if ( lu_ptr->task != Currtask.v.ptr ) {
continue;
}
#endif
#ifndef NO_TRANS
if ((dboptions & TRLOGGING) && trans_id && !trcommit && use_ovfl) {
/* flush to overflow/log file -- before tr commit */
@ -1155,10 +1127,6 @@ 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 *lookup; /* = db_lookup or ix_lookup */
int pgtab_sz; /* = db_pgtab_sz or ix_pgtab_sz */
long cmp;
@ -1172,18 +1140,11 @@ LOOKUP_ENTRY * *xlu_ptr;/* pointer to lookup table slot for found page*/
BOOLEAN db_cache; /* TRUE if currently using dbpg_table */
F_ADDR ovfl_addr;
#endif
#ifdef MULTI_TASK
INT pgsize;
#endif
#ifdef NO_TRANS
/* check if desired page was last one */
#ifdef MULTI_TASK
if ((Currtask.v.ptr == last_dblu.task) && (file == last_dblu.file) && (page == last_dblu.pageno)) {
#else
if ((file == last_dblu.file) && (page == last_dblu.pageno)) {
#endif
if (xlu_ptr != NULL)
*xlu_ptr = &db_lookup[last_dblu.slot];
if (xpg_ptr != NULL)
@ -1195,12 +1156,7 @@ LOOKUP_ENTRY * *xlu_ptr;/* pointer to lookup table slot for found page*/
#else /* NO_TRANS */
if (db_cache = (!pg_table || (pg_table == dbpg_table))) {
/* check if desired page was last one */
#ifdef MULTI_TASK
if ((Currtask.v.ptr == last_dblu.task) && (file == last_dblu.file) &&
(page == last_dblu.pageno)) {
#else
if ((file == last_dblu.file) && (page == last_dblu.pageno)) {
#endif
if (xlu_ptr != NULL)
*xlu_ptr = &db_lookup[last_dblu.slot];
if (xpg_ptr != NULL)
@ -1220,9 +1176,6 @@ LOOKUP_ENTRY * *xlu_ptr;/* pointer to lookup table slot for found page*/
u = pgtab_sz - 1;
while (u >= l) {
lu_ptr = &lookup[lu_slot = (l + u)/2];
#ifdef MULTI_TASK
if ((cmp = Currtask.v.ptr - lu_ptr->task) == 0)
#endif
if ((cmp = file - lu_ptr->file) == 0)
cmp = page - lu_ptr->pageno;
if (cmp < 0)
@ -1233,9 +1186,6 @@ LOOKUP_ENTRY * *xlu_ptr;/* pointer to lookup table slot for found page*/
#ifndef NO_TRANS
if (db_cache)
{
#endif
#ifdef MULTI_TASK
last_dblu.task = lu_ptr->task;
#endif
last_dblu.file = lu_ptr->file;
last_dblu.pageno = lu_ptr->pageno;
@ -1305,18 +1255,8 @@ LOOKUP_ENTRY * *xlu_ptr;/* pointer to lookup table slot for found page*/
#ifdef SINGLE_USER
if (!db_cache || (EXCL_OPEN() && !trans_id)) {
#else
#ifdef MULTI_TASK
MEM_LOCK(&replu_ptr->task->Excl_locks);
#endif
if (!db_cache || ((EXCL_OPEN() ||
#ifdef MULTI_TASK
( replu_ptr->task == Currtask.v.ptr ) ?
excl_locks[lookup[pg_ptr->lu_slot].file] :
replu_ptr->task->Excl_locks.ptr[replu_ptr->file]) &&
!trans_id)) {
#else
excl_locks[lookup[pg_ptr->lu_slot].file]) && !trans_id)) {
#endif /* MULTI_TASK */
#endif /* SINGLE_USER */
/* ix page swapping occurs here */
dio_out(pg_ptr, replu_ptr, db_cache);
@ -1330,9 +1270,6 @@ LOOKUP_ENTRY * *xlu_ptr;/* pointer to lookup table slot for found page*/
--no_modheld; /* must be in db cache */
if (o_write(pg_ptr, replu_ptr) != S_OKAY) return( db_status );
}
#ifdef MULTI_TASK
MEM_UNLOCK(&replu_ptr->task->Excl_locks);
#endif
}
pg_ptr->ovfl_addr = ovfl_addr;
#endif /* NO_TRANS */
@ -1372,37 +1309,7 @@ LOOKUP_ENTRY * *xlu_ptr;/* pointer to lookup table slot for found page*/
--replu_ptr;
}
}
#ifdef MULTI_TASK
#ifdef NO_TRANS
pgsize = file_table[( lu_ptr->file > -1 ) ? lu_ptr->file : file].ft_pgsize;
#else
pgsize = ( db_cache )
? file_table[( lu_ptr->file > -1 ) ? lu_ptr->file : file].ft_pgsize
: file_table[ov_file].ft_pgsize;
#endif
if ( ! pgsize ) {
pgsize = page_size;
}
if ( pgsize != file_table[file].ft_pgsize ) {
Tempbuff.ptr = NULL;
tempbuff = ALLOC(&Tempbuff, file_table[file].ft_pgsize, "dbpgbuff");
if ( ! tempbuff ) {
return( dberr(S_NOMEMORY) );
}
if ( pg_ptr->buff ) {
MEM_UNLOCK(&pg_ptr->Buff);
FREE(&pg_ptr->Buff);
}
MEM_UNLOCK(&Tempbuff);
pg_ptr->Buff = Tempbuff;
}
#endif /* MULTI_TASK */
#ifdef MULTI_TASK
lu_ptr->task = Currtask.v.ptr;
#endif
lu_ptr->file = file;
lu_ptr->pageno = page;
lu_ptr->pg_slot = pg_slot;
@ -1412,18 +1319,12 @@ LOOKUP_ENTRY * *xlu_ptr;/* pointer to lookup table slot for found page*/
if (xpg_ptr != NULL)
*xpg_ptr = pg_ptr;
#ifdef NO_TRANS
#ifdef MULTI_TASK
last_dblu.task = lu_ptr->task;
#endif
last_dblu.file = lu_ptr->file;
last_dblu.pageno = lu_ptr->pageno;
last_dblu.slot = lu_slot;
dio_in(pg_ptr, lu_ptr);
#else
if (db_cache) {
#ifdef MULTI_TASK
last_dblu.task = lu_ptr->task;
#endif
last_dblu.file = lu_ptr->file;
last_dblu.pageno = lu_ptr->pageno;
last_dblu.slot = lu_slot;

View file

@ -180,7 +180,6 @@ 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
#define dt_closetask(a) S_OKAY
@ -325,8 +324,6 @@ 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 dberr(P1(int)); /* dberr.c */
#define D_FUNCTIONS_H

View file

@ -291,12 +291,8 @@ int renfiles(P0);
#ifndef NO_DBN_PARM
int startup(DBN_FIX_D1 TASK_PTR_Di LOCK_Di);
#else
#ifdef MULTI_TASK
int startup(TASK_PTR_D1 LOCK_Di);
#else
#define startup() S_OKAY
#endif
#endif
/* From taffcns.c: */
int taf_open(P0);
@ -306,11 +302,6 @@ int taf_release(P0);
int taf_add(P1(const char *));
int taf_del(P1(const char *) );
/* From task.c */
#ifdef MULTI_TASK
void task_switch(P1(DB_TASK *));
#endif
/* From mapchar.c */
int ctb_init(P0);
int ctbl_alloc(P0);

View file

@ -53,17 +53,9 @@ LOCK_DECL
{
db_status = S_OKAY;
if ( ! db_glob_init ) {
#ifdef MULTI_TASK
Currtask.v.ptr = (TASK *)&db_global;
#endif
taskinit(&db_global);
db_glob_init = 1;
}
#ifdef MULTI_TASK
if ( task != 0 ) {
task_switch(task);
}
#endif
#ifndef NO_DBN_PARM
#ifndef ONE_DB
if ( dbn >= 0 && dbn_check(dbn) != S_OKAY ) {

View file

@ -305,14 +305,6 @@ typedef char *HANDLE;
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 *ptr; LOCK_DESC} TASK_P;
typedef struct {char *ptr; LOCK_DESC} QFAKE_P;
typedef struct {
TASK_P v;
QFAKE_P q;
} DB_TASK;
#endif
/* Allow for function prototyping */
@ -353,15 +345,6 @@ typedef struct {
#define DBN_Dn /**/
#endif
#ifdef MULTI_TASK
#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 *)
#define TASK_PTR_Di Pi(DB_TASK *)
#define CURRTASK_PARM , Currtask
#define CURRTASK_ONLY Currtask
#else
#define TASK_DBN_D1 DBN_D1
#define TASK_D1 P0
#define TASK_Di /**/
@ -369,7 +352,6 @@ typedef struct {
#define TASK_PTR_Di /**/
#define CURRTASK_PARM /**/
#define CURRTASK_ONLY /**/
#endif
#define LOCK_D1 /**/
#define LOCK_Di /**/
@ -381,8 +363,5 @@ typedef struct {
#include "dproto.h"
#ifdef MULTI_TASK
#include "task.h"
#endif
/* vpp -nOS2 -dUNIX -nBSD -nVANILLA_BSD -nVMS -nMEMLOCK -nWINDOWS -nFAR_ALLOC vista.h */