[cairo-commit] pycairo/cairo pycairo-private.h, 1.8,
1.9 pycairosvg-context.c, 1.1, 1.2
Steve Chaplin
commit at pdx.freedesktop.org
Mon Dec 13 19:43:03 PST 2004
Committed by: stevech1097
Update of /cvs/cairo/pycairo/cairo
In directory gabe:/tmp/cvs-serv32509/cairo
Modified Files:
pycairo-private.h pycairosvg-context.c
Log Message:
14/12/2004
Index: pycairo-private.h
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-private.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- pycairo-private.h 10 Dec 2004 13:03:35 -0000 1.8
+++ pycairo-private.h 14 Dec 2004 03:43:01 -0000 1.9
@@ -57,18 +57,4 @@
PyObject *pycairo_pattern_wrap(cairo_pattern_t *pattern);
PyObject *pycairo_font_wrap(cairo_font_t *font);
-#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 4
-# define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
-# define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True
-# define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False
-# define Py_CLEAR(op) \
- do { \
- if (op) { \
- PyObject *tmp = (PyObject *)(op); \
- (op) = NULL; \
- Py_DECREF(tmp); \
- } \
- } while (0)
-#endif /* PY_MAJOR_VERSION */
-
#endif /* _PYCAIRO_PRIVATE_H_ */
Index: pycairosvg-context.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairosvg-context.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pycairosvg-context.c 10 Dec 2004 15:15:46 -0000 1.1
+++ pycairosvg-context.c 14 Dec 2004 03:43:01 -0000 1.2
@@ -119,6 +119,20 @@
Py_RETURN_NONE;
}
+static PyObject *
+pycairosvg_parse_buffer (PyCairoSVGContext *self, PyObject *args)
+{
+ const char *buf;
+ size_t count;
+
+ if (!PyArg_ParseTuple(args, "t#:Context.parse_buffer", &buf, &count))
+ return NULL;
+
+ //svg_cairo_status_t svg_cairo_parse_buffer (svg_cairo_t *svg_cairo, const char *buf, size_t count);
+ if (_status_error (svg_cairo_parse_buffer (self->ctx, buf, count)))
+ return NULL;
+ Py_RETURN_NONE;
+}
static PyObject *
pycairosvg_render (PyCairoSVGContext *self, PyObject *args)
@@ -152,8 +166,9 @@
static PyMethodDef pycairosvg_methods[] = {
- {"parse", (PyCFunction)pycairosvg_parse, METH_VARARGS, "parse" },
- {"render", (PyCFunction)pycairosvg_render, METH_VARARGS, "render" },
+ {"parse", (PyCFunction)pycairosvg_parse, METH_VARARGS },
+ {"parse_buffer", (PyCFunction)pycairosvg_parse_buffer, METH_VARARGS },
+ {"render", (PyCFunction)pycairosvg_render, METH_VARARGS },
{NULL},
};
More information about the cairo-commit
mailing list