mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
py3: More fixes for chmlib wrapper
This commit is contained in:
parent
8bb15338f5
commit
34192f9bf9
@ -1,7 +1,8 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 3.0.12
|
||||
* swig -Wall -python -builtin -modern -O swig_chm.i
|
||||
*
|
||||
* swig -Wall -python -builtin -modern -O -o swig_chm.c swig_chm.i
|
||||
*
|
||||
* This file is not intended to be easily readable and contains a number of
|
||||
* coding conventions designed to improve portability and efficiency. Do not make
|
||||
@ -3819,7 +3820,7 @@ int dummy_enumerator (struct chmFile *h,
|
||||
|
||||
py_h = SWIG_NewPointerObj((void *) h, SWIGTYPE_p_chmFile, 0);
|
||||
py_ui = SWIG_NewPointerObj((void *) ui, SWIGTYPE_p_chmUnitInfo, 0);
|
||||
py_c = PyCObject_AsVoidPtr(context);
|
||||
py_c = PyCapsule_GetPointer(context, NULL);
|
||||
|
||||
/* Time to call the callback */
|
||||
arglist = Py_BuildValue("(OOO)", py_h, py_ui, py_c);
|
||||
@ -4799,6 +4800,7 @@ SWIGINTERN PyObject *_wrap_chm_retrieve_object(PyObject *self, PyObject *args) {
|
||||
resultobj = t_output_helper(resultobj,o);
|
||||
|
||||
|
||||
|
||||
free(arg3);
|
||||
|
||||
}
|
||||
@ -4837,9 +4839,10 @@ SWIGINTERN PyObject *_wrap_chm_enumerate(PyObject *self, PyObject *args) {
|
||||
arg3 = dummy_enumerator;
|
||||
}
|
||||
{
|
||||
if (!(arg4 = PyCObject_FromVoidPtr(swig_obj[3], NULL))) goto fail;
|
||||
if (!(arg4 = PyCapsule_New(swig_obj[3], NULL, NULL))) goto fail;
|
||||
}
|
||||
result = (int)chm_enumerate(arg1,arg2,arg3,arg4);
|
||||
Py_XDECREF(arg4);
|
||||
resultobj = SWIG_From_int((int)(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
@ -4885,9 +4888,10 @@ SWIGINTERN PyObject *_wrap_chm_enumerate_dir(PyObject *self, PyObject *args) {
|
||||
arg4 = dummy_enumerator;
|
||||
}
|
||||
{
|
||||
if (!(arg5 = PyCObject_FromVoidPtr(swig_obj[4], NULL))) goto fail;
|
||||
if (!(arg5 = PyCapsule_New(swig_obj[4], NULL, NULL))) goto fail;
|
||||
}
|
||||
result = (int)chm_enumerate_dir(arg1,(char const *)arg2,arg3,arg4,arg5);
|
||||
Py_XDECREF(arg5);
|
||||
resultobj = SWIG_From_int((int)(result));
|
||||
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
||||
return resultobj;
|
||||
|
@ -55,7 +55,7 @@ int dummy_enumerator (struct chmFile *h,
|
||||
|
||||
py_h = SWIG_NewPointerObj((void *) h, SWIGTYPE_p_chmFile, 0);
|
||||
py_ui = SWIG_NewPointerObj((void *) ui, SWIGTYPE_p_chmUnitInfo, 0);
|
||||
py_c = PyCObject_AsVoidPtr(context);
|
||||
py_c = PyCapsule_GetPointer(context, NULL);
|
||||
|
||||
/* Time to call the callback */
|
||||
arglist = Py_BuildValue("(OOO)", py_h, py_ui, py_c);
|
||||
@ -83,7 +83,7 @@ int dummy_enumerator (struct chmFile *h,
|
||||
}
|
||||
|
||||
%typemap(in) void *context {
|
||||
if (!($1 = PyCObject_FromVoidPtr($input, NULL))) goto fail;
|
||||
if (!($1 = PyCapsule_New($input, NULL, NULL))) goto fail;
|
||||
}
|
||||
|
||||
%typemap(in, numinputs=0) struct chmUnitInfo *OutValue (struct chmUnitInfo *temp = (struct chmUnitInfo *) calloc(1, sizeof(struct chmUnitInfo))) {
|
||||
@ -122,7 +122,7 @@ int dummy_enumerator (struct chmFile *h,
|
||||
|
||||
%typemap(argout,fragment="t_output_helper") unsigned char *OUTPUT {
|
||||
PyObject *o;
|
||||
o = PyString_FromStringAndSize($1, arg5);
|
||||
o = PyBytes_FromStringAndSize((const char*)$1, arg5);
|
||||
$result = t_output_helper($result,o);
|
||||
#ifdef __cplusplus
|
||||
delete [] $1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user