This commit is contained in:
Elliot Nunn 2018-09-19 18:45:35 +08:00
parent d965b55f15
commit f22fae36ed
2 changed files with 35 additions and 0 deletions

27
main.c
View File

@ -11,3 +11,30 @@
#include "record.c"
#include "version.c"
#include "volume.c"
#include <Python.h>
static char module_docstring[] =
"This is the docstring for the module.";
static char elmo_docstring[] =
"This is the docstring for the elmo function.";
static PyObject *libhfs_elmo(PyObject *self, PyObject *args);
static PyMethodDef module_methods[] = {
{"elmo", libhfs_elmo, METH_VARARGS, elmo_docstring},
{NULL, NULL, 0, NULL}
};
PyMODINIT_FUNC init_libhfs(void)
{
PyObject *m = Py_InitModule3("libhfs", module_methods, module_docstring);
if (m == NULL)
return;
}
static PyObject *libhfs_elmo(PyObject *self, PyObject *args)
{
printf("Hello from the elmo function!\n");
return Py_None;
}

8
setup.py Executable file
View File

@ -0,0 +1,8 @@
from distutils.core import setup, Extension
c_code = Extension('demo', sources = ['main.c'])
setup (name = 'libhfs',
version = '1.0',
description = 'This is a demo package',
ext_modules = [c_code])