diff options
author | Barry Warsaw <barry@python.org> | 1997-02-18 18:48:50 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1997-02-18 18:48:50 (GMT) |
commit | 909d7c3284c84dd50574aca78c59ed4fea3de4b0 (patch) | |
tree | 4a212591e3fc3918ef72d2bfba04c15c6738c068 /Modules | |
parent | 152f9d966329e6e5de2047a844a9d53ce7786572 (diff) | |
download | cpython-909d7c3284c84dd50574aca78c59ed4fea3de4b0.zip cpython-909d7c3284c84dd50574aca78c59ed4fea3de4b0.tar.gz cpython-909d7c3284c84dd50574aca78c59ed4fea3de4b0.tar.bz2 |
regex_get_syntax(): New module function exported to Python.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/regexmodule.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/regexmodule.c b/Modules/regexmodule.c index 695c2d2..41c7315 100644 --- a/Modules/regexmodule.c +++ b/Modules/regexmodule.c @@ -679,12 +679,24 @@ regex_set_syntax(self, args) 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[] = { {"compile", regex_compile, 1}, {"symcomp", regex_symcomp, 1}, {"match", regex_match, 0}, {"search", regex_search, 0}, {"set_syntax", regex_set_syntax, 0}, + {"get_syntax", regex_get_syntax, 0}, {NULL, NULL} /* sentinel */ }; |