Aggiunto livello dei files

git-svn-id: svn://10.65.10.50/trunk@292 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1994-09-27 10:12:15 +00:00
parent d62839f466
commit 5976cbaf1a
2 changed files with 35 additions and 41 deletions

View File

@ -21,15 +21,12 @@ extern "C" {
// Guy moved these outside extern // Guy moved these outside extern
extern isfdptr* openf; extern isfdptr* openf;
extern Str80 cprefix; extern Str80 cprefix;
extern long stdlevel;
#ifdef __STDTYPES_CPP #ifdef __STDTYPES_CPP
#define extern #define extern
#endif #endif
// extern TDitta cditta;
// extern short flprassi;
// extern short flaltmodins;
extern short isjournal; extern short isjournal;
#ifdef __STDTYPES_CPP #ifdef __STDTYPES_CPP

View File

@ -20,59 +20,56 @@
#define REFKEY "CAMPOKEY" #define REFKEY "CAMPOKEY"
#define VERKEY "ìpÙˆ¬cê<" #define VERKEY "ìpÙˆ¬cê<"
long stdlevel ;
void init_global_vars() void init_global_vars()
{ {
#if XVT_OS != XVT_OS_SCOUNIX #if XVT_OS != XVT_OS_SCOUNIX
HL_LOGIN(ModAd, DONT_CARE, REFKEY, VERKEY); HL_LOGIN(ModAd, DONT_CARE, REFKEY, VERKEY);
#endif #endif
const int ws = getser(); const int ws = getser();
if (ws < 0) if (ws < 0)
fatal_box("Perhaps you forgot to connect the dongle?"); fatal_box("Perhaps you forgot to connect the dongle?");
CHECK(prefhndl == NULL, "Can't init global vars two times"); CHECK(prefhndl == NULL, "Can't init global vars two times");
prefhndl = new TPrefix; prefhndl = new TPrefix;
prefhndl->set("DEF"); prefhndl->set("DEF");
prefhndl->set(""); prefhndl->set("");
stdlevel = prefhndl->filelevel();
FileDes d;
CGetFile(LF_DIR, &d, _nolock, NORDIR);
long maxfdir = d.EOX;
prefhndl->set("DEF");
CGetFile(LF_DIR, &d, _nolock, NORDIR);
if (d.EOD > maxfdir) maxfdir = d.EOD;
FileDes d; // isjournal = *((bool *) CGetConf(JOURNALING));
CGetFile(LF_DIR, &d, _nolock, NORDIR);
long maxfdir = d.EOX;
prefhndl->set("DEF");
CGetFile(LF_DIR, &d, _nolock, NORDIR);
if (d.EOD > maxfdir) maxfdir = d.EOD;
/*
char pd[64];
strcpy(pd, CInsPref("dta.gen", NORDIR));
CGetDitta(pd);
isjournal = *((bool *) CGetConf(JOURNALING));
*/
isjournal = FALSE; isjournal = FALSE;
openf = new isfdptr[maxfdir]; openf = new isfdptr[maxfdir];
openrec = new TRectype*[maxfdir]; openrec = new TRectype*[maxfdir];
for (long i = 0; i < maxfdir; i++) for (long i = 0; i < maxfdir; i++)
{ {
openf[i] = NULL; openf[i] = NULL;
openrec[i] = NULL; openrec[i] = NULL;
} }
#if XVT_OS == XVT_OS_SCOUNIX #if XVT_OS == XVT_OS_SCOUNIX
if ((SerNo) && (!CGetAut(MUAUT))) if ((SerNo) && (!CGetAut(MUAUT)))
fatal_box("Abnormal termination: check protection or serial number\n"); fatal_box("Abnormal termination: check protection or serial number\n");
#endif #endif
} }
void free_global_vars() void free_global_vars()
{ {
#if XVT_OS != XVT_OS_SCOUNIX #if XVT_OS != XVT_OS_SCOUNIX
HL_LOGOUT(); HL_LOGOUT();
#endif #endif
delete openf; delete openf;
delete openrec; delete openrec;
delete prefhndl; delete prefhndl;
} }
@ -86,7 +83,7 @@ void* operator new(size_t size)
void* mem = (void*)xvt_fmalloc(size); void* mem = (void*)xvt_fmalloc(size);
if (mem == NULL) if (mem == NULL)
fatal_box("Out of memory: can't allocate %u bytes", size); fatal_box("Out of memory: can't allocate %u bytes", size);
return mem; return mem;
} }
void operator delete(void* ptr) void operator delete(void* ptr)