From 6aa0e0017d7d0cddc006da885946934b06949a91 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 14 Oct 2011 04:55:05 +0200 Subject: include libslang-1.4.9 and automatically build it and link erlang-slang against it few (erlang) people will still have libslang-1.4.9 installed or spend time to get it to link against the driver --- libslang/modules/template.c | 49 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 libslang/modules/template.c (limited to 'libslang/modules/template.c') diff --git a/libslang/modules/template.c b/libslang/modules/template.c new file mode 100644 index 0000000..b0b7d60 --- /dev/null +++ b/libslang/modules/template.c @@ -0,0 +1,49 @@ +#include +#include + +SLANG_MODULE(); + +#define MODULE_MAJOR_VERSION 0 +#define MODULE_MINOR_VERSION 0 +#define MODULE_PATCH_LEVEL 0 +static char *Module_Version_String = "0.0.0"; +#define MODULE_VERSION_NUMBER \ + (MODULE_MAJOR_VERSION*10000+MODULE_MINOR_VERSION*100+MODULE_PATCH_LEVEL) + +/* Define intrinsics here */ + +static SLang_Intrin_Fun_Type Module_Intrinsics [] = +{ + SLANG_END_INTRIN_FUN_TABLE +}; + +static SLang_Intrin_Var_Type Module_Variables [] = +{ + MAKE_VARIABLE("__module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1), + SLANG_END_INTRIN_VAR_TABLE +}; + +static SLang_IConstant_Type Module_Constants [] = +{ + MAKE_ICONSTANT("__module_version", MODULE_VERSION_NUMBER), + SLANG_END_ICONST_TABLE +}; + +int init__module_ns (char *ns_name) +{ + SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name); + if (ns == NULL) + return -1; + + if ((-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL)) + || (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL)) + || (-1 == SLns_add_iconstant_table (ns, Module_Constants, NULL))) + return -1; + + return 0; +} + +/* This function is optional */ +void deinit__module (void) +{ +} -- cgit v1.2.3