work on dynamic extensions
This commit is contained in:
parent
8b1c5b9073
commit
b3a326720b
22 changed files with 282 additions and 165 deletions
|
@ -5,12 +5,28 @@
|
|||
#define GRBC_EXT_pkg_config_NAME "GRBC_EXT_pkg_config"
|
||||
#define GRBC_EXT_profiles_NAME "GRBC_EXT_profiles"
|
||||
#define GRBC_EXT_easy_NAME "GRBC_EXT_easy"
|
||||
#define GRBC_EXT_dynamic_extensions_NAME "GRBC_EXT_dynamic_extensions"
|
||||
|
||||
/// Called when the extension is loaded
|
||||
typedef void (*EXT_HookInit)(sol::state &lua);
|
||||
|
||||
/// Called when the build completes
|
||||
typedef void (*EXT_HookBuildFinish)();
|
||||
|
||||
/// Called everytime that a file is processed
|
||||
typedef void (*EXT_HookProcessFile)(const std::string &file);
|
||||
|
||||
/// Called when the extension is invoked from the command line
|
||||
typedef void (*EXT_HookInvoke)();
|
||||
|
||||
struct Extension {
|
||||
std::string name;
|
||||
bool loaded = false;
|
||||
|
||||
EXT_HookInit hook_init = nullptr;
|
||||
};
|
||||
EXT_HookBuildFinish build_finish = nullptr;
|
||||
EXT_HookProcessFile process_file = nullptr;
|
||||
EXT_HookInvoke invoke = nullptr;
|
||||
};
|
||||
|
||||
void grbc_ext_process_file(const std::string &file);
|
7
include/grbc/ext_dynamic.h
Normal file
7
include/grbc/ext_dynamic.h
Normal file
|
@ -0,0 +1,7 @@
|
|||
#pragma once
|
||||
#include "grbc/ext.h"
|
||||
|
||||
/**
|
||||
* Get the grbc dynamic extension
|
||||
*/
|
||||
Extension grbc_dynamic();
|
Loading…
Add table
Add a link
Reference in a new issue