/* Generated by Cython 3.0.10 */

#ifndef __PYX_HAVE_API__vapoursynth
#define __PYX_HAVE_API__vapoursynth

#ifdef __MINGW64__
#define MS_WIN64
#endif

#define Py_LIMITED_API 0x030C0000

#include "Python.h"
#include "vapoursynth.h"


static decltype(_Py_DecRef) *p_Py_DecRef = nullptr;
static decltype(PyObject_GetAttrString) *p_PyObject_GetAttrString = nullptr;
static decltype(PyDict_GetItemString) *p_PyDict_GetItemString = nullptr;
static decltype(PyCapsule_IsValid) *p_PyCapsule_IsValid = nullptr;
static decltype(PyCapsule_GetPointer) *p_PyCapsule_GetPointer = nullptr;
static decltype(PyImport_ImportModule) *p_PyImport_ImportModule = nullptr;
static decltype(Py_IsInitialized) *p_Py_IsInitialized = nullptr;
static decltype(Py_InitializeEx) *p_Py_InitializeEx = nullptr;
static decltype(PyGILState_Ensure) *p_PyGILState_Ensure = nullptr;
static decltype(PyEval_SaveThread) *p_PyEval_SaveThread = nullptr;
static decltype(Py_SetProgramName) *p_Py_SetProgramName = nullptr;


static int (*__pyx_api_f_11vapoursynth_vpy4_createScript)(VSScript *) = 0;
#define vpy4_createScript __pyx_api_f_11vapoursynth_vpy4_createScript
static int (*__pyx_api_f_11vapoursynth_vpy4_evaluateBuffer)(VSScript *, char const *, char const *) = 0;
#define vpy4_evaluateBuffer __pyx_api_f_11vapoursynth_vpy4_evaluateBuffer
static int (*__pyx_api_f_11vapoursynth_vpy4_evaluateFile)(VSScript *, char const *) = 0;
#define vpy4_evaluateFile __pyx_api_f_11vapoursynth_vpy4_evaluateFile
static void (*__pyx_api_f_11vapoursynth_vpy4_freeScript)(VSScript *) = 0;
#define vpy4_freeScript __pyx_api_f_11vapoursynth_vpy4_freeScript
static char const *(*__pyx_api_f_11vapoursynth_vpy4_getError)(VSScript *) = 0;
#define vpy4_getError __pyx_api_f_11vapoursynth_vpy4_getError
static VSNode *(*__pyx_api_f_11vapoursynth_vpy4_getOutput)(VSScript *, int) = 0;
#define vpy4_getOutput __pyx_api_f_11vapoursynth_vpy4_getOutput
static VSNode *(*__pyx_api_f_11vapoursynth_vpy4_getAlphaOutput)(VSScript *, int) = 0;
#define vpy4_getAlphaOutput __pyx_api_f_11vapoursynth_vpy4_getAlphaOutput
static int (*__pyx_api_f_11vapoursynth_vpy4_getAltOutputMode)(VSScript *, int) = 0;
#define vpy4_getAltOutputMode __pyx_api_f_11vapoursynth_vpy4_getAltOutputMode
static int (*__pyx_api_f_11vapoursynth_vpy4_getAvailableOutputNodes)(VSScript *, int, int *) = 0;
#define vpy4_getAvailableOutputNodes __pyx_api_f_11vapoursynth_vpy4_getAvailableOutputNodes
static VSCore *(*__pyx_api_f_11vapoursynth_vpy4_getCore)(VSScript *) = 0;
#define vpy4_getCore __pyx_api_f_11vapoursynth_vpy4_getCore
static VSAPI const *(*__pyx_api_f_11vapoursynth_vpy4_getVSAPI)(int) = 0;
#define vpy4_getVSAPI __pyx_api_f_11vapoursynth_vpy4_getVSAPI
static int (*__pyx_api_f_11vapoursynth_vpy4_getVariable)(VSScript *, char const *, VSMap *) = 0;
#define vpy4_getVariable __pyx_api_f_11vapoursynth_vpy4_getVariable
static int (*__pyx_api_f_11vapoursynth_vpy4_setVariables)(VSScript *, VSMap const *) = 0;
#define vpy4_setVariables __pyx_api_f_11vapoursynth_vpy4_setVariables
static int (*__pyx_api_f_11vapoursynth_vpy4_initVSScript)(void) = 0;
#define vpy4_initVSScript __pyx_api_f_11vapoursynth_vpy4_initVSScript

#ifndef __PYX_HAVE_RT_ImportFunction
#define __PYX_HAVE_RT_ImportFunction
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = p_PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = p_PyDict_GetItemString(d, funcname);
    if (!cobj) {
        goto bad;
    }

    if (!p_PyCapsule_IsValid(cobj, sig)) {
        goto bad;
    }
    tmp.p = p_PyCapsule_GetPointer(cobj, sig);

    *f = tmp.fp;
    if (!(*f))
        goto bad;
    p_Py_DecRef(d);
    return 0;
bad:
    if (d)
        p_Py_DecRef(d);
    return -1;
}
#endif


static int import_vapoursynth(void) {
  PyObject *module = 0;
  module = p_PyImport_ImportModule("vapoursynth");
  if (!module) goto bad;
  if (__Pyx_ImportFunction(module, "vpy4_createScript", (void (**)(void))&__pyx_api_f_11vapoursynth_vpy4_createScript, "int (VSScript *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "vpy4_evaluateBuffer", (void (**)(void))&__pyx_api_f_11vapoursynth_vpy4_evaluateBuffer, "int (VSScript *, char const *, char const *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "vpy4_evaluateFile", (void (**)(void))&__pyx_api_f_11vapoursynth_vpy4_evaluateFile, "int (VSScript *, char const *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "vpy4_freeScript", (void (**)(void))&__pyx_api_f_11vapoursynth_vpy4_freeScript, "void (VSScript *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "vpy4_getError", (void (**)(void))&__pyx_api_f_11vapoursynth_vpy4_getError, "char const *(VSScript *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "vpy4_getOutput", (void (**)(void))&__pyx_api_f_11vapoursynth_vpy4_getOutput, "VSNode *(VSScript *, int)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "vpy4_getAlphaOutput", (void (**)(void))&__pyx_api_f_11vapoursynth_vpy4_getAlphaOutput, "VSNode *(VSScript *, int)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "vpy4_getAltOutputMode", (void (**)(void))&__pyx_api_f_11vapoursynth_vpy4_getAltOutputMode, "int (VSScript *, int)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "vpy4_getAvailableOutputNodes", (void (**)(void))&__pyx_api_f_11vapoursynth_vpy4_getAvailableOutputNodes, "int (VSScript *, int, int *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "vpy4_getCore", (void (**)(void))&__pyx_api_f_11vapoursynth_vpy4_getCore, "VSCore *(VSScript *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "vpy4_getVSAPI", (void (**)(void))&__pyx_api_f_11vapoursynth_vpy4_getVSAPI, "VSAPI const *(int)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "vpy4_getVariable", (void (**)(void))&__pyx_api_f_11vapoursynth_vpy4_getVariable, "int (VSScript *, char const *, VSMap *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "vpy4_setVariables", (void (**)(void))&__pyx_api_f_11vapoursynth_vpy4_setVariables, "int (VSScript *, VSMap const *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "vpy4_initVSScript", (void (**)(void))&__pyx_api_f_11vapoursynth_vpy4_initVSScript, "int (void)") < 0) goto bad;
  p_Py_DecRef(module); module = 0;
  return 0;
bad:
  if (module)
      p_Py_DecRef(module);
  return -1;
}

#endif /* !__PYX_HAVE_API__vapoursynth */
