Source

py-sdl2 / sdl2 / stdinc.py

import sys
from .dll import _bind
from ctypes import c_int, c_int8, c_uint8, c_int16, c_uint16, c_int32, \
    c_uint32, c_int64, c_uint64, cdll, c_size_t, c_void_p, c_char_p
from ctypes.util import find_library

__all__ = ["SDL_FALSE", "SDL_TRUE", "SDL_bool", "Sint8", "Uint8", "Sint16",
           "Uint16", "Sint32", "Uint32", "Sint64", "Uint64", "SDL_malloc",
           "SDL_calloc", "SDL_realloc", "SDL_free", "SDL_getenv",
           "SDL_setenv", "SDL_abs", "SDL_min", "SDL_max", "SDL_memset",
           "SDL_memcpy"
           ]

SDL_FALSE = 0
SDL_TRUE = 1

SDL_bool = c_int
Sint8 = c_int8
Uint8 = c_uint8
Sint16 = c_int16
Uint16 = c_uint16
Sint32 = c_int32
Uint32 = c_uint32
Sint64 = c_int64
Uint64 = c_uint64

SDL_malloc = _bind("SDL_malloc", [c_size_t], c_void_p)
SDL_calloc = _bind("SDL_calloc", [c_size_t, c_size_t], c_void_p)
SDL_realloc = _bind("SDL_realloc", [c_void_p, c_size_t], c_void_p)
SDL_free = _bind("SDL_free", [c_void_p], None)
SDL_getenv = _bind("SDL_getenv", [c_char_p], c_char_p)
SDL_setenv = _bind("SDL_setenv", [c_char_p, c_char_p, c_int], c_int)
SDL_abs = abs
SDL_min = min
SDL_max = max
SDL_memset = _bind("SDL_memset", [c_void_p, c_int, c_size_t], c_void_p)
SDL_memcpy = _bind("SDL_memcpy", [c_void_p, c_void_p, c_size_t], c_void_p)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.