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