diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-05 11:55:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-05 11:55:15 +0200 |
commit | 9fb791e9fad6c63fc1dac49f4d05ae63b8a3db9b (patch) | |
tree | d60322d4382ca5f97b676c5abe2e39524f35eab4 /build/module | |
parent | f159b1dac68c8714f7ba71ca168e3b695891aad9 (diff) |
Rename build directory/namespace to build2
Diffstat (limited to 'build/module')
-rw-r--r-- | build/module | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/build/module b/build/module deleted file mode 100644 index 061ef60..0000000 --- a/build/module +++ /dev/null @@ -1,86 +0,0 @@ -// file : build/module -*- C++ -*- -// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#ifndef BUILD_MODULE -#define BUILD_MODULE - -#include <map> - -#include <build/types> -#include <build/utility> - -#include <build/diagnostics> - -namespace build -{ - class scope; - class location; - - class module - { - public: - virtual - ~module () = default; - }; - - extern "C" - using module_boot_function = - void (scope& root, const location&, unique_ptr<module>&); - - // Return false if the module configuration (normally based on the default - // values) was unsuccessful but this is not (yet) an error. One example - // would be the optional use of a module. Or a module might remain - // unconfigured for as long as it is actually not used (e.g., install, - // dist). The return value is used to set the <module>.configured variable. - // - extern "C" - using module_init_function = - bool (scope& root, - scope& base, - const location&, - unique_ptr<module>&, - bool first, // First time for this project. - bool optional); // Loaded with 'using?' (optional module). - - - struct module_state - { - bool boot; // True if the module boot'ed but not yet init'ed. - module_init_function* init; - unique_ptr<build::module> module; - const location loc; // Boot location. - }; - - using loaded_module_map = std::map<string, module_state>; - - // Load and boot the specified module. - // - void - boot_module (const string& name, scope& root, const location&); - - // Load (if not already loaded) and initialize the specified module. Used - // by the parser but also by some modules to load prerequisite modules. - // Return true if the module was both successfully loaded and configured - // (false can only be returned if optional). - // - bool - load_module (bool optional, - const std::string& name, - scope& root, - scope& base, - const location&); - - // Builtin modules. - // - struct module_functions - { - module_boot_function* boot; - module_init_function* init; - }; - - using available_module_map = std::map<string, module_functions>; - extern available_module_map builtin_modules; -} - -#endif // BUILD_MODULE |