diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /vendor/voclient/voapps/task/voPackage.c | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'vendor/voclient/voapps/task/voPackage.c')
-rw-r--r-- | vendor/voclient/voapps/task/voPackage.c | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/vendor/voclient/voapps/task/voPackage.c b/vendor/voclient/voapps/task/voPackage.c new file mode 100644 index 00000000..2b53c575 --- /dev/null +++ b/vendor/voclient/voapps/task/voPackage.c @@ -0,0 +1,78 @@ +/** + * + */ + +#include <stdio.h> +#include <stdlib.h> +#include <Python.h> + + +typedef struct { +} voPackage; + + + +/** + * VOP_TASKLIST -- List the tasks in the named package. + */ +static PyObject* +vop_taskList (PyObject* self, PyObject* args) /* pkg,pattern=None */ +{ + const char *binpath; + int status; + + if (!PyArg_ParseTuple (args, "s", &binpath)) + return NULL; + + + sts = system(command); + + return Py_BuildValue("s", args); +} + + +/** + * VOP_PKGLIST -- List the packages in the search directory. + */ +static PyObject* +vop_pkgList (PyObject* self, PyObject* args) /* pattern=None */ +{ + char *s = "Hello from vop_pkgList"; + return Py_BuildValue("s", s); +} + +static PyObject* +vop_scan (PyObject* self, PyObject* args) +{ + char *s = "Hello from vop_scan"; + return Py_BuildValue("s", s); +} + +static PyObject* +vop_loadPackage (PyObject* self, PyObject* args) /* name, file=None */ +{ + char *s = "Hello from vop_loadPackage"; + return Py_BuildValue("s", s); +} + +/** ************************************************************************ */ + +/* + * Bind Python function names to our C functions + */ +static PyMethodDef voPackage_methods[] = { + { "vop_taskList", vop_taskList, METH_VARARGS }, + { "vop_pkgList", vop_pkgList, METH_VARARGS }, + { "vop_scan", vop_scan, METH_VARARGS }, + { "vop_loadPackage", vop_loadPackage, METH_VARARGS }, + { NULL, NULL, 0 } +}; + + +/** + * INITVOPACKAGE -- Python calls this to let us initialize our module + */ +void initvoPackage() +{ + (void) Py_InitModule("voPackage", voPackage_methods); +} |