1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
/*\ 
||| This file a part of Pike, and is copyright by Fredrik Hubinette 
||| Pike is distributed as GPL (General Public License) 
||| See the files COPYING and DISCLAIMER for more information. 
\*/ 
#include "global.h" 
#include "module.h" 
#include "pike_macros.h" 
#include "error.h" 
#include "builtin_functions.h" 
#include "main.h" 
#include "svalue.h" 
#include "interpret.h" 
#include "stralloc.h" 
#include "object.h" 
#include "mapping.h" 
 
#include "modules/modlist_headers.h" 
 
RCSID("$Id: module.c,v 1.9 1998/04/24 00:30:44 hubbe Exp $"); 
 
typedef void (*modfun)(void); 
 
struct static_module 
{ 
  char *name; 
  modfun init; 
  modfun exit; 
}; 
 
static struct static_module module_list[] = { 
  { "Builtin", low_init_main, low_exit_main } 
#include "modules/modlist.h" 
  ,{ "Builtin2", init_main, exit_main } 
}; 
 
void init_modules(void) 
{ 
  struct program *p; 
  unsigned int e; 
 
  start_new_program(); 
 
  for(e=0;e<NELEM(module_list);e++) 
  { 
    start_new_program(); 
    module_list[e].init(); 
    end_class(module_list[e].name,0); 
  } 
  push_text("_static_modules"); 
  push_object(low_clone(p=end_program())); 
  f_add_constant(2); 
  free_program(p); 
} 
 
void exit_modules(void) 
{ 
  int e; 
  for(e=NELEM(module_list)-1;e>=0;e--) 
    module_list[e].exit(); 
}