pcf.test, makefile
[imago.git] / pcf.c
1 #include <Python.h>
2
3 static PyObject* py_test(PyObject* self, PyObject* args)
4 {
5         unsigned char *image;
6         int x;
7         int y;
8         int size;
9
10         if (!PyArg_ParseTuple(args, "(ii)s#", &x, &y, &image, &size)) return NULL;
11         
12         int i;
13         for (i=0; i < size; i++) {
14                 image[i] = i % 256;
15         }
16
17         return Py_BuildValue("s#", image, size);
18 }
19 static PyMethodDef myModule_methods[] = {
20         {"test", py_test, METH_VARARGS},
21         {NULL, NULL}
22 };
23
24 void initpcf()
25 {
26                 (void) Py_InitModule("pcf", myModule_methods);
27 }