Guido van Rossum | b700df9 | 2000-03-31 14:59:30 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
| 19 | typedef 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 | |
| 29 | typedef 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 | |