diff options
author | chai <chaifix@163.com> | 2021-11-08 01:17:11 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-08 01:17:11 +0800 |
commit | efce5b6bd5c9d4f8214a71e0f7a7c35751710a4c (patch) | |
tree | 0789475ded5c377667165a3ddb047ca6703bcf33 /ThirdParty/tolua_runtime/lpeg.h | |
parent | ed78df90944bbe6b7de7308bda2bf3a7f1bc3de6 (diff) |
+ tolua
+ lpeg
Diffstat (limited to 'ThirdParty/tolua_runtime/lpeg.h')
-rw-r--r-- | ThirdParty/tolua_runtime/lpeg.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/ThirdParty/tolua_runtime/lpeg.h b/ThirdParty/tolua_runtime/lpeg.h new file mode 100644 index 0000000..13d7ace --- /dev/null +++ b/ThirdParty/tolua_runtime/lpeg.h @@ -0,0 +1,38 @@ +/* +** $Id: lpeg.h,v 1.1 2009/12/23 16:15:36 roberto Exp $ +** LPeg - PEG pattern matching for Lua +** Copyright 2009, Lua.org & PUC-Rio (see 'lpeg.html' for license) +** written by Roberto Ierusalimschy +*/ + +#ifndef lpeg_h +#define lpeg_h + +#include "lua.h" + + +#define KEYNEWPATT "lpeg.newpf" + + +/* +** type of extension functions that define new "patterns" for LPEG +** It should return the new current position or NULL if match fails +*/ +typedef const char *(*PattFunc) (const char *s, /* current position */ + const char *e, /* string end */ + const char *o, /* string start */ + const void *ud); /* user data */ + +/* +** function to create new patterns based on 'PattFunc' functions. +** This function is available at *registry[KEYNEWPATT]. (Notice +** the extra indirection; the userdata at the registry points to +** a variable that points to the function. In ANSI C a void* cannot +** point to a function.) +*/ +typedef void (*Newpf) (lua_State *L, + PattFunc f, /* pattern */ + const void *ud, /* (user) data to be passed to 'f' */ + size_t l); /* size of data to be passed to 'f' */ + +#endif |