File: pygame_sdl2.display_api.h

package info (click to toggle)
pygame-sdl2 8.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,192 kB
  • sloc: ansic: 9,677; python: 1,953; makefile: 6
file content (62 lines) | stat: -rw-r--r-- 1,930 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* Generated by Cython 3.0.8 */

#ifndef __PYX_HAVE_API__pygame_sdl2__display
#define __PYX_HAVE_API__pygame_sdl2__display
#ifdef __MINGW64__
#define MS_WIN64
#endif
#include "Python.h"

static SDL_Window *(*__pyx_api_f_11pygame_sdl2_7display_PyWindow_AsWindow)(PyObject *) = 0;
#define PyWindow_AsWindow __pyx_api_f_11pygame_sdl2_7display_PyWindow_AsWindow
#ifndef __PYX_HAVE_RT_ImportFunction_3_0_8
#define __PYX_HAVE_RT_ImportFunction_3_0_8
static int __Pyx_ImportFunction_3_0_8(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 = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, funcname);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C function %.200s",
                PyModule_GetName(module), funcname);
        goto bad;
    }
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    tmp.p = PyCapsule_GetPointer(cobj, sig);
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif


static int import_pygame_sdl2__display(void) {
  PyObject *module = 0;
  module = PyImport_ImportModule("pygame_sdl2.display");
  if (!module) goto bad;
  if (__Pyx_ImportFunction_3_0_8(module, "PyWindow_AsWindow", (void (**)(void))&__pyx_api_f_11pygame_sdl2_7display_PyWindow_AsWindow, "SDL_Window *(PyObject *)") < 0) goto bad;
  Py_DECREF(module); module = 0;
  return 0;
  bad:
  Py_XDECREF(module);
  return -1;
}

#endif /* !__PYX_HAVE_API__pygame_sdl2__display */