Imported Upstream version 1.51.0
[platform/upstream/boost.git] / tools / build / v2 / engine / modules.h
1 /*
2  *  Copyright 2001-2004 David Abrahams.
3  *  Distributed under the Boost Software License, Version 1.0.
4  *  (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
5  */
6 #ifndef MODULES_DWA10182001_H
7 # define MODULES_DWA10182001_H
8
9 #include "lists.h"
10
11 struct module_t
12 {
13     OBJECT * name;
14     struct hash * rules;
15     struct hash * variables;
16     struct hash * variable_indices;
17     int num_fixed_variables;
18     LIST * * fixed_variables;
19     struct hash * imported_modules;
20     struct module_t * class_module;
21     struct hash * native_rules;
22     int user_module;
23 };
24
25 typedef struct module_t module_t ; /* MSVC debugger gets confused unless this is provided */
26
27 module_t * bindmodule( OBJECT * name );
28 module_t * root_module();
29 void delete_module( module_t * );
30
31 void import_module( LIST * module_names, module_t * target_module );
32 LIST* imported_modules(module_t* module);
33
34 struct hash * demand_rules( module_t * );
35
36 void module_bind_variables( struct module_t * m );
37
38 /*
39  * After calling module_add_fixed_var, module_set_fixed_variables
40  * must be called before accessing any variables in the module.
41  */
42 int module_add_fixed_var( struct module_t * m, OBJECT * name, int * n );
43 void module_set_fixed_variables( struct module_t * m, int n );
44
45 /*
46  * Returns the index of the variable or -1 if none exists.
47  */
48 int module_get_fixed_var( struct module_t * m, OBJECT * name );
49
50 void modules_done();
51
52 #endif
53