1 | /********************************************************************** <BR>
|
---|
2 | This file is part of Crack dot Com's free source code release of
|
---|
3 | Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
|
---|
4 | information about compiling & licensing issues visit this URL</a>
|
---|
5 | <PRE> If that doesn't help, contact Jonathan Clark at
|
---|
6 | golgotha_source@usa.net (Subject should have "GOLG" in it)
|
---|
7 | ***********************************************************************/
|
---|
8 |
|
---|
9 | //{{{ Global Initializers Class
|
---|
10 | //
|
---|
11 | // all classes that need initialization at the begining of main should derive themselves from
|
---|
12 | // this no class should allocate memory or interact with other classes before the "init stage"
|
---|
13 | // which follows the "construction stage"
|
---|
14 | //
|
---|
15 | //$Id: init.hh,v 1.10 1998/06/22 17:44:16 jc Exp $
|
---|
16 |
|
---|
17 | #ifndef __i4INIT_HPP_
|
---|
18 | #define __i4INIT_HPP_
|
---|
19 |
|
---|
20 | #include "arch.hh"
|
---|
21 |
|
---|
22 | // these type numbers determine the order i4_init_class'es are initialized in
|
---|
23 | // deinitialization occurs in the reverse order
|
---|
24 | enum {
|
---|
25 | I4_INIT_TYPE_MEMORY_MANAGER, // main i4 memory manager
|
---|
26 | I4_INIT_TYPE_THREADS, // initialized thread info
|
---|
27 | I4_INIT_TYPE_LISP_MEMORY, // for lisp object allocations - uses i4 memory manager,
|
---|
28 | I4_INIT_TYPE_LISP_BASE_TYPES, // adds lisp types into the system (li_int.. etc)
|
---|
29 | I4_INIT_TYPE_LISP_FUNCTIONS, // adds lisp fuinctions (li_load & any user li_automatic..
|
---|
30 | I4_INIT_TYPE_STRING_MANAGER,
|
---|
31 | I4_INIT_TYPE_FILE_MANAGER,
|
---|
32 | I4_INIT_TYPE_DLLS,
|
---|
33 | I4_INIT_TYPE_OTHER
|
---|
34 | };
|
---|
35 |
|
---|
36 |
|
---|
37 | class i4_init_class
|
---|
38 | {
|
---|
39 | public:
|
---|
40 | static i4_init_class *first_init;
|
---|
41 | i4_init_class *next_init;
|
---|
42 |
|
---|
43 | virtual int init_type() { return I4_INIT_TYPE_OTHER; }
|
---|
44 |
|
---|
45 | virtual void init() {}
|
---|
46 | virtual void uninit() {}
|
---|
47 |
|
---|
48 | i4_init_class();
|
---|
49 | virtual ~i4_init_class();
|
---|
50 | };
|
---|
51 |
|
---|
52 | // should be called at the begining of main (after memory manager is initialized)
|
---|
53 | void i4_init();
|
---|
54 |
|
---|
55 | // should be called at the end of main (after memory manager is deinitialized)
|
---|
56 | void i4_uninit();
|
---|
57 |
|
---|
58 | // used to report errors when things should be executed only when i4 is initialized
|
---|
59 | i4_bool i4_is_initialized();
|
---|
60 |
|
---|
61 | #endif
|
---|
62 |
|
---|