/* --- END LICENSE --- */
#include "binmodule.h"
+
+void binmodule_init(struct sn_interpreter* sn){
+}
#include "interpreter.h"
-void ffi_init(struct sn_interpreter* sn);
+void binmodule_init(struct sn_interpreter* sn);
#endif
#include "interpreter.h"
#include "../config.h"
+
#include "run.h"
#include "util.h"
sn_set_handler(sn, "source", source_handler);
}
-void sn_ffi_init(struct sn_interpreter* sn) {
+void sn_module_init(struct sn_interpreter* sn) {
#ifdef HAS_FFI_SUPPORT
ffi_init(sn);
#endif
+#ifdef HAS_BINMODULE_SUPPORT
+ binmodule_init(sn);
+#endif
}
struct sn_interpreter* sn_create_interpreter(void) {
struct sn_interpreter_kv* sn_set_handler(struct sn_interpreter* sn, const char* name, struct sn_generic* (*handler)(struct sn_interpreter* sn, int, struct sn_generic**));
int sn_eval(struct sn_interpreter* sn, char* data, unsigned long long len);
void sn_stdlib_init(struct sn_interpreter* sn);
-void sn_ffi_init(struct sn_interpreter* sn);
+void sn_module_init(struct sn_interpreter* sn);
#endif
fread(str, 1, s.st_size, f);
struct sn_interpreter* sn = sn_create_interpreter();
sn_stdlib_init(sn);
- sn_ffi_init(sn);
+ sn_module_init(sn);
int r = sn_eval(sn, str, s.st_size);
sn_interpreter_free(sn);
free(str);
printf("Parser stack size: %d\n", PARSER_STACK_SIZE);
struct sn_interpreter* sn = sn_create_interpreter();
sn_stdlib_init(sn);
- sn_ffi_init(sn);
+ sn_module_init(sn);
char cbuf[2];
cbuf[0] = '\n';
cbuf[1] = 0;
fprintf(out, "#ifdef HAS_FFI_SUPPORT\n");
fprintf(out, "#include \"Serenade/ffi_binding.h\"\n");
fprintf(out, "#endif\n");
+ fprintf(out, "#ifdef HAS_BINMODULE_SUPPORT\n");
+ fprintf(out, "#include \"Serenade/binmodule.h\"\n");
+ fprintf(out, "#endif\n");
fprintf(out, "#endif\n");
}