~evantj/hare-raylib

fe076533ccbdd210d9f3407d602154d24b9123e6 — Autumn! 9 months ago 8a4c745
Convert *void to *opaque and c::schar to c::char

Signed-off-by: Autumn! <autumnull@posteo.net>
3 files changed, 128 insertions(+), 126 deletions(-)

M cmd/demo/main.ha
M hare-raylib.py
M raylib/raylib.ha
M cmd/demo/main.ha => cmd/demo/main.ha +2 -2
@@ 45,8 45,8 @@ export fn main() void = {

	for (!raylib::WindowShouldClose()) {
		cam_angle += 0.01;
		cam.position.x = math::sinf64(cam_angle) * 10.0;
		cam.position.z = math::cosf64(cam_angle) * 10.0;
		cam.position.x = math::sinf64(cam_angle): f32 * 10.0;
		cam.position.z = math::cosf64(cam_angle): f32 * 10.0;

		raylib::BeginDrawing();
		raylib::ClearBackground(raylib::RAYWHITE);

M hare-raylib.py => hare-raylib.py +5 -3
@@ 14,7 14,7 @@ types = {
    "int": ("int", "uint"),
    "float": "f32",
    "double": "f64",
    "char": ("c::schar", "c::uchar"),
    "char": ("c::char", "c::uchar"),
    "short": ("c::short", "c::ushort"),
    "long": ("c::long", "c::ulong"),
    "va_list": "valist",


@@ 53,6 53,8 @@ def ctype_to_hare(ctype, unsigned = False, wrapping = False, pointer_array = Fal
        modifier = ctype[ctype.index('*'):]
        if pointer_array:
            modifier = modifier.replace('*', '*[*]')
        if base == "void":
            base = "opaque"
        return modifier + base
    if ctype in types:
        if type(types[ctype]) is str:


@@ 185,10 187,10 @@ print(
use types::c;

// internal to raudio
export type rAudioProcessor = void;
export type rAudioProcessor = opaque;

// internal to raudio
export type rAudioBuffer = void;
export type rAudioBuffer = opaque;

"""
)

M raylib/raylib.ha => raylib/raylib.ha +121 -121
@@ 2,10 2,10 @@
use types::c;

// internal to raudio
export type rAudioProcessor = void;
export type rAudioProcessor = opaque;

// internal to raudio
export type rAudioBuffer = void;
export type rAudioBuffer = opaque;


export def RAYLIB_VERSION: str = "4.5";


@@ 187,7 187,7 @@ export type Rectangle = struct {
// Image, pixel data stored in CPU memory (RAM)
export type Image = struct {
	// Image raw data
	data: *[*]void,
	data: *[*]opaque,
	// Image base width
	width: int,
	// Image base height


@@ 369,7 369,7 @@ export type Transform = struct {
// Bone, skeletal animation bone
export type BoneInfo = struct {
	// Bone name
	name: [32]c::schar,
	name: [32]c::char,
	// Bone parent
	parent: int,
};


@@ 447,7 447,7 @@ export type Wave = struct {
	// Number of channels (1-mono, 2-stereo, ...)
	channels: uint,
	// Buffer data pointer
	data: *[*]void,
	data: *[*]opaque,
};

// AudioStream, custom audio stream


@@ 483,7 483,7 @@ export type Music = struct {
	// Type of music context (audio filetype)
	ctxType: int,
	// Audio context data, depends on type
	ctxData: *[*]void,
	ctxData: *[*]opaque,
};

// VrDeviceInfo, Head-Mounted-Display device parameters


@@ 537,7 537,7 @@ export type FilePathList = struct {
	// Filepaths entries count
	count: uint,
	// Filepaths entries
	paths: *[*]*[*]c::schar,
	paths: *[*]*[*]c::char,
};

// Quaternion, 4 components (Vector4 alias)


@@ 1228,23 1228,23 @@ export type NPatchLayout = enum {
};

// Logging: Redirect trace log messages
export type TraceLogCallback = *fn(logLevel: int, text: const *c::schar, args: valist) void;
export type TraceLogCallback = *fn(logLevel: int, text: const *c::char, args: valist) void;

// FileIO: Load binary data
export type LoadFileDataCallback = *fn(fileName: const *c::schar, bytesRead: *uint) *c::uchar;
export type LoadFileDataCallback = *fn(fileName: const *c::char, bytesRead: *uint) *c::uchar;

// FileIO: Save binary data
export type SaveFileDataCallback = *fn(fileName: const *c::schar, data: *void, bytesToWrite: uint) bool;
export type SaveFileDataCallback = *fn(fileName: const *c::char, data: *opaque, bytesToWrite: uint) bool;

// FileIO: Load text data
export type LoadFileTextCallback = *fn(fileName: const *c::schar) *c::schar;
export type LoadFileTextCallback = *fn(fileName: const *c::char) *c::char;

// FileIO: Save text data
export type SaveFileTextCallback = *fn(fileName: const *c::schar, text: *c::schar) bool;
export type SaveFileTextCallback = *fn(fileName: const *c::char, text: *c::char) bool;

export type AudioCallback = *fn(bufferData: *void, frames: uint) void;
export type AudioCallback = *fn(bufferData: *opaque, frames: uint) void;

@symbol("InitWindow") fn _InitWindow(width: int, height: int, title: const *c::schar) void;
@symbol("InitWindow") fn _InitWindow(width: int, height: int, title: const *c::char) void;

// Initialize window and OpenGL context
export fn InitWindow(width: int, height: int, title: const str) void = {


@@ 1307,7 1307,7 @@ export @symbol("SetWindowIcon") fn SetWindowIcon(image: Image) void;
// Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP)
export @symbol("SetWindowIcons") fn SetWindowIcons(images: *Image, count: int) void;

@symbol("SetWindowTitle") fn _SetWindowTitle(title: const *c::schar) void;
@symbol("SetWindowTitle") fn _SetWindowTitle(title: const *c::char) void;

// Set title for window (only PLATFORM_DESKTOP)
export fn SetWindowTitle(title: const str) void = {


@@ 1332,7 1332,7 @@ export @symbol("SetWindowSize") fn SetWindowSize(width: int, height: int) void;
export @symbol("SetWindowOpacity") fn SetWindowOpacity(opacity: f32) void;

// Get native window handle
export @symbol("GetWindowHandle") fn GetWindowHandle() *void;
export @symbol("GetWindowHandle") fn GetWindowHandle() *opaque;

// Get current screen width
export @symbol("GetScreenWidth") fn GetScreenWidth() int;


@@ 1376,14 1376,14 @@ export @symbol("GetWindowPosition") fn GetWindowPosition() Vector2;
// Get window scale DPI factor
export @symbol("GetWindowScaleDPI") fn GetWindowScaleDPI() Vector2;

@symbol("GetMonitorName") fn _GetMonitorName(monitor: int) const *c::schar;
@symbol("GetMonitorName") fn _GetMonitorName(monitor: int) const *c::char;

// Get the human-readable, UTF-8 encoded name of the primary monitor
export fn GetMonitorName(monitor: int) const str = {
	return c::tostr(_GetMonitorName(monitor))!;
};

@symbol("SetClipboardText") fn _SetClipboardText(text: const *c::schar) void;
@symbol("SetClipboardText") fn _SetClipboardText(text: const *c::char) void;

// Set clipboard text content
export fn SetClipboardText(text: const str) void = {


@@ 1392,7 1392,7 @@ export fn SetClipboardText(text: const str) void = {
	return _SetClipboardText(text_cstring);
};

@symbol("GetClipboardText") fn _GetClipboardText() const *c::schar;
@symbol("GetClipboardText") fn _GetClipboardText() const *c::char;

// Get clipboard text content
export fn GetClipboardText() const str = {


@@ 1489,7 1489,7 @@ export @symbol("LoadVrStereoConfig") fn LoadVrStereoConfig(device: VrDeviceInfo)
// Unload VR stereo config
export @symbol("UnloadVrStereoConfig") fn UnloadVrStereoConfig(config: VrStereoConfig) void;

@symbol("LoadShader") fn _LoadShader(vsFileName: const *c::schar, fsFileName: const *c::schar) Shader;
@symbol("LoadShader") fn _LoadShader(vsFileName: const *c::char, fsFileName: const *c::char) Shader;

// Load shader from files and bind default locations
export fn LoadShader(vsFileName: const str, fsFileName: const str) Shader = {


@@ 1500,7 1500,7 @@ export fn LoadShader(vsFileName: const str, fsFileName: const str) Shader = {
	return _LoadShader(vsFileName_cstring, fsFileName_cstring);
};

@symbol("LoadShaderFromMemory") fn _LoadShaderFromMemory(vsCode: const *c::schar, fsCode: const *c::schar) Shader;
@symbol("LoadShaderFromMemory") fn _LoadShaderFromMemory(vsCode: const *c::char, fsCode: const *c::char) Shader;

// Load shader from code strings and bind default locations
export fn LoadShaderFromMemory(vsCode: const str, fsCode: const str) Shader = {


@@ 1514,7 1514,7 @@ export fn LoadShaderFromMemory(vsCode: const str, fsCode: const str) Shader = {
// Check if a shader is ready
export @symbol("IsShaderReady") fn IsShaderReady(shader: Shader) bool;

@symbol("GetShaderLocation") fn _GetShaderLocation(shader: Shader, uniformName: const *c::schar) int;
@symbol("GetShaderLocation") fn _GetShaderLocation(shader: Shader, uniformName: const *c::char) int;

// Get shader uniform location
export fn GetShaderLocation(shader: Shader, uniformName: const str) int = {


@@ 1523,7 1523,7 @@ export fn GetShaderLocation(shader: Shader, uniformName: const str) int = {
	return _GetShaderLocation(shader, uniformName_cstring);
};

@symbol("GetShaderLocationAttrib") fn _GetShaderLocationAttrib(shader: Shader, attribName: const *c::schar) int;
@symbol("GetShaderLocationAttrib") fn _GetShaderLocationAttrib(shader: Shader, attribName: const *c::char) int;

// Get shader attribute location
export fn GetShaderLocationAttrib(shader: Shader, attribName: const str) int = {


@@ 1533,10 1533,10 @@ export fn GetShaderLocationAttrib(shader: Shader, attribName: const str) int = {
};

// Set shader uniform value
export @symbol("SetShaderValue") fn SetShaderValue(shader: Shader, locIndex: int, value: const *void, uniformType: int) void;
export @symbol("SetShaderValue") fn SetShaderValue(shader: Shader, locIndex: int, value: const *opaque, uniformType: int) void;

// Set shader uniform value vector
export @symbol("SetShaderValueV") fn SetShaderValueV(shader: Shader, locIndex: int, value: const *void, uniformType: int, count: int) void;
export @symbol("SetShaderValueV") fn SetShaderValueV(shader: Shader, locIndex: int, value: const *opaque, uniformType: int, count: int) void;

// Set shader uniform value (matrix 4x4)
export @symbol("SetShaderValueMatrix") fn SetShaderValueMatrix(shader: Shader, locIndex: int, mat: Matrix) void;


@@ 1586,7 1586,7 @@ export @symbol("GetRandomValue") fn GetRandomValue(min: int, max: int) int;
// Set the seed for the random number generator
export @symbol("SetRandomSeed") fn SetRandomSeed(seed: uint) void;

@symbol("TakeScreenshot") fn _TakeScreenshot(fileName: const *c::schar) void;
@symbol("TakeScreenshot") fn _TakeScreenshot(fileName: const *c::char) void;

// Takes a screenshot of current screen (filename extension defines format)
export fn TakeScreenshot(fileName: const str) void = {


@@ 1599,21 1599,21 @@ export fn TakeScreenshot(fileName: const str) void = {
export @symbol("SetConfigFlags") fn SetConfigFlags(flags: uint) void;

// Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
export @symbol("TraceLog") fn TraceLog(logLevel: int, text: const *c::schar, ...) void;
export @symbol("TraceLog") fn TraceLog(logLevel: int, text: const *c::char, ...) void;

// Set the current threshold (minimum) log level
export @symbol("SetTraceLogLevel") fn SetTraceLogLevel(logLevel: int) void;

// Internal memory allocator
export @symbol("MemAlloc") fn MemAlloc(_size: uint) *void;
export @symbol("MemAlloc") fn MemAlloc(_size: uint) *opaque;

// Internal memory reallocator
export @symbol("MemRealloc") fn MemRealloc(ptr: *void, _size: uint) *void;
export @symbol("MemRealloc") fn MemRealloc(ptr: *opaque, _size: uint) *opaque;

// Internal memory free
export @symbol("MemFree") fn MemFree(ptr: *void) void;
export @symbol("MemFree") fn MemFree(ptr: *opaque) void;

@symbol("OpenURL") fn _OpenURL(url: const *c::schar) void;
@symbol("OpenURL") fn _OpenURL(url: const *c::char) void;

// Open URL with default system browser (if available)
export fn OpenURL(url: const str) void = {


@@ 1637,7 1637,7 @@ export @symbol("SetLoadFileTextCallback") fn SetLoadFileTextCallback(callback: L
// Set custom file text data saver
export @symbol("SetSaveFileTextCallback") fn SetSaveFileTextCallback(callback: SaveFileTextCallback) void;

@symbol("LoadFileData") fn _LoadFileData(fileName: const *c::schar, bytesRead: *uint) *c::uchar;
@symbol("LoadFileData") fn _LoadFileData(fileName: const *c::char, bytesRead: *uint) *c::uchar;

// Load file data as byte array (read)
export fn LoadFileData(fileName: const str, bytesRead: *uint) *c::uchar = {


@@ 1649,16 1649,16 @@ export fn LoadFileData(fileName: const str, bytesRead: *uint) *c::uchar = {
// Unload file data allocated by LoadFileData()
export @symbol("UnloadFileData") fn UnloadFileData(data: *c::uchar) void;

@symbol("SaveFileData") fn _SaveFileData(fileName: const *c::schar, data: *void, bytesToWrite: uint) bool;
@symbol("SaveFileData") fn _SaveFileData(fileName: const *c::char, data: *opaque, bytesToWrite: uint) bool;

// Save data to file from byte array (write), returns true on success
export fn SaveFileData(fileName: const str, data: *void, bytesToWrite: uint) bool = {
export fn SaveFileData(fileName: const str, data: *opaque, bytesToWrite: uint) bool = {
	let fileName_cstring: *c::char = c::fromstr(fileName);
	defer free(fileName_cstring);
	return _SaveFileData(fileName_cstring, data, bytesToWrite);
};

@symbol("ExportDataAsCode") fn _ExportDataAsCode(data: const *c::uchar, _size: uint, fileName: const *c::schar) bool;
@symbol("ExportDataAsCode") fn _ExportDataAsCode(data: const *c::uchar, _size: uint, fileName: const *c::char) bool;

// Export data to code (.h), returns true on success
export fn ExportDataAsCode(data: const *c::uchar, _size: uint, fileName: const str) bool = {


@@ 1667,7 1667,7 @@ export fn ExportDataAsCode(data: const *c::uchar, _size: uint, fileName: const s
	return _ExportDataAsCode(data, _size, fileName_cstring);
};

@symbol("LoadFileText") fn _LoadFileText(fileName: const *c::schar) *c::schar;
@symbol("LoadFileText") fn _LoadFileText(fileName: const *c::char) *c::char;

// Load text data from file (read), returns a '\0' terminated string
export fn LoadFileText(fileName: const str) str = {


@@ 1676,7 1676,7 @@ export fn LoadFileText(fileName: const str) str = {
	return c::tostr(_LoadFileText(fileName_cstring))!;
};

@symbol("UnloadFileText") fn _UnloadFileText(text: *c::schar) void;
@symbol("UnloadFileText") fn _UnloadFileText(text: *c::char) void;

// Unload file text data allocated by LoadFileText()
export fn UnloadFileText(text: str) void = {


@@ 1685,7 1685,7 @@ export fn UnloadFileText(text: str) void = {
	return _UnloadFileText(text_cstring);
};

@symbol("SaveFileText") fn _SaveFileText(fileName: const *c::schar, text: *c::schar) bool;
@symbol("SaveFileText") fn _SaveFileText(fileName: const *c::char, text: *c::char) bool;

// Save text data to file (write), string must be '\0' terminated, returns true on success
export fn SaveFileText(fileName: const str, text: str) bool = {


@@ 1696,7 1696,7 @@ export fn SaveFileText(fileName: const str, text: str) bool = {
	return _SaveFileText(fileName_cstring, text_cstring);
};

@symbol("FileExists") fn _FileExists(fileName: const *c::schar) bool;
@symbol("FileExists") fn _FileExists(fileName: const *c::char) bool;

// Check if file exists
export fn FileExists(fileName: const str) bool = {


@@ 1705,7 1705,7 @@ export fn FileExists(fileName: const str) bool = {
	return _FileExists(fileName_cstring);
};

@symbol("DirectoryExists") fn _DirectoryExists(dirPath: const *c::schar) bool;
@symbol("DirectoryExists") fn _DirectoryExists(dirPath: const *c::char) bool;

// Check if a directory path exists
export fn DirectoryExists(dirPath: const str) bool = {


@@ 1714,7 1714,7 @@ export fn DirectoryExists(dirPath: const str) bool = {
	return _DirectoryExists(dirPath_cstring);
};

@symbol("IsFileExtension") fn _IsFileExtension(fileName: const *c::schar, ext: const *c::schar) bool;
@symbol("IsFileExtension") fn _IsFileExtension(fileName: const *c::char, ext: const *c::char) bool;

// Check file extension (including point: .png, .wav)
export fn IsFileExtension(fileName: const str, ext: const str) bool = {


@@ 1725,7 1725,7 @@ export fn IsFileExtension(fileName: const str, ext: const str) bool = {
	return _IsFileExtension(fileName_cstring, ext_cstring);
};

@symbol("GetFileLength") fn _GetFileLength(fileName: const *c::schar) int;
@symbol("GetFileLength") fn _GetFileLength(fileName: const *c::char) int;

// Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)
export fn GetFileLength(fileName: const str) int = {


@@ 1734,7 1734,7 @@ export fn GetFileLength(fileName: const str) int = {
	return _GetFileLength(fileName_cstring);
};

@symbol("GetFileExtension") fn _GetFileExtension(fileName: const *c::schar) const *c::schar;
@symbol("GetFileExtension") fn _GetFileExtension(fileName: const *c::char) const *c::char;

// Get pointer to extension for a filename string (includes dot: '.png')
export fn GetFileExtension(fileName: const str) const str = {


@@ 1743,7 1743,7 @@ export fn GetFileExtension(fileName: const str) const str = {
	return c::tostr(_GetFileExtension(fileName_cstring))!;
};

@symbol("GetFileName") fn _GetFileName(filePath: const *c::schar) const *c::schar;
@symbol("GetFileName") fn _GetFileName(filePath: const *c::char) const *c::char;

// Get pointer to filename for a path string
export fn GetFileName(filePath: const str) const str = {


@@ 1752,7 1752,7 @@ export fn GetFileName(filePath: const str) const str = {
	return c::tostr(_GetFileName(filePath_cstring))!;
};

@symbol("GetFileNameWithoutExt") fn _GetFileNameWithoutExt(filePath: const *c::schar) const *c::schar;
@symbol("GetFileNameWithoutExt") fn _GetFileNameWithoutExt(filePath: const *c::char) const *c::char;

// Get filename string without extension (uses static string)
export fn GetFileNameWithoutExt(filePath: const str) const str = {


@@ 1761,7 1761,7 @@ export fn GetFileNameWithoutExt(filePath: const str) const str = {
	return c::tostr(_GetFileNameWithoutExt(filePath_cstring))!;
};

@symbol("GetDirectoryPath") fn _GetDirectoryPath(filePath: const *c::schar) const *c::schar;
@symbol("GetDirectoryPath") fn _GetDirectoryPath(filePath: const *c::char) const *c::char;

// Get full path for a given fileName with path (uses static string)
export fn GetDirectoryPath(filePath: const str) const str = {


@@ 1770,7 1770,7 @@ export fn GetDirectoryPath(filePath: const str) const str = {
	return c::tostr(_GetDirectoryPath(filePath_cstring))!;
};

@symbol("GetPrevDirectoryPath") fn _GetPrevDirectoryPath(dirPath: const *c::schar) const *c::schar;
@symbol("GetPrevDirectoryPath") fn _GetPrevDirectoryPath(dirPath: const *c::char) const *c::char;

// Get previous directory path for a given path (uses static string)
export fn GetPrevDirectoryPath(dirPath: const str) const str = {


@@ 1779,21 1779,21 @@ export fn GetPrevDirectoryPath(dirPath: const str) const str = {
	return c::tostr(_GetPrevDirectoryPath(dirPath_cstring))!;
};

@symbol("GetWorkingDirectory") fn _GetWorkingDirectory() const *c::schar;
@symbol("GetWorkingDirectory") fn _GetWorkingDirectory() const *c::char;

// Get current working directory (uses static string)
export fn GetWorkingDirectory() const str = {
	return c::tostr(_GetWorkingDirectory())!;
};

@symbol("GetApplicationDirectory") fn _GetApplicationDirectory() const *c::schar;
@symbol("GetApplicationDirectory") fn _GetApplicationDirectory() const *c::char;

// Get the directory if the running application (uses static string)
export fn GetApplicationDirectory() const str = {
	return c::tostr(_GetApplicationDirectory())!;
};

@symbol("ChangeDirectory") fn _ChangeDirectory(dir: const *c::schar) bool;
@symbol("ChangeDirectory") fn _ChangeDirectory(dir: const *c::char) bool;

// Change working directory, return true on success
export fn ChangeDirectory(dir: const str) bool = {


@@ 1802,7 1802,7 @@ export fn ChangeDirectory(dir: const str) bool = {
	return _ChangeDirectory(dir_cstring);
};

@symbol("IsPathFile") fn _IsPathFile(path: const *c::schar) bool;
@symbol("IsPathFile") fn _IsPathFile(path: const *c::char) bool;

// Check if a given path is a file or a directory
export fn IsPathFile(path: const str) bool = {


@@ 1811,7 1811,7 @@ export fn IsPathFile(path: const str) bool = {
	return _IsPathFile(path_cstring);
};

@symbol("LoadDirectoryFiles") fn _LoadDirectoryFiles(dirPath: const *c::schar) FilePathList;
@symbol("LoadDirectoryFiles") fn _LoadDirectoryFiles(dirPath: const *c::char) FilePathList;

// Load directory filepaths
export fn LoadDirectoryFiles(dirPath: const str) FilePathList = {


@@ 1820,7 1820,7 @@ export fn LoadDirectoryFiles(dirPath: const str) FilePathList = {
	return _LoadDirectoryFiles(dirPath_cstring);
};

@symbol("LoadDirectoryFilesEx") fn _LoadDirectoryFilesEx(basePath: const *c::schar, filter: const *c::schar, scanSubdirs: bool) FilePathList;
@symbol("LoadDirectoryFilesEx") fn _LoadDirectoryFilesEx(basePath: const *c::char, filter: const *c::char, scanSubdirs: bool) FilePathList;

// Load directory filepaths with extension filtering and recursive directory scan
export fn LoadDirectoryFilesEx(basePath: const str, filter: const str, scanSubdirs: bool) FilePathList = {


@@ 1843,7 1843,7 @@ export @symbol("LoadDroppedFiles") fn LoadDroppedFiles() FilePathList;
// Unload dropped filepaths
export @symbol("UnloadDroppedFiles") fn UnloadDroppedFiles(files: FilePathList) void;

@symbol("GetFileModTime") fn _GetFileModTime(fileName: const *c::schar) c::long;
@symbol("GetFileModTime") fn _GetFileModTime(fileName: const *c::char) c::long;

// Get file modification time (last write time)
export fn GetFileModTime(fileName: const str) c::long = {


@@ 1858,7 1858,7 @@ export @symbol("CompressData") fn CompressData(data: const *c::uchar, dataSize: 
// Decompress data (DEFLATE algorithm), memory must be MemFree()
export @symbol("DecompressData") fn DecompressData(compData: const *c::uchar, compDataSize: int, dataSize: *int) *c::uchar;

@symbol("EncodeDataBase64") fn _EncodeDataBase64(data: const *c::uchar, dataSize: int, outputSize: *int) *c::schar;
@symbol("EncodeDataBase64") fn _EncodeDataBase64(data: const *c::uchar, dataSize: int, outputSize: *int) *c::char;

// Encode data to Base64 string, memory must be MemFree()
export fn EncodeDataBase64(data: const *c::uchar, dataSize: int, outputSize: *int) str = {


@@ 1892,7 1892,7 @@ export @symbol("GetCharPressed") fn GetCharPressed() int;
// Check if a gamepad is available
export @symbol("IsGamepadAvailable") fn IsGamepadAvailable(gamepad: int) bool;

@symbol("GetGamepadName") fn _GetGamepadName(gamepad: int) const *c::schar;
@symbol("GetGamepadName") fn _GetGamepadName(gamepad: int) const *c::char;

// Get gamepad internal name id
export fn GetGamepadName(gamepad: int) const str = {


@@ 1920,7 1920,7 @@ export @symbol("GetGamepadAxisCount") fn GetGamepadAxisCount(gamepad: int) int;
// Get axis movement value for a gamepad axis
export @symbol("GetGamepadAxisMovement") fn GetGamepadAxisMovement(gamepad: int, axis: int) f32;

@symbol("SetGamepadMappings") fn _SetGamepadMappings(mappings: const *c::schar) int;
@symbol("SetGamepadMappings") fn _SetGamepadMappings(mappings: const *c::char) int;

// Set internal gamepad mappings (SDL_GameControllerDB)
export fn SetGamepadMappings(mappings: const str) int = {


@@ 2160,7 2160,7 @@ export @symbol("CheckCollisionPointLine") fn CheckCollisionPointLine(point: Vect
// Get collision rectangle for two rectangles collision
export @symbol("GetCollisionRec") fn GetCollisionRec(rec1: Rectangle, rec2: Rectangle) Rectangle;

@symbol("LoadImage") fn _LoadImage(fileName: const *c::schar) Image;
@symbol("LoadImage") fn _LoadImage(fileName: const *c::char) Image;

// Load image from file into CPU memory (RAM)
export fn LoadImage(fileName: const str) Image = {


@@ 2169,7 2169,7 @@ export fn LoadImage(fileName: const str) Image = {
	return _LoadImage(fileName_cstring);
};

@symbol("LoadImageRaw") fn _LoadImageRaw(fileName: const *c::schar, width: int, height: int, format: int, headerSize: int) Image;
@symbol("LoadImageRaw") fn _LoadImageRaw(fileName: const *c::char, width: int, height: int, format: int, headerSize: int) Image;

// Load image from RAW file data
export fn LoadImageRaw(fileName: const str, width: int, height: int, format: int, headerSize: int) Image = {


@@ 2178,7 2178,7 @@ export fn LoadImageRaw(fileName: const str, width: int, height: int, format: int
	return _LoadImageRaw(fileName_cstring, width, height, format, headerSize);
};

@symbol("LoadImageAnim") fn _LoadImageAnim(fileName: const *c::schar, frames: *int) Image;
@symbol("LoadImageAnim") fn _LoadImageAnim(fileName: const *c::char, frames: *int) Image;

// Load image sequence from file (frames appended to image.data)
export fn LoadImageAnim(fileName: const str, frames: *int) Image = {


@@ 2187,7 2187,7 @@ export fn LoadImageAnim(fileName: const str, frames: *int) Image = {
	return _LoadImageAnim(fileName_cstring, frames);
};

@symbol("LoadImageFromMemory") fn _LoadImageFromMemory(fileType: const *c::schar, fileData: const *c::uchar, dataSize: int) Image;
@symbol("LoadImageFromMemory") fn _LoadImageFromMemory(fileType: const *c::char, fileData: const *c::uchar, dataSize: int) Image;

// Load image from memory buffer, fileType refers to extension: i.e. '.png'
export fn LoadImageFromMemory(fileType: const str, fileData: const *c::uchar, dataSize: int) Image = {


@@ 2208,7 2208,7 @@ export @symbol("IsImageReady") fn IsImageReady(image: Image) bool;
// Unload image from CPU memory (RAM)
export @symbol("UnloadImage") fn UnloadImage(image: Image) void;

@symbol("ExportImage") fn _ExportImage(image: Image, fileName: const *c::schar) bool;
@symbol("ExportImage") fn _ExportImage(image: Image, fileName: const *c::char) bool;

// Export image data to file, returns true on success
export fn ExportImage(image: Image, fileName: const str) bool = {


@@ 2217,7 2217,7 @@ export fn ExportImage(image: Image, fileName: const str) bool = {
	return _ExportImage(image, fileName_cstring);
};

@symbol("ExportImageAsCode") fn _ExportImageAsCode(image: Image, fileName: const *c::schar) bool;
@symbol("ExportImageAsCode") fn _ExportImageAsCode(image: Image, fileName: const *c::char) bool;

// Export image as code file defining an array of bytes, returns true on success
export fn ExportImageAsCode(image: Image, fileName: const str) bool = {


@@ 2250,7 2250,7 @@ export @symbol("GenImagePerlinNoise") fn GenImagePerlinNoise(width: int, height:
// Generate image: cellular algorithm, bigger tileSize means bigger cells
export @symbol("GenImageCellular") fn GenImageCellular(width: int, height: int, tileSize: int) Image;

@symbol("GenImageText") fn _GenImageText(width: int, height: int, text: const *c::schar) Image;
@symbol("GenImageText") fn _GenImageText(width: int, height: int, text: const *c::char) Image;

// Generate image: grayscale image from text data
export fn GenImageText(width: int, height: int, text: const str) Image = {


@@ 2265,7 2265,7 @@ export @symbol("ImageCopy") fn ImageCopy(image: Image) Image;
// Create an image from another image piece
export @symbol("ImageFromImage") fn ImageFromImage(image: Image, rec: Rectangle) Image;

@symbol("ImageText") fn _ImageText(text: const *c::schar, fontSize: int, color: Color) Image;
@symbol("ImageText") fn _ImageText(text: const *c::char, fontSize: int, color: Color) Image;

// Create an image from text (default font)
export fn ImageText(text: const str, fontSize: int, color: Color) Image = {


@@ 2274,7 2274,7 @@ export fn ImageText(text: const str, fontSize: int, color: Color) Image = {
	return _ImageText(text_cstring, fontSize, color);
};

@symbol("ImageTextEx") fn _ImageTextEx(font: Font, text: const *c::schar, fontSize: f32, spacing: f32, tint: Color) Image;
@symbol("ImageTextEx") fn _ImageTextEx(font: Font, text: const *c::char, fontSize: f32, spacing: f32, tint: Color) Image;

// Create an image from text (custom sprite font)
export fn ImageTextEx(font: Font, text: const str, fontSize: f32, spacing: f32, tint: Color) Image = {


@@ 2412,7 2412,7 @@ export @symbol("ImageDrawRectangleLines") fn ImageDrawRectangleLines(dst: *Image
// Draw a source image within a destination image (tint applied to source)
export @symbol("ImageDraw") fn ImageDraw(dst: *Image, src: Image, srcRec: Rectangle, dstRec: Rectangle, tint: Color) void;

@symbol("ImageDrawText") fn _ImageDrawText(dst: *Image, text: const *c::schar, posX: int, posY: int, fontSize: int, color: Color) void;
@symbol("ImageDrawText") fn _ImageDrawText(dst: *Image, text: const *c::char, posX: int, posY: int, fontSize: int, color: Color) void;

// Draw text (using default font) within an image (destination)
export fn ImageDrawText(dst: *Image, text: const str, posX: int, posY: int, fontSize: int, color: Color) void = {


@@ 2421,7 2421,7 @@ export fn ImageDrawText(dst: *Image, text: const str, posX: int, posY: int, font
	return _ImageDrawText(dst, text_cstring, posX, posY, fontSize, color);
};

@symbol("ImageDrawTextEx") fn _ImageDrawTextEx(dst: *Image, font: Font, text: const *c::schar, position: Vector2, fontSize: f32, spacing: f32, tint: Color) void;
@symbol("ImageDrawTextEx") fn _ImageDrawTextEx(dst: *Image, font: Font, text: const *c::char, position: Vector2, fontSize: f32, spacing: f32, tint: Color) void;

// Draw text (custom sprite font) within an image (destination)
export fn ImageDrawTextEx(dst: *Image, font: Font, text: const str, position: Vector2, fontSize: f32, spacing: f32, tint: Color) void = {


@@ 2430,7 2430,7 @@ export fn ImageDrawTextEx(dst: *Image, font: Font, text: const str, position: Ve
	return _ImageDrawTextEx(dst, font, text_cstring, position, fontSize, spacing, tint);
};

@symbol("LoadTexture") fn _LoadTexture(fileName: const *c::schar) Texture2D;
@symbol("LoadTexture") fn _LoadTexture(fileName: const *c::char) Texture2D;

// Load texture from file into GPU memory (VRAM)
export fn LoadTexture(fileName: const str) Texture2D = {


@@ 2461,10 2461,10 @@ export @symbol("IsRenderTextureReady") fn IsRenderTextureReady(target: RenderTex
export @symbol("UnloadRenderTexture") fn UnloadRenderTexture(target: RenderTexture2D) void;

// Update GPU texture with new data
export @symbol("UpdateTexture") fn UpdateTexture(texture: Texture2D, pixels: const *void) void;
export @symbol("UpdateTexture") fn UpdateTexture(texture: Texture2D, pixels: const *opaque) void;

// Update GPU texture rectangle with new data
export @symbol("UpdateTextureRec") fn UpdateTextureRec(texture: Texture2D, rec: Rectangle, pixels: const *void) void;
export @symbol("UpdateTextureRec") fn UpdateTextureRec(texture: Texture2D, rec: Rectangle, pixels: const *opaque) void;

// Generate GPU mipmaps for a texture
export @symbol("GenTextureMipmaps") fn GenTextureMipmaps(texture: *Texture2D) void;


@@ 2530,10 2530,10 @@ export @symbol("ColorAlphaBlend") fn ColorAlphaBlend(dst: Color, src: Color, tin
export @symbol("GetColor") fn GetColor(hexValue: uint) Color;

// Get Color from a source pixel pointer of certain format
export @symbol("GetPixelColor") fn GetPixelColor(srcPtr: *void, format: int) Color;
export @symbol("GetPixelColor") fn GetPixelColor(srcPtr: *opaque, format: int) Color;

// Set color formatted into destination pixel pointer
export @symbol("SetPixelColor") fn SetPixelColor(dstPtr: *void, color: Color, format: int) void;
export @symbol("SetPixelColor") fn SetPixelColor(dstPtr: *opaque, color: Color, format: int) void;

// Get pixel data size in bytes for certain format
export @symbol("GetPixelDataSize") fn GetPixelDataSize(width: int, height: int, format: int) int;


@@ 2541,7 2541,7 @@ export @symbol("GetPixelDataSize") fn GetPixelDataSize(width: int, height: int, 
// Get the default Font
export @symbol("GetFontDefault") fn GetFontDefault() Font;

@symbol("LoadFont") fn _LoadFont(fileName: const *c::schar) Font;
@symbol("LoadFont") fn _LoadFont(fileName: const *c::char) Font;

// Load font from file into GPU memory (VRAM)
export fn LoadFont(fileName: const str) Font = {


@@ 2550,7 2550,7 @@ export fn LoadFont(fileName: const str) Font = {
	return _LoadFont(fileName_cstring);
};

@symbol("LoadFontEx") fn _LoadFontEx(fileName: const *c::schar, fontSize: int, fontChars: *int, glyphCount: int) Font;
@symbol("LoadFontEx") fn _LoadFontEx(fileName: const *c::char, fontSize: int, fontChars: *int, glyphCount: int) Font;

// Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set
export fn LoadFontEx(fileName: const str, fontSize: int, fontChars: *int, glyphCount: int) Font = {


@@ 2562,7 2562,7 @@ export fn LoadFontEx(fileName: const str, fontSize: int, fontChars: *int, glyphC
// Load font from Image (XNA style)
export @symbol("LoadFontFromImage") fn LoadFontFromImage(image: Image, key: Color, firstChar: int) Font;

@symbol("LoadFontFromMemory") fn _LoadFontFromMemory(fileType: const *c::schar, fileData: const *c::uchar, dataSize: int, fontSize: int, fontChars: *int, glyphCount: int) Font;
@symbol("LoadFontFromMemory") fn _LoadFontFromMemory(fileType: const *c::char, fileData: const *c::uchar, dataSize: int, fontSize: int, fontChars: *int, glyphCount: int) Font;

// Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
export fn LoadFontFromMemory(fileType: const str, fileData: const *c::uchar, dataSize: int, fontSize: int, fontChars: *int, glyphCount: int) Font = {


@@ 2586,7 2586,7 @@ export @symbol("UnloadFontData") fn UnloadFontData(chars: *GlyphInfo, glyphCount
// Unload font from GPU memory (VRAM)
export @symbol("UnloadFont") fn UnloadFont(font: Font) void;

@symbol("ExportFontAsCode") fn _ExportFontAsCode(font: Font, fileName: const *c::schar) bool;
@symbol("ExportFontAsCode") fn _ExportFontAsCode(font: Font, fileName: const *c::char) bool;

// Export font as code file, returns true on success
export fn ExportFontAsCode(font: Font, fileName: const str) bool = {


@@ 2598,7 2598,7 @@ export fn ExportFontAsCode(font: Font, fileName: const str) bool = {
// Draw current FPS
export @symbol("DrawFPS") fn DrawFPS(posX: int, posY: int) void;

@symbol("DrawText") fn _DrawText(text: const *c::schar, posX: int, posY: int, fontSize: int, color: Color) void;
@symbol("DrawText") fn _DrawText(text: const *c::char, posX: int, posY: int, fontSize: int, color: Color) void;

// Draw text (using default font)
export fn DrawText(text: const str, posX: int, posY: int, fontSize: int, color: Color) void = {


@@ 2607,7 2607,7 @@ export fn DrawText(text: const str, posX: int, posY: int, fontSize: int, color: 
	return _DrawText(text_cstring, posX, posY, fontSize, color);
};

@symbol("DrawTextEx") fn _DrawTextEx(font: Font, text: const *c::schar, position: Vector2, fontSize: f32, spacing: f32, tint: Color) void;
@symbol("DrawTextEx") fn _DrawTextEx(font: Font, text: const *c::char, position: Vector2, fontSize: f32, spacing: f32, tint: Color) void;

// Draw text using font and additional parameters
export fn DrawTextEx(font: Font, text: const str, position: Vector2, fontSize: f32, spacing: f32, tint: Color) void = {


@@ 2616,7 2616,7 @@ export fn DrawTextEx(font: Font, text: const str, position: Vector2, fontSize: f
	return _DrawTextEx(font, text_cstring, position, fontSize, spacing, tint);
};

@symbol("DrawTextPro") fn _DrawTextPro(font: Font, text: const *c::schar, position: Vector2, origin: Vector2, rotation: f32, fontSize: f32, spacing: f32, tint: Color) void;
@symbol("DrawTextPro") fn _DrawTextPro(font: Font, text: const *c::char, position: Vector2, origin: Vector2, rotation: f32, fontSize: f32, spacing: f32, tint: Color) void;

// Draw text using Font and pro parameters (rotation)
export fn DrawTextPro(font: Font, text: const str, position: Vector2, origin: Vector2, rotation: f32, fontSize: f32, spacing: f32, tint: Color) void = {


@@ 2631,7 2631,7 @@ export @symbol("DrawTextCodepoint") fn DrawTextCodepoint(font: Font, codepoint: 
// Draw multiple character (codepoint)
export @symbol("DrawTextCodepoints") fn DrawTextCodepoints(font: Font, codepoints: const *int, count: int, position: Vector2, fontSize: f32, spacing: f32, tint: Color) void;

@symbol("MeasureText") fn _MeasureText(text: const *c::schar, fontSize: int) int;
@symbol("MeasureText") fn _MeasureText(text: const *c::char, fontSize: int) int;

// Measure string width for default font
export fn MeasureText(text: const str, fontSize: int) int = {


@@ 2640,7 2640,7 @@ export fn MeasureText(text: const str, fontSize: int) int = {
	return _MeasureText(text_cstring, fontSize);
};

@symbol("MeasureTextEx") fn _MeasureTextEx(font: Font, text: const *c::schar, fontSize: f32, spacing: f32) Vector2;
@symbol("MeasureTextEx") fn _MeasureTextEx(font: Font, text: const *c::char, fontSize: f32, spacing: f32) Vector2;

// Measure string size for Font
export fn MeasureTextEx(font: Font, text: const str, fontSize: f32, spacing: f32) Vector2 = {


@@ 2658,14 2658,14 @@ export @symbol("GetGlyphInfo") fn GetGlyphInfo(font: Font, codepoint: int) Glyph
// Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found
export @symbol("GetGlyphAtlasRec") fn GetGlyphAtlasRec(font: Font, codepoint: int) Rectangle;

@symbol("LoadUTF8") fn _LoadUTF8(codepoints: const *int, length: int) *c::schar;
@symbol("LoadUTF8") fn _LoadUTF8(codepoints: const *int, length: int) *c::char;

// Load UTF-8 text encoded from codepoints array
export fn LoadUTF8(codepoints: const *int, length: int) str = {
	return c::tostr(_LoadUTF8(codepoints, length))!;
};

@symbol("UnloadUTF8") fn _UnloadUTF8(text: *c::schar) void;
@symbol("UnloadUTF8") fn _UnloadUTF8(text: *c::char) void;

// Unload UTF-8 text encoded from codepoints array
export fn UnloadUTF8(text: str) void = {


@@ 2674,7 2674,7 @@ export fn UnloadUTF8(text: str) void = {
	return _UnloadUTF8(text_cstring);
};

@symbol("LoadCodepoints") fn _LoadCodepoints(text: const *c::schar, count: *int) *int;
@symbol("LoadCodepoints") fn _LoadCodepoints(text: const *c::char, count: *int) *int;

// Load all codepoints from a UTF-8 text string, codepoints count returned by parameter
export fn LoadCodepoints(text: const str, count: *int) *int = {


@@ 2686,7 2686,7 @@ export fn LoadCodepoints(text: const str, count: *int) *int = {
// Unload codepoints data from memory
export @symbol("UnloadCodepoints") fn UnloadCodepoints(codepoints: *int) void;

@symbol("GetCodepointCount") fn _GetCodepointCount(text: const *c::schar) int;
@symbol("GetCodepointCount") fn _GetCodepointCount(text: const *c::char) int;

// Get total number of codepoints in a UTF-8 encoded string
export fn GetCodepointCount(text: const str) int = {


@@ 2695,7 2695,7 @@ export fn GetCodepointCount(text: const str) int = {
	return _GetCodepointCount(text_cstring);
};

@symbol("GetCodepoint") fn _GetCodepoint(text: const *c::schar, codepointSize: *int) int;
@symbol("GetCodepoint") fn _GetCodepoint(text: const *c::char, codepointSize: *int) int;

// Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
export fn GetCodepoint(text: const str, codepointSize: *int) int = {


@@ 2704,7 2704,7 @@ export fn GetCodepoint(text: const str, codepointSize: *int) int = {
	return _GetCodepoint(text_cstring, codepointSize);
};

@symbol("GetCodepointNext") fn _GetCodepointNext(text: const *c::schar, codepointSize: *int) int;
@symbol("GetCodepointNext") fn _GetCodepointNext(text: const *c::char, codepointSize: *int) int;

// Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
export fn GetCodepointNext(text: const str, codepointSize: *int) int = {


@@ 2713,7 2713,7 @@ export fn GetCodepointNext(text: const str, codepointSize: *int) int = {
	return _GetCodepointNext(text_cstring, codepointSize);
};

@symbol("GetCodepointPrevious") fn _GetCodepointPrevious(text: const *c::schar, codepointSize: *int) int;
@symbol("GetCodepointPrevious") fn _GetCodepointPrevious(text: const *c::char, codepointSize: *int) int;

// Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
export fn GetCodepointPrevious(text: const str, codepointSize: *int) int = {


@@ 2722,14 2722,14 @@ export fn GetCodepointPrevious(text: const str, codepointSize: *int) int = {
	return _GetCodepointPrevious(text_cstring, codepointSize);
};

@symbol("CodepointToUTF8") fn _CodepointToUTF8(codepoint: int, utf8Size: *int) const *c::schar;
@symbol("CodepointToUTF8") fn _CodepointToUTF8(codepoint: int, utf8Size: *int) const *c::char;

// Encode one codepoint into UTF-8 byte array (array length returned as parameter)
export fn CodepointToUTF8(codepoint: int, utf8Size: *int) const str = {
	return c::tostr(_CodepointToUTF8(codepoint, utf8Size))!;
};

@symbol("TextCopy") fn _TextCopy(dst: *c::schar, src: const *c::schar) int;
@symbol("TextCopy") fn _TextCopy(dst: *c::char, src: const *c::char) int;

// Copy one string to another, returns bytes copied
export fn TextCopy(dst: str, src: const str) int = {


@@ 2740,7 2740,7 @@ export fn TextCopy(dst: str, src: const str) int = {
	return _TextCopy(dst_cstring, src_cstring);
};

@symbol("TextIsEqual") fn _TextIsEqual(text1: const *c::schar, text2: const *c::schar) bool;
@symbol("TextIsEqual") fn _TextIsEqual(text1: const *c::char, text2: const *c::char) bool;

// Check if two text string are equal
export fn TextIsEqual(text1: const str, text2: const str) bool = {


@@ 2751,7 2751,7 @@ export fn TextIsEqual(text1: const str, text2: const str) bool = {
	return _TextIsEqual(text1_cstring, text2_cstring);
};

@symbol("TextLength") fn _TextLength(text: const *c::schar) uint;
@symbol("TextLength") fn _TextLength(text: const *c::char) uint;

// Get text length, checks for '\0' ending
export fn TextLength(text: const str) uint = {


@@ 2761,9 2761,9 @@ export fn TextLength(text: const str) uint = {
};

// Text formatting with variables (sprintf() style)
export @symbol("TextFormat") fn TextFormat(text: const *c::schar, ...) const *c::schar;
export @symbol("TextFormat") fn TextFormat(text: const *c::char, ...) const *c::char;

@symbol("TextSubtext") fn _TextSubtext(text: const *c::schar, position: int, length: int) const *c::schar;
@symbol("TextSubtext") fn _TextSubtext(text: const *c::char, position: int, length: int) const *c::char;

// Get a piece of a text string
export fn TextSubtext(text: const str, position: int, length: int) const str = {


@@ 2772,7 2772,7 @@ export fn TextSubtext(text: const str, position: int, length: int) const str = {
	return c::tostr(_TextSubtext(text_cstring, position, length))!;
};

@symbol("TextReplace") fn _TextReplace(text: *c::schar, replace: const *c::schar, by: const *c::schar) *c::schar;
@symbol("TextReplace") fn _TextReplace(text: *c::char, replace: const *c::char, by: const *c::char) *c::char;

// Replace text string (WARNING: memory must be freed!)
export fn TextReplace(text: str, replace: const str, by: const str) str = {


@@ 2785,7 2785,7 @@ export fn TextReplace(text: str, replace: const str, by: const str) str = {
	return c::tostr(_TextReplace(text_cstring, replace_cstring, by_cstring))!;
};

@symbol("TextInsert") fn _TextInsert(text: const *c::schar, _insert: const *c::schar, position: int) *c::schar;
@symbol("TextInsert") fn _TextInsert(text: const *c::char, _insert: const *c::char, position: int) *c::char;

// Insert text in a position (WARNING: memory must be freed!)
export fn TextInsert(text: const str, _insert: const str, position: int) str = {


@@ 2796,25 2796,25 @@ export fn TextInsert(text: const str, _insert: const str, position: int) str = {
	return c::tostr(_TextInsert(text_cstring, _insert_cstring, position))!;
};

@symbol("TextJoin") fn _TextJoin(textList: const **c::schar, count: int, delimiter: const *c::schar) const *c::schar;
@symbol("TextJoin") fn _TextJoin(textList: const **c::char, count: int, delimiter: const *c::char) const *c::char;

// Join text strings with delimiter
export fn TextJoin(textList: const **c::schar, count: int, delimiter: const str) const str = {
export fn TextJoin(textList: const **c::char, count: int, delimiter: const str) const str = {
	let delimiter_cstring: *c::char = c::fromstr(delimiter);
	defer free(delimiter_cstring);
	return c::tostr(_TextJoin(textList, count, delimiter_cstring))!;
};

@symbol("TextSplit") fn _TextSplit(text: const *c::schar, delimiter: c::schar, count: *int) const **c::schar;
@symbol("TextSplit") fn _TextSplit(text: const *c::char, delimiter: c::char, count: *int) const **c::char;

// Split text into multiple strings
export fn TextSplit(text: const str, delimiter: c::schar, count: *int) const **c::schar = {
export fn TextSplit(text: const str, delimiter: c::char, count: *int) const **c::char = {
	let text_cstring: *c::char = c::fromstr(text);
	defer free(text_cstring);
	return _TextSplit(text_cstring, delimiter, count);
};

@symbol("TextAppend") fn _TextAppend(text: *c::schar, _append: const *c::schar, position: *int) void;
@symbol("TextAppend") fn _TextAppend(text: *c::char, _append: const *c::char, position: *int) void;

// Append text at specific position and move cursor!
export fn TextAppend(text: str, _append: const str, position: *int) void = {


@@ 2825,7 2825,7 @@ export fn TextAppend(text: str, _append: const str, position: *int) void = {
	return _TextAppend(text_cstring, _append_cstring, position);
};

@symbol("TextFindIndex") fn _TextFindIndex(text: const *c::schar, find: const *c::schar) int;
@symbol("TextFindIndex") fn _TextFindIndex(text: const *c::char, find: const *c::char) int;

// Find first text occurrence within a string
export fn TextFindIndex(text: const str, find: const str) int = {


@@ 2836,7 2836,7 @@ export fn TextFindIndex(text: const str, find: const str) int = {
	return _TextFindIndex(text_cstring, find_cstring);
};

@symbol("TextToUpper") fn _TextToUpper(text: const *c::schar) const *c::schar;
@symbol("TextToUpper") fn _TextToUpper(text: const *c::char) const *c::char;

// Get upper case version of provided string
export fn TextToUpper(text: const str) const str = {


@@ 2845,7 2845,7 @@ export fn TextToUpper(text: const str) const str = {
	return c::tostr(_TextToUpper(text_cstring))!;
};

@symbol("TextToLower") fn _TextToLower(text: const *c::schar) const *c::schar;
@symbol("TextToLower") fn _TextToLower(text: const *c::char) const *c::char;

// Get lower case version of provided string
export fn TextToLower(text: const str) const str = {


@@ 2854,7 2854,7 @@ export fn TextToLower(text: const str) const str = {
	return c::tostr(_TextToLower(text_cstring))!;
};

@symbol("TextToPascal") fn _TextToPascal(text: const *c::schar) const *c::schar;
@symbol("TextToPascal") fn _TextToPascal(text: const *c::char) const *c::char;

// Get Pascal case notation version of provided string
export fn TextToPascal(text: const str) const str = {


@@ 2863,7 2863,7 @@ export fn TextToPascal(text: const str) const str = {
	return c::tostr(_TextToPascal(text_cstring))!;
};

@symbol("TextToInteger") fn _TextToInteger(text: const *c::schar) int;
@symbol("TextToInteger") fn _TextToInteger(text: const *c::char) int;

// Get integer value from text (negative values not supported)
export fn TextToInteger(text: const str) int = {


@@ 2935,7 2935,7 @@ export @symbol("DrawRay") fn DrawRay(ray: Ray, color: Color) void;
// Draw a grid (centered at (0, 0, 0))
export @symbol("DrawGrid") fn DrawGrid(slices: int, spacing: f32) void;

@symbol("LoadModel") fn _LoadModel(fileName: const *c::schar) Model;
@symbol("LoadModel") fn _LoadModel(fileName: const *c::char) Model;

// Load model from files (meshes and materials)
export fn LoadModel(fileName: const str) Model = {


@@ 2984,7 2984,7 @@ export @symbol("DrawBillboardPro") fn DrawBillboardPro(camera: Camera, texture: 
export @symbol("UploadMesh") fn UploadMesh(mesh: *Mesh, dynamic: bool) void;

// Update mesh vertex data in GPU for a specific buffer index
export @symbol("UpdateMeshBuffer") fn UpdateMeshBuffer(mesh: Mesh, index: int, data: const *void, dataSize: int, _offset: int) void;
export @symbol("UpdateMeshBuffer") fn UpdateMeshBuffer(mesh: Mesh, index: int, data: const *opaque, dataSize: int, _offset: int) void;

// Unload mesh data from CPU and GPU
export @symbol("UnloadMesh") fn UnloadMesh(mesh: Mesh) void;


@@ 2995,7 2995,7 @@ export @symbol("DrawMesh") fn DrawMesh(mesh: Mesh, material: Material, transform
// Draw multiple mesh instances with material and different transforms
export @symbol("DrawMeshInstanced") fn DrawMeshInstanced(mesh: Mesh, material: Material, transforms: const *Matrix, instances: int) void;

@symbol("ExportMesh") fn _ExportMesh(mesh: Mesh, fileName: const *c::schar) bool;
@symbol("ExportMesh") fn _ExportMesh(mesh: Mesh, fileName: const *c::char) bool;

// Export mesh data to file, returns true on success
export fn ExportMesh(mesh: Mesh, fileName: const str) bool = {


@@ 3043,7 3043,7 @@ export @symbol("GenMeshHeightmap") fn GenMeshHeightmap(heightmap: Image, _size: 
// Generate cubes-based map mesh from image data
export @symbol("GenMeshCubicmap") fn GenMeshCubicmap(cubicmap: Image, cubeSize: Vector3) Mesh;

@symbol("LoadMaterials") fn _LoadMaterials(fileName: const *c::schar, materialCount: *int) *Material;
@symbol("LoadMaterials") fn _LoadMaterials(fileName: const *c::char, materialCount: *int) *Material;

// Load materials from model file
export fn LoadMaterials(fileName: const str, materialCount: *int) *Material = {


@@ 3067,7 3067,7 @@ export @symbol("SetMaterialTexture") fn SetMaterialTexture(material: *Material, 
// Set material for a mesh
export @symbol("SetModelMeshMaterial") fn SetModelMeshMaterial(model: *Model, meshId: int, materialId: int) void;

@symbol("LoadModelAnimations") fn _LoadModelAnimations(fileName: const *c::schar, animCount: *uint) *ModelAnimation;
@symbol("LoadModelAnimations") fn _LoadModelAnimations(fileName: const *c::char, animCount: *uint) *ModelAnimation;

// Load model animations from file
export fn LoadModelAnimations(fileName: const str, animCount: *uint) *ModelAnimation = {


@@ 3124,7 3124,7 @@ export @symbol("IsAudioDeviceReady") fn IsAudioDeviceReady() bool;
// Set master volume (listener)
export @symbol("SetMasterVolume") fn SetMasterVolume(volume: f32) void;

@symbol("LoadWave") fn _LoadWave(fileName: const *c::schar) Wave;
@symbol("LoadWave") fn _LoadWave(fileName: const *c::char) Wave;

// Load wave data from file
export fn LoadWave(fileName: const str) Wave = {


@@ 3133,7 3133,7 @@ export fn LoadWave(fileName: const str) Wave = {
	return _LoadWave(fileName_cstring);
};

@symbol("LoadWaveFromMemory") fn _LoadWaveFromMemory(fileType: const *c::schar, fileData: const *c::uchar, dataSize: int) Wave;
@symbol("LoadWaveFromMemory") fn _LoadWaveFromMemory(fileType: const *c::char, fileData: const *c::uchar, dataSize: int) Wave;

// Load wave from memory buffer, fileType refers to extension: i.e. '.wav'
export fn LoadWaveFromMemory(fileType: const str, fileData: const *c::uchar, dataSize: int) Wave = {


@@ 3145,7 3145,7 @@ export fn LoadWaveFromMemory(fileType: const str, fileData: const *c::uchar, dat
// Checks if wave data is ready
export @symbol("IsWaveReady") fn IsWaveReady(wave: Wave) bool;

@symbol("LoadSound") fn _LoadSound(fileName: const *c::schar) Sound;
@symbol("LoadSound") fn _LoadSound(fileName: const *c::char) Sound;

// Load sound from file
export fn LoadSound(fileName: const str) Sound = {


@@ 3161,7 3161,7 @@ export @symbol("LoadSoundFromWave") fn LoadSoundFromWave(wave: Wave) Sound;
export @symbol("IsSoundReady") fn IsSoundReady(sound: Sound) bool;

// Update sound buffer with new data
export @symbol("UpdateSound") fn UpdateSound(sound: Sound, data: const *void, sampleCount: int) void;
export @symbol("UpdateSound") fn UpdateSound(sound: Sound, data: const *opaque, sampleCount: int) void;

// Unload wave data
export @symbol("UnloadWave") fn UnloadWave(wave: Wave) void;


@@ 3169,7 3169,7 @@ export @symbol("UnloadWave") fn UnloadWave(wave: Wave) void;
// Unload sound
export @symbol("UnloadSound") fn UnloadSound(sound: Sound) void;

@symbol("ExportWave") fn _ExportWave(wave: Wave, fileName: const *c::schar) bool;
@symbol("ExportWave") fn _ExportWave(wave: Wave, fileName: const *c::char) bool;

// Export wave data to file, returns true on success
export fn ExportWave(wave: Wave, fileName: const str) bool = {


@@ 3178,7 3178,7 @@ export fn ExportWave(wave: Wave, fileName: const str) bool = {
	return _ExportWave(wave, fileName_cstring);
};

@symbol("ExportWaveAsCode") fn _ExportWaveAsCode(wave: Wave, fileName: const *c::schar) bool;
@symbol("ExportWaveAsCode") fn _ExportWaveAsCode(wave: Wave, fileName: const *c::char) bool;

// Export wave sample data to code (.h), returns true on success
export fn ExportWaveAsCode(wave: Wave, fileName: const str) bool = {


@@ 3226,7 3226,7 @@ export @symbol("LoadWaveSamples") fn LoadWaveSamples(wave: Wave) *f32;
// Unload samples data loaded with LoadWaveSamples()
export @symbol("UnloadWaveSamples") fn UnloadWaveSamples(samples: *f32) void;

@symbol("LoadMusicStream") fn _LoadMusicStream(fileName: const *c::schar) Music;
@symbol("LoadMusicStream") fn _LoadMusicStream(fileName: const *c::char) Music;

// Load music stream from file
export fn LoadMusicStream(fileName: const str) Music = {


@@ 3235,7 3235,7 @@ export fn LoadMusicStream(fileName: const str) Music = {
	return _LoadMusicStream(fileName_cstring);
};

@symbol("LoadMusicStreamFromMemory") fn _LoadMusicStreamFromMemory(fileType: const *c::schar, data: const *c::uchar, dataSize: int) Music;
@symbol("LoadMusicStreamFromMemory") fn _LoadMusicStreamFromMemory(fileType: const *c::char, data: const *c::uchar, dataSize: int) Music;

// Load music stream from data
export fn LoadMusicStreamFromMemory(fileType: const str, data: const *c::uchar, dataSize: int) Music = {


@@ 3296,7 3296,7 @@ export @symbol("IsAudioStreamReady") fn IsAudioStreamReady(stream: AudioStream) 
export @symbol("UnloadAudioStream") fn UnloadAudioStream(stream: AudioStream) void;

// Update audio stream buffers with data
export @symbol("UpdateAudioStream") fn UpdateAudioStream(stream: AudioStream, data: const *void, frameCount: int) void;
export @symbol("UpdateAudioStream") fn UpdateAudioStream(stream: AudioStream, data: const *opaque, frameCount: int) void;

// Check if any audio stream buffers requires refill
export @symbol("IsAudioStreamProcessed") fn IsAudioStreamProcessed(stream: AudioStream) bool;