Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 39 lines (30 sloc) 1.245 kb
e54c534 @jgm Initial commit.
authored
1 /*
2 ** $Id: lpeg.h,v 1.1 2009/12/23 16:15:36 roberto Exp $
3 ** LPeg - PEG pattern matching for Lua
4 ** Copyright 2009, Lua.org & PUC-Rio (see 'lpeg.html' for license)
5 ** written by Roberto Ierusalimschy
6 */
7
8 #ifndef lpeg_h
9 #define lpeg_h
10
11 #include "lua.h"
12
13
14 #define KEYNEWPATT "lpeg.newpf"
15
16
17 /*
18 ** type of extension functions that define new "patterns" for LPEG
19 ** It should return the new current position or NULL if match fails
20 */
21 typedef const char *(*PattFunc) (const char *s, /* current position */
22 const char *e, /* string end */
23 const char *o, /* string start */
24 const void *ud); /* user data */
25
26 /*
27 ** function to create new patterns based on 'PattFunc' functions.
28 ** This function is available at *registry[KEYNEWPATT]. (Notice
29 ** the extra indirection; the userdata at the registry points to
30 ** a variable that points to the function. In ANSI C a void* cannot
31 ** point to a function.)
32 */
33 typedef void (*Newpf) (lua_State *L,
34 PattFunc f, /* pattern */
35 const void *ud, /* (user) data to be passed to 'f' */
36 size_t l); /* size of data to be passed to 'f' */
37
38 #endif
Something went wrong with that request. Please try again.