Commit 909d7c32 authored by Barry Warsaw's avatar Barry Warsaw

regex_get_syntax(): New module function exported to Python.

parent 152f9d96
...@@ -679,12 +679,24 @@ regex_set_syntax(self, args) ...@@ -679,12 +679,24 @@ regex_set_syntax(self, args)
return PyInt_FromLong((long)syntax); return PyInt_FromLong((long)syntax);
} }
static PyObject *
regex_get_syntax(self, args)
PyObject *self;
PyObject *args;
{
if (!PyArg_Parse(args, ""))
return NULL;
return PyInt_FromLong((long)re_syntax);
}
static struct PyMethodDef regex_global_methods[] = { static struct PyMethodDef regex_global_methods[] = {
{"compile", regex_compile, 1}, {"compile", regex_compile, 1},
{"symcomp", regex_symcomp, 1}, {"symcomp", regex_symcomp, 1},
{"match", regex_match, 0}, {"match", regex_match, 0},
{"search", regex_search, 0}, {"search", regex_search, 0},
{"set_syntax", regex_set_syntax, 0}, {"set_syntax", regex_set_syntax, 0},
{"get_syntax", regex_get_syntax, 0},
{NULL, NULL} /* sentinel */ {NULL, NULL} /* sentinel */
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment