Create and use sicsglobal.h and add isDuringInitialization
This commit is contained in:
@ -23,6 +23,7 @@
|
||||
#include <unistd.h>
|
||||
#include "nserver.h"
|
||||
#include "servlog.h"
|
||||
#include "sicsglobal.h"
|
||||
|
||||
/* ========================= Less dreadful file statics =================== */
|
||||
|
||||
@ -47,7 +48,6 @@ int main(int argc, char *argv[])
|
||||
int daemonize = 0;
|
||||
char *file = NULL;
|
||||
int i, firstArg = 1;
|
||||
extern const char *argv0;
|
||||
extern pServer pServ;
|
||||
|
||||
argv0 = argv[0];
|
||||
|
2
macro.c
2
macro.c
@ -68,6 +68,7 @@
|
||||
#include "ifile.h"
|
||||
#include "Dbg.h"
|
||||
#include "servlog.h"
|
||||
#include "sicsglobal.h"
|
||||
#include "stringdict.h"
|
||||
#include "exeman.h"
|
||||
#include "nxcopy.h"
|
||||
@ -323,7 +324,6 @@ Tcl_Interp *MacroInit(SicsInterp * pSics)
|
||||
assert(pSics);
|
||||
|
||||
/* create interpreter and unknown */
|
||||
extern const char *argv0;
|
||||
Tcl_FindExecutable(argv0);
|
||||
pInter = Tcl_CreateInterp();
|
||||
pUnknown = (struct __SicsUnknown *) malloc(sizeof(struct __SicsUnknown));
|
||||
|
2
ofac.c
2
ofac.c
@ -16,6 +16,7 @@
|
||||
#include "statusfile.h"
|
||||
#include "site.h"
|
||||
#include "sicshipadaba.h"
|
||||
#include "sicsglobal.h"
|
||||
|
||||
extern void DevExecInit(void); /* devexec.c */
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@ -231,5 +232,6 @@ int InitObjectCommands(pServer pServ, char *file)
|
||||
}
|
||||
|
||||
RemoveStartupCommands();
|
||||
isDuringInitialization = 0;
|
||||
return 1;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/***************************** Necessary Globals ****************************/
|
||||
|
||||
const char *argv0 = (void*) 0;
|
||||
|
||||
int isDuringInitialization = 1; /* gets set to zero after initialization */
|
||||
|
6
sicsglobal.h
Normal file
6
sicsglobal.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef SICSGLOBAL_H
|
||||
#define SICSGLOBAL_H
|
||||
|
||||
extern const char *argv0;
|
||||
extern int isDuringInitialization;
|
||||
#endif
|
Reference in New Issue
Block a user