diff options
| author | Sérgio Medeiros <sqmedeiros@gmail.com> | 2020-08-25 09:38:23 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-25 09:38:23 -0300 |
| commit | b52deae33ab409e2829ad2a31bad0c126c9cb019 (patch) | |
| tree | c88ea1e755e198cd5360a7a089e9a4327a73faac | |
| parent | 9d02c572fc0c45d76d73263e51b004be51f359fa (diff) | |
| parent | 988b733849c4050cbe7dea110d86c7c8eec6bf77 (diff) | |
| download | lpeglabel-b52deae33ab409e2829ad2a31bad0c126c9cb019.tar.gz lpeglabel-b52deae33ab409e2829ad2a31bad0c126c9cb019.tar.bz2 lpeglabel-b52deae33ab409e2829ad2a31bad0c126c9cb019.zip | |
Merge pull request #26 from edubart/fix-lpeg-clashing
Fix name clashing issues with LPEG
| -rw-r--r-- | lpcap.h | 6 | ||||
| -rw-r--r-- | lpcode.h | 16 | ||||
| -rw-r--r-- | lpprint.h | 12 | ||||
| -rw-r--r-- | lptree.h | 2 | ||||
| -rw-r--r-- | lptypes.h | 6 | ||||
| -rw-r--r-- | lpvm.h | 4 |
6 files changed, 23 insertions, 23 deletions
| @@ -48,9 +48,9 @@ typedef struct CapState { | |||
| 48 | } CapState; | 48 | } CapState; |
| 49 | 49 | ||
| 50 | 50 | ||
| 51 | int runtimecap (CapState *cs, Capture *close, const char *s, int *rem); | 51 | LUAI_FUNC int runtimecap (CapState *cs, Capture *close, const char *s, int *rem); |
| 52 | int getcaptures (lua_State *L, const char *s, const char *r, int ptop); | 52 | LUAI_FUNC int getcaptures (lua_State *L, const char *s, const char *r, int ptop); |
| 53 | int finddyncap (Capture *cap, Capture *last); | 53 | LUAI_FUNC int finddyncap (Capture *cap, Capture *last); |
| 54 | 54 | ||
| 55 | #endif | 55 | #endif |
| 56 | 56 | ||
| @@ -11,14 +11,14 @@ | |||
| 11 | #include "lptree.h" | 11 | #include "lptree.h" |
| 12 | #include "lpvm.h" | 12 | #include "lpvm.h" |
| 13 | 13 | ||
| 14 | int tocharset (TTree *tree, Charset *cs); | 14 | LUAI_FUNC int tocharset (TTree *tree, Charset *cs); |
| 15 | int checkaux (TTree *tree, int pred); | 15 | LUAI_FUNC int checkaux (TTree *tree, int pred); |
| 16 | int fixedlen (TTree *tree); | 16 | LUAI_FUNC int fixedlen (TTree *tree); |
| 17 | int hascaptures (TTree *tree); | 17 | LUAI_FUNC int hascaptures (TTree *tree); |
| 18 | int lp_gc (lua_State *L); | 18 | LUAI_FUNC int lp_gc (lua_State *L); |
| 19 | Instruction *compile (lua_State *L, Pattern *p); | 19 | LUAI_FUNC Instruction *compile (lua_State *L, Pattern *p); |
| 20 | void realloccode (lua_State *L, Pattern *p, int nsize); | 20 | LUAI_FUNC void realloccode (lua_State *L, Pattern *p, int nsize); |
| 21 | int sizei (const Instruction *i); | 21 | LUAI_FUNC int sizei (const Instruction *i); |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | #define PEnullable 0 | 24 | #define PEnullable 0 |
| @@ -13,12 +13,12 @@ | |||
| 13 | 13 | ||
| 14 | #if defined(LPEG_DEBUG) | 14 | #if defined(LPEG_DEBUG) |
| 15 | 15 | ||
| 16 | void printpatt (Instruction *p, int n); | 16 | LUAI_FUNC void printpatt (Instruction *p, int n); |
| 17 | void printtree (TTree *tree, int ident); | 17 | LUAI_FUNC void printtree (TTree *tree, int ident); |
| 18 | void printktable (lua_State *L, int idx); | 18 | LUAI_FUNC void printktable (lua_State *L, int idx); |
| 19 | void printcharset (const byte *st); | 19 | LUAI_FUNC void printcharset (const byte *st); |
| 20 | void printcaplist (Capture *cap, Capture *limit); | 20 | LUAI_FUNC void printcaplist (Capture *cap, Capture *limit); |
| 21 | void printinst (const Instruction *op, const Instruction *p); | 21 | LUAI_FUNC void printinst (const Instruction *op, const Instruction *p); |
| 22 | 22 | ||
| 23 | #else | 23 | #else |
| 24 | 24 | ||
| @@ -73,7 +73,7 @@ typedef struct Pattern { | |||
| 73 | 73 | ||
| 74 | 74 | ||
| 75 | /* number of children for each tree */ | 75 | /* number of children for each tree */ |
| 76 | extern const byte numsiblings[]; | 76 | LUAI_FUNC const byte numsiblings[]; |
| 77 | 77 | ||
| 78 | /* access to children */ | 78 | /* access to children */ |
| 79 | #define sib1(t) ((t) + 1) | 79 | #define sib1(t) ((t) + 1) |
| @@ -18,8 +18,8 @@ | |||
| 18 | #define VERSION "1.6.0" | 18 | #define VERSION "1.6.0" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | #define PATTERN_T "lpeg-pattern" | 21 | #define PATTERN_T "lpeglabel-pattern" |
| 22 | #define MAXSTACKIDX "lpeg-maxstack" | 22 | #define MAXSTACKIDX "lpeglabel-maxstack" |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | /* | 25 | /* |
| @@ -35,7 +35,7 @@ | |||
| 35 | #define lua_rawlen lua_objlen | 35 | #define lua_rawlen lua_objlen |
| 36 | 36 | ||
| 37 | #define luaL_setfuncs(L,f,n) luaL_register(L,NULL,f) | 37 | #define luaL_setfuncs(L,f,n) luaL_register(L,NULL,f) |
| 38 | #define luaL_newlib(L,f) luaL_register(L,"lpeg",f) | 38 | #define luaL_newlib(L,f) luaL_register(L,"lpeglabel",f) |
| 39 | 39 | ||
| 40 | typedef size_t lua_Unsigned; | 40 | typedef size_t lua_Unsigned; |
| 41 | 41 | ||
| @@ -58,8 +58,8 @@ typedef union Instruction { | |||
| 58 | #define utf_to(inst) (((inst)->i.key << 8) | (inst)->i.aux) | 58 | #define utf_to(inst) (((inst)->i.key << 8) | (inst)->i.aux) |
| 59 | 59 | ||
| 60 | 60 | ||
| 61 | void printpatt (Instruction *p, int n); | 61 | LUAI_FUNC void printpatt (Instruction *p, int n); |
| 62 | const char *match (lua_State *L, const char *o, const char *s, const char *e, | 62 | LUAI_FUNC const char *match (lua_State *L, const char *o, const char *s, const char *e, |
| 63 | Instruction *op, Capture *capture, int ptop, short *labelf, const char **sfail); /* labeled failure */ | 63 | Instruction *op, Capture *capture, int ptop, short *labelf, const char **sfail); /* labeled failure */ |
| 64 | 64 | ||
| 65 | #endif | 65 | #endif |
