summaryrefslogtreecommitdiff
path: root/lls/lls.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-06-01 08:31:47 +0800
committerchai <chaifix@163.com>2018-06-01 08:31:47 +0800
commit6a4f1a224273118a5429094ddd83420b7d69b28d (patch)
treef96c714cda12af6300178cbe31880d17804802de /lls/lls.h
parenta558be5f3d72775bd06c3814e002d355402a7acd (diff)
更新示例
Diffstat (limited to 'lls/lls.h')
-rw-r--r--lls/lls.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/lls/lls.h b/lls/lls.h
index 5f190a2..7157070 100644
--- a/lls/lls.h
+++ b/lls/lls.h
@@ -1,16 +1,23 @@
#ifndef __LLS_H
#define __LLS_H
+typedef int(*lls_Func)();
+
+typedef struct
+{
+ const char* name;
+ lls_Func func;
+} lls_FuncMap;
+
typedef struct
{
int top;
+ lls_FuncMap* funcMap;
} lls_Context;
lls_Context* lls_newcontext();
-typedef int (*lls_Function)();
-
-int lls_bindfunction(lls_Context* C, const char* fname, lls_Function func);
+int lls_bindfunction(lls_Context* C, const char* fname, lls_Func func);
int lls_bindvariable(lls_Context* C, const char* vname, void* variable);
int lls_bindset();