]> granicus.if.org Git - python/commitdiff
regex_get_syntax(): New module function exported to Python.
authorBarry Warsaw <barry@python.org>
Tue, 18 Feb 1997 18:48:50 +0000 (18:48 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 18 Feb 1997 18:48:50 +0000 (18:48 +0000)
Modules/regexmodule.c

index 695c2d24983063bdb588f0280a1f61b9003c852e..41c7315aa4e3eaf42df805392068dfe979c1a31b 100644 (file)
@@ -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 */
 };