[255] | 1 | #include "machdefs.h"
|
---|
| 2 | #include <stdlib.h>
|
---|
| 3 | #include <stdio.h>
|
---|
| 4 | #include "pexceptions.h"
|
---|
[269] | 5 | #include "ppersist.h"
|
---|
[255] | 6 | #include "peidainit.h"
|
---|
| 7 | // --- Classe d'initialisation de PEIDA++, (PPersistMgr en particulier)
|
---|
| 8 | int PeidaInitiator::FgInit = 0;
|
---|
| 9 |
|
---|
| 10 | PeidaInitiator::PeidaInitiator()
|
---|
| 11 | {
|
---|
| 12 | FgInit++;
|
---|
| 13 | if (FgInit > 1) return;
|
---|
| 14 |
|
---|
| 15 | InitFailNewHandler();
|
---|
| 16 |
|
---|
| 17 | #ifdef xx__mac__
|
---|
| 18 | //InitToolBox();
|
---|
| 19 | //SIOUXSettings.initializeTB = FALSE;
|
---|
| 20 | SIOUXSettings.autocloseonquit = FALSE;
|
---|
| 21 | SIOUXSettings.asktosaveonclose = FALSE;
|
---|
| 22 | SIOUXSettings.showstatusline = TRUE;
|
---|
| 23 | #endif
|
---|
| 24 |
|
---|
[269] | 25 | PIOPersist::Initialize();
|
---|
[255] | 26 | //DEL PPersistMgr::classList = new PPersistMgr::ClassList;
|
---|
| 27 | //DEL PShPersist::objList = new PShPersist::ObjList;
|
---|
| 28 |
|
---|
| 29 |
|
---|
| 30 | #if (!defined(__GNUG__) && !defined(__MWERKS__) && !defined(HPUX))
|
---|
| 31 | // pas de bufferisation pour printf cmv 18/3/97 selon E.A.
|
---|
| 32 | // setvbuf(stdout,NULL,_IOLBF,0); setvbuf(stderr,NULL,_IOLBF,0);
|
---|
| 33 | setlinebuf(stdout);
|
---|
| 34 | setlinebuf(stderr);
|
---|
| 35 | #endif
|
---|
| 36 |
|
---|
| 37 | // si var env PEIDA_NOPRTVER definie pas de print
|
---|
| 38 | if(!getenv("PEIDA_NOPRTVER")) PrintPeidaVersion();
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | PeidaInitiator::~PeidaInitiator()
|
---|
| 42 | {
|
---|
| 43 | FgInit--;
|
---|
| 44 | /*
|
---|
| 45 | if (FgInit == 0)
|
---|
| 46 | {
|
---|
| 47 | delete PPersistMgr::classList; PPersistMgr::classList = NULL;
|
---|
| 48 | delete PShPersist::objList; PShPersist::objList = NULL;
|
---|
| 49 | }
|
---|
| 50 | */
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | double PeidaInitiator::Version(bool fgprt)
|
---|
| 54 | {
|
---|
| 55 | if (fgprt) PrintPeidaVersion();
|
---|
| 56 | return(PeidaVersion());
|
---|
| 57 | }
|
---|
| 58 |
|
---|
| 59 | // On met un objet initiator en statique, pour les loaders qui savent
|
---|
| 60 | // appeler le constructeur des objets statiques Reza 08/98
|
---|
| 61 | static PeidaInitiator ppeidainit;
|
---|