1 #ifndef __PYX_HAVE_API__vapoursynth
2 #define __PYX_HAVE_API__vapoursynth
4 #include "vapoursynth.h"
6 static int (*__pyx_f_11vapoursynth_vpy_evaluateScript
)(struct VPYScriptExport
*, char const *, char const *) = 0;
7 #define vpy_evaluateScript __pyx_f_11vapoursynth_vpy_evaluateScript
8 static void (*__pyx_f_11vapoursynth_vpy_freeScript
)(struct VPYScriptExport
*) = 0;
9 #define vpy_freeScript __pyx_f_11vapoursynth_vpy_freeScript
10 static char *(*__pyx_f_11vapoursynth_vpy_getError
)(struct VPYScriptExport
*) = 0;
11 #define vpy_getError __pyx_f_11vapoursynth_vpy_getError
12 static VSNodeRef
*(*__pyx_f_11vapoursynth_vpy_getOutput
)(struct VPYScriptExport
*, int) = 0;
13 #define vpy_getOutput __pyx_f_11vapoursynth_vpy_getOutput
14 static void (*__pyx_f_11vapoursynth_vpy_clearOutput
)(struct VPYScriptExport
*, int) = 0;
15 #define vpy_clearOutput __pyx_f_11vapoursynth_vpy_clearOutput
16 static VSCore
*(*__pyx_f_11vapoursynth_vpy_getCore
)(struct VPYScriptExport
*) = 0;
17 #define vpy_getCore __pyx_f_11vapoursynth_vpy_getCore
18 static VSAPI
const *(*__pyx_f_11vapoursynth_vpy_getVSApi
)(void) = 0;
19 #define vpy_getVSApi __pyx_f_11vapoursynth_vpy_getVSApi
20 static int (*__pyx_f_11vapoursynth_vpy_getVariable
)(struct VPYScriptExport
*, char const *, VSMap
*) = 0;
21 #define vpy_getVariable __pyx_f_11vapoursynth_vpy_getVariable
22 static void (*__pyx_f_11vapoursynth_vpy_setVariable
)(struct VPYScriptExport
*, VSMap
const *) = 0;
23 #define vpy_setVariable __pyx_f_11vapoursynth_vpy_setVariable
24 static int (*__pyx_f_11vapoursynth_vpy_clearVariable
)(struct VPYScriptExport
*, char const *) = 0;
25 #define vpy_clearVariable __pyx_f_11vapoursynth_vpy_clearVariable
26 static void (*__pyx_f_11vapoursynth_vpy_clearEnvironment
)(struct VPYScriptExport
*) = 0;
27 #define vpy_clearEnvironment __pyx_f_11vapoursynth_vpy_clearEnvironment
28 static void (*__pyx_f_11vapoursynth_vpy_initVSScript
)(void) = 0;
29 #define vpy_initVSScript __pyx_f_11vapoursynth_vpy_initVSScript
30 #if !defined(__Pyx_PyIdentifier_FromString)
31 #if PY_MAJOR_VERSION < 3
32 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
34 #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
38 #ifndef __PYX_HAVE_RT_ImportModule
39 #define __PYX_HAVE_RT_ImportModule
40 static PyObject
*__Pyx_ImportModule(const char *name
) {
41 PyObject
*py_name
= 0;
42 PyObject
*py_module
= 0;
43 py_name
= __Pyx_PyIdentifier_FromString(name
);
46 py_module
= PyImport_Import(py_name
);
55 #ifndef __PYX_HAVE_RT_ImportFunction
56 #define __PYX_HAVE_RT_ImportFunction
57 static int __Pyx_ImportFunction(PyObject
*module
, const char *funcname
, void (**f
)(void), const char *sig
) {
64 d
= PyObject_GetAttrString(module
, (char *)"__pyx_capi__");
67 cobj
= PyDict_GetItemString(d
, funcname
);
69 PyErr_Format(PyExc_ImportError
,
70 "%s does not export expected C function %s",
71 PyModule_GetName(module
), funcname
);
74 #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3 && PY_MINOR_VERSION==0)
75 if (!PyCapsule_IsValid(cobj
, sig
)) {
76 PyErr_Format(PyExc_TypeError
,
77 "C function %s.%s has wrong signature (expected %s, got %s)",
78 PyModule_GetName(module
), funcname
, sig
, PyCapsule_GetName(cobj
));
81 tmp
.p
= PyCapsule_GetPointer(cobj
, sig
);
83 {const char *desc
, *s1
, *s2
;
84 desc
= (const char *)PyCObject_GetDesc(cobj
);
88 while (*s1
!= '\0' && *s1
== *s2
) { s1
++; s2
++; }
90 PyErr_Format(PyExc_TypeError
,
91 "C function %s.%s has wrong signature (expected %s, got %s)",
92 PyModule_GetName(module
), funcname
, sig
, desc
);
95 tmp
.p
= PyCObject_AsVoidPtr(cobj
);}
109 static int import_vapoursynth(void) {
110 PyObject
*module
= 0;
111 module
= __Pyx_ImportModule("vapoursynth");
112 if (!module
) goto bad
;
113 if (__Pyx_ImportFunction(module
, "vpy_evaluateScript", (void (**)(void))&__pyx_f_11vapoursynth_vpy_evaluateScript
, "int (struct VPYScriptExport *, char const *, char const *)") < 0) goto bad
;
114 if (__Pyx_ImportFunction(module
, "vpy_freeScript", (void (**)(void))&__pyx_f_11vapoursynth_vpy_freeScript
, "void (struct VPYScriptExport *)") < 0) goto bad
;
115 if (__Pyx_ImportFunction(module
, "vpy_getError", (void (**)(void))&__pyx_f_11vapoursynth_vpy_getError
, "char *(struct VPYScriptExport *)") < 0) goto bad
;
116 if (__Pyx_ImportFunction(module
, "vpy_getOutput", (void (**)(void))&__pyx_f_11vapoursynth_vpy_getOutput
, "VSNodeRef *(struct VPYScriptExport *, int)") < 0) goto bad
;
117 if (__Pyx_ImportFunction(module
, "vpy_clearOutput", (void (**)(void))&__pyx_f_11vapoursynth_vpy_clearOutput
, "void (struct VPYScriptExport *, int)") < 0) goto bad
;
118 if (__Pyx_ImportFunction(module
, "vpy_getCore", (void (**)(void))&__pyx_f_11vapoursynth_vpy_getCore
, "VSCore *(struct VPYScriptExport *)") < 0) goto bad
;
119 if (__Pyx_ImportFunction(module
, "vpy_getVSApi", (void (**)(void))&__pyx_f_11vapoursynth_vpy_getVSApi
, "VSAPI const *(void)") < 0) goto bad
;
120 if (__Pyx_ImportFunction(module
, "vpy_getVariable", (void (**)(void))&__pyx_f_11vapoursynth_vpy_getVariable
, "int (struct VPYScriptExport *, char const *, VSMap *)") < 0) goto bad
;
121 if (__Pyx_ImportFunction(module
, "vpy_setVariable", (void (**)(void))&__pyx_f_11vapoursynth_vpy_setVariable
, "void (struct VPYScriptExport *, VSMap const *)") < 0) goto bad
;
122 if (__Pyx_ImportFunction(module
, "vpy_clearVariable", (void (**)(void))&__pyx_f_11vapoursynth_vpy_clearVariable
, "int (struct VPYScriptExport *, char const *)") < 0) goto bad
;
123 if (__Pyx_ImportFunction(module
, "vpy_clearEnvironment", (void (**)(void))&__pyx_f_11vapoursynth_vpy_clearEnvironment
, "void (struct VPYScriptExport *)") < 0) goto bad
;
124 if (__Pyx_ImportFunction(module
, "vpy_initVSScript", (void (**)(void))&__pyx_f_11vapoursynth_vpy_initVSScript
, "void (void)") < 0) goto bad
;
125 Py_DECREF(module
); module
= 0;
132 #endif /* !__PYX_HAVE_API__vapoursynth */