blob: 2936b059ec36fc6000a49a28ef83420e6e596b41 [file] [log] [blame]
Guido van Rossumb700df92000-03-31 14:59:30 +00001/*
2 * Secret Labs' Regular Expression Engine
3 * $Id$
4 *
5 * simple regular expression matching engine
6 *
7 * Copyright (c) 1997-2000 by Secret Labs AB. All rights reserved.
8 *
9 * See the _sre.c file for information on usage and redistribution.
10 */
11
12#ifndef SRE_INCLUDED
13#define SRE_INCLUDED
14
15#include "sre_constants.h"
16
17/* Python objects */
18
19typedef struct {
20 PyObject_HEAD
21 PyObject* code; /* link to the code string object */
22 PyObject* pattern; /* link to the pattern source (or None) */
23 int groups;
24 PyObject* groupindex;
25} PatternObject;
26
27#define PatternObject_GetCode(o) ((void*) PyString_AS_STRING((o)->code))
28
29typedef struct {
30 PyObject_HEAD
31 PyObject* string; /* link to the target string */
32 PatternObject* pattern; /* link to the regex (pattern) object */
33 int groups; /* number of groups (start/end marks) */
34 int mark[2];
35} MatchObject;
36
37#endif
38