Exemple #1
0
static PyObject* py_magic_compile(PyObject* self, PyObject* args)
{
    PyObject *pycookie;
    magic_t cookie;
    char* filename = NULL;
    int result;

    if(!(PyArg_ParseTuple(args, "O|s", &pycookie, &filename)))
        return NULL;

    cookie = PyCObject_AsVoidPtr(pycookie);
    result = magic_compile(cookie, filename);

    return PyInt_FromLong(result);
}
Exemple #2
0
R_API int r_magic_compile(RMagic* m, const char *x) {
	return magic_compile (m, x);
}