~ubuntu-branches/ubuntu/wily/aegisub/wily

« back to all changes in this revision

Viewing changes to libaegisub/lua/modules/lpeg.h

  • Committer: Package Import Robot
  • Author(s): Sebastian Reichel
  • Date: 2015-08-04 21:40:50 UTC
  • mto: (5.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: package-import@ubuntu.com-20150804214050-1uw8qcsvk4jxxrfg
Tags: upstream-3.2.2+dfsg
ImportĀ upstreamĀ versionĀ 3.2.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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