Merge branch 'master' into GPU_SKIN_ON_BY_DEFAULT

This commit is contained in:
Jeff Myers 2026-07-25 11:05:57 -07:00
commit 7905bc1234
8 changed files with 30760 additions and 9200 deletions

View file

@ -680,7 +680,7 @@ int main(int argc, char *argv[])
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", GetFileNameWithoutExt(inFileName));
#endif
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName));
// Update generated .html metadata
LOG("INFO: [%s] Updating HTML Metadata...\n", TextFormat("%s.html", exName));
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
@ -1886,9 +1886,11 @@ int main(int argc, char *argv[])
printf(" test <example_name> : Build and Test example for Desktop and Web platforms\n");
printf(" validate : Validate examples collection, generates report\n");
printf(" update : Validate and update examples collection, generates report\n\n");
printf("OPTIONS:\n\n");
printf(" -h, --help : Show tool version and command line usage help\n");
printf(" -v, --verbose : Verbose mode, show additional logs on processes\n");
printf("\nEXAMPLES:\n\n");
printf(" > rexm add shapes_custom_stars\n");
printf(" Add and updates new example provided <shapes_custom_stars>\n\n");
@ -2329,7 +2331,7 @@ static rlExampleInfo *LoadExampleInfo(const char *exFileName)
// Example found in collection
exInfo = (rlExampleInfo *)RL_CALLOC(1, sizeof(rlExampleInfo));
strncpy(exInfo->name, GetFileNameWithoutExt(exFileName), 128 - 1);
snprintf(exInfo->name, 128, "%s", GetFileNameWithoutExt(exFileName));
strncpy(exInfo->category, exInfo->name, TextFindIndex(exInfo->name, "_"));
char *exText = LoadFileText(exFileName);
@ -2375,7 +2377,7 @@ static rlExampleInfo *LoadExampleInfo(const char *exFileName)
int copyrightIndex = TextFindIndex(exText, "Copyright (c) ");
int yearStartIndex = copyrightIndex + 14;
char yearText[5] = { 0 };
strncpy(yearText, exText + yearStartIndex, 4);
snprintf(yearText, 5, "%s", exText + yearStartIndex);
exInfo->yearCreated = TextToInteger(yearText);
// Check for review year included (or just use creation year)
if (exText[yearStartIndex + 4] == '-') strncpy(yearText, exText + yearStartIndex + 5, 4);
@ -2423,7 +2425,7 @@ static int ParseExampleInfoLine(const char *line, rlExampleInfo *entry)
#define MAX_EXAMPLE_INFO_LINE_LEN 512
char temp[MAX_EXAMPLE_INFO_LINE_LEN] = { 0 };
strncpy(temp, line, MAX_EXAMPLE_INFO_LINE_LEN);
snprintf(temp, MAX_EXAMPLE_INFO_LINE_LEN, "%s", line);
temp[MAX_EXAMPLE_INFO_LINE_LEN - 1] = '\0'; // Ensure null termination
int tokenCount = 0;
@ -2900,7 +2902,7 @@ static void UpdateWebMetadata(const char *exHtmlPath, const char *exFilePath)
char exTitle[64] = { 0 }; // Example title: fileName without extension, replacing underscores by spaces
// Get example name: replace underscore by spaces
strncpy(exName, GetFileNameWithoutExt(exHtmlPathCopy), 64 - 1);
snprintf(exName, 64, "%s", GetFileNameWithoutExt(exHtmlPathCopy));
strcpy(exTitle, exName);
for (int i = 0; (i < 64) && (exTitle[i] != '\0'); i++) { if (exTitle[i] == '_') exTitle[i] = ' '; }

View file

@ -79,6 +79,7 @@ raylib_api: ../../src/raylib.h rlparser
FORMAT=JSON EXTENSION=json $(MAKE) raylib_api.json
FORMAT=XML EXTENSION=xml $(MAKE) raylib_api.xml
FORMAT=LUA EXTENSION=lua $(MAKE) raylib_api.lua
FORMAT=SEXPR EXTENSION=sexpr $(MAKE) raylib_api.sexpr
# rlparser execution: [raylib.h] parse, generating some output files
raylib_api.$(EXTENSION): ../../src/raylib.h rlparser
@ -112,7 +113,8 @@ all: rlparser
FORMAT=JSON EXTENSION=json $(MAKE) parse
FORMAT=XML EXTENSION=xml $(MAKE) parse
FORMAT=LUA EXTENSION=lua $(MAKE) parse
FORMAT=SEXPR EXTENSION=sexpr $(MAKE) parse
# Clean rlparser and generated output files
clean:
rm -f rlparser *.json *.txt *.xml *.lua
rm -f rlparser *.json *.txt *.xml *.lua *.sexpr

View file

@ -968,7 +968,7 @@
"description": "Skeleton, animation bones hierarchy",
"fields": [
{
"type": "int",
"type": "unsigned int",
"name": "boneCount",
"description": "Number of bones"
},
@ -1045,7 +1045,7 @@
"description": "Animation name"
},
{
"type": "int",
"type": "unsigned int",
"name": "boneCount",
"description": "Number of bones (per pose)"
},
@ -4603,7 +4603,7 @@
},
{
"name": "GetDirectoryPath",
"description": "Get full path for a given fileName with path (uses static string)",
"description": "Get full path for a provided fileName with path (uses static string)",
"returnType": "const char *",
"params": [
{
@ -4614,7 +4614,7 @@
},
{
"name": "GetPrevDirectoryPath",
"description": "Get previous directory path for a given path (uses static string)",
"description": "Get previous directory path for a provided path (uses static string)",
"returnType": "const char *",
"params": [
{
@ -4657,7 +4657,29 @@
},
{
"name": "IsPathFile",
"description": "Check if given path is a file or a directory",
"description": "Check if provided path points to a file",
"returnType": "bool",
"params": [
{
"type": "const char *",
"name": "path"
}
]
},
{
"name": "IsPathDirectory",
"description": "Check if provided path points to a directory",
"returnType": "bool",
"params": [
{
"type": "const char *",
"name": "path"
}
]
},
{
"name": "IsPathAbsolute",
"description": "Check if provided path is an absolute path",
"returnType": "bool",
"params": [
{
@ -5368,7 +5390,7 @@
},
{
"name": "GetTouchPointId",
"description": "Get touch point identifier for given index",
"description": "Get touch point identifier for provided index",
"returnType": "int",
"params": [
{
@ -8088,7 +8110,7 @@
},
{
"name": "ImageClearBackground",
"description": "Clear image background with given color",
"description": "Clear image background with provided color",
"returnType": "void",
"params": [
{
@ -8455,6 +8477,33 @@
}
]
},
{
"name": "ImageDrawRectanglePro",
"description": "Draw a color-filled rectangle with pro parameters within and image",
"returnType": "void",
"params": [
{
"type": "Image *",
"name": "dst"
},
{
"type": "Rectangle",
"name": "rec"
},
{
"type": "Vector2",
"name": "origin"
},
{
"type": "float",
"name": "rotation"
},
{
"type": "Color",
"name": "color"
}
]
},
{
"name": "ImageDrawRectangleLines",
"description": "Draw rectangle lines within an image",
@ -8509,6 +8558,37 @@
}
]
},
{
"name": "ImageDrawRectangleGradientEx",
"description": "Draw rectangle with gradient colors within an image, counter-clockwise color order",
"returnType": "void",
"params": [
{
"type": "Image *",
"name": "dst"
},
{
"type": "Rectangle",
"name": "rec"
},
{
"type": "Color",
"name": "col1"
},
{
"type": "Color",
"name": "col2"
},
{
"type": "Color",
"name": "col3"
},
{
"type": "Color",
"name": "col4"
}
]
},
{
"name": "ImageDrawCircle",
"description": "Draw a filled circle within an image",
@ -8663,6 +8743,37 @@
}
]
},
{
"name": "ImageDrawImageEx",
"description": "Draw an image with scaling and rotation within an image",
"returnType": "void",
"params": [
{
"type": "Image *",
"name": "dst"
},
{
"type": "Image",
"name": "src"
},
{
"type": "Vector2",
"name": "position"
},
{
"type": "float",
"name": "rotation"
},
{
"type": "float",
"name": "scale"
},
{
"type": "Color",
"name": "tint"
}
]
},
{
"name": "ImageDrawImageRec",
"description": "Draw a part of an image defined by a rectangle within an image",
@ -8791,6 +8902,49 @@
}
]
},
{
"name": "ImageDrawTextPro",
"description": "Draw text using Font and pro parameters (rotation)",
"returnType": "void",
"params": [
{
"type": "Image *",
"name": "dst"
},
{
"type": "Font",
"name": "font"
},
{
"type": "const char *",
"name": "text"
},
{
"type": "Vector2",
"name": "position"
},
{
"type": "Vector2",
"name": "origin"
},
{
"type": "float",
"name": "rotation"
},
{
"type": "float",
"name": "fontSize"
},
{
"type": "float",
"name": "spacing"
},
{
"type": "Color",
"name": "tint"
}
]
},
{
"name": "LoadTexture",
"description": "Load texture from file into GPU memory (VRAM)",

View file

@ -968,7 +968,7 @@ return {
description = "Skeleton, animation bones hierarchy",
fields = {
{
type = "int",
type = "unsigned int",
name = "boneCount",
description = "Number of bones"
},
@ -1045,7 +1045,7 @@ return {
description = "Animation name"
},
{
type = "int",
type = "unsigned int",
name = "boneCount",
description = "Number of bones (per pose)"
},
@ -4135,7 +4135,7 @@ return {
},
{
name = "GetDirectoryPath",
description = "Get full path for a given fileName with path (uses static string)",
description = "Get full path for a provided fileName with path (uses static string)",
returnType = "const char *",
params = {
{type = "const char *", name = "filePath"}
@ -4143,7 +4143,7 @@ return {
},
{
name = "GetPrevDirectoryPath",
description = "Get previous directory path for a given path (uses static string)",
description = "Get previous directory path for a provided path (uses static string)",
returnType = "const char *",
params = {
{type = "const char *", name = "dirPath"}
@ -4177,7 +4177,23 @@ return {
},
{
name = "IsPathFile",
description = "Check if given path is a file or a directory",
description = "Check if provided path points to a file",
returnType = "bool",
params = {
{type = "const char *", name = "path"}
}
},
{
name = "IsPathDirectory",
description = "Check if provided path points to a directory",
returnType = "bool",
params = {
{type = "const char *", name = "path"}
}
},
{
name = "IsPathAbsolute",
description = "Check if provided path is an absolute path",
returnType = "bool",
params = {
{type = "const char *", name = "path"}
@ -4663,7 +4679,7 @@ return {
},
{
name = "GetTouchPointId",
description = "Get touch point identifier for given index",
description = "Get touch point identifier for provided index",
returnType = "int",
params = {
{type = "int", name = "index"}
@ -6063,7 +6079,7 @@ return {
},
{
name = "ImageClearBackground",
description = "Clear image background with given color",
description = "Clear image background with provided color",
returnType = "void",
params = {
{type = "Image *", name = "dst"},
@ -6232,6 +6248,18 @@ return {
{type = "Color", name = "color"}
}
},
{
name = "ImageDrawRectanglePro",
description = "Draw a color-filled rectangle with pro parameters within and image",
returnType = "void",
params = {
{type = "Image *", name = "dst"},
{type = "Rectangle", name = "rec"},
{type = "Vector2", name = "origin"},
{type = "float", name = "rotation"},
{type = "Color", name = "color"}
}
},
{
name = "ImageDrawRectangleLines",
description = "Draw rectangle lines within an image",
@ -6256,6 +6284,19 @@ return {
{type = "Color", name = "color"}
}
},
{
name = "ImageDrawRectangleGradientEx",
description = "Draw rectangle with gradient colors within an image, counter-clockwise color order",
returnType = "void",
params = {
{type = "Image *", name = "dst"},
{type = "Rectangle", name = "rec"},
{type = "Color", name = "col1"},
{type = "Color", name = "col2"},
{type = "Color", name = "col3"},
{type = "Color", name = "col4"}
}
},
{
name = "ImageDrawCircle",
description = "Draw a filled circle within an image",
@ -6326,6 +6367,19 @@ return {
{type = "Color", name = "tint"}
}
},
{
name = "ImageDrawImageEx",
description = "Draw an image with scaling and rotation within an image",
returnType = "void",
params = {
{type = "Image *", name = "dst"},
{type = "Image", name = "src"},
{type = "Vector2", name = "position"},
{type = "float", name = "rotation"},
{type = "float", name = "scale"},
{type = "Color", name = "tint"}
}
},
{
name = "ImageDrawImageRec",
description = "Draw a part of an image defined by a rectangle within an image",
@ -6379,6 +6433,22 @@ return {
{type = "Color", name = "tint"}
}
},
{
name = "ImageDrawTextPro",
description = "Draw text using Font and pro parameters (rotation)",
returnType = "void",
params = {
{type = "Image *", name = "dst"},
{type = "Font", name = "font"},
{type = "const char *", name = "text"},
{type = "Vector2", name = "position"},
{type = "Vector2", name = "origin"},
{type = "float", name = "rotation"},
{type = "float", name = "fontSize"},
{type = "float", name = "spacing"},
{type = "Color", name = "tint"}
}
},
{
name = "LoadTexture",
description = "Load texture from file into GPU memory (VRAM)",

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -201,7 +201,7 @@
<Field type="int" name="parent" desc="Bone parent" />
</Struct>
<Struct name="ModelSkeleton" fieldCount="3" desc="Skeleton, animation bones hierarchy">
<Field type="int" name="boneCount" desc="Number of bones" />
<Field type="unsigned int" name="boneCount" desc="Number of bones" />
<Field type="BoneInfo *" name="bones" desc="Bones information (skeleton)" />
<Field type="ModelAnimPose" name="bindPose" desc="Bones base transformation (Transform[])" />
</Struct>
@ -218,7 +218,7 @@
</Struct>
<Struct name="ModelAnimation" fieldCount="4" desc="ModelAnimation, contains a full animation sequence">
<Field type="char[32]" name="name" desc="Animation name" />
<Field type="int" name="boneCount" desc="Number of bones (per pose)" />
<Field type="unsigned int" name="boneCount" desc="Number of bones (per pose)" />
<Field type="int" name="keyframeCount" desc="Number of animation key frames" />
<Field type="ModelAnimPose *" name="keyframePoses" desc="Animation sequence keyframe poses [keyframe][pose]" />
</Struct>
@ -681,7 +681,7 @@
<Param type="unsigned int" name="frames" desc="" />
</Callback>
</Callbacks>
<Functions count="609">
<Functions count="613">
<Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context">
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
@ -1099,10 +1099,10 @@
<Function name="GetFileNameWithoutExt" retType="const char *" paramCount="1" desc="Get filename string without extension (uses static string)">
<Param type="const char *" name="filePath" desc="" />
</Function>
<Function name="GetDirectoryPath" retType="const char *" paramCount="1" desc="Get full path for a given fileName with path (uses static string)">
<Function name="GetDirectoryPath" retType="const char *" paramCount="1" desc="Get full path for a provided fileName with path (uses static string)">
<Param type="const char *" name="filePath" desc="" />
</Function>
<Function name="GetPrevDirectoryPath" retType="const char *" paramCount="1" desc="Get previous directory path for a given path (uses static string)">
<Function name="GetPrevDirectoryPath" retType="const char *" paramCount="1" desc="Get previous directory path for a provided path (uses static string)">
<Param type="const char *" name="dirPath" desc="" />
</Function>
<Function name="GetWorkingDirectory" retType="const char *" paramCount="0" desc="Get current working directory (uses static string)">
@ -1115,7 +1115,13 @@
<Function name="ChangeDirectory" retType="int" paramCount="1" desc="Change working directory, returns 0 on success">
<Param type="const char *" name="dirPath" desc="" />
</Function>
<Function name="IsPathFile" retType="bool" paramCount="1" desc="Check if given path is a file or a directory">
<Function name="IsPathFile" retType="bool" paramCount="1" desc="Check if provided path points to a file">
<Param type="const char *" name="path" desc="" />
</Function>
<Function name="IsPathDirectory" retType="bool" paramCount="1" desc="Check if provided path points to a directory">
<Param type="const char *" name="path" desc="" />
</Function>
<Function name="IsPathAbsolute" retType="bool" paramCount="1" desc="Check if provided path is an absolute path">
<Param type="const char *" name="path" desc="" />
</Function>
<Function name="IsFileNameValid" retType="bool" paramCount="1" desc="Check if fileName is valid for the platform/OS">
@ -1316,7 +1322,7 @@
<Function name="GetTouchPosition" retType="Vector2" paramCount="1" desc="Get touch position XY for a touch point index (relative to screen size)">
<Param type="int" name="index" desc="" />
</Function>
<Function name="GetTouchPointId" retType="int" paramCount="1" desc="Get touch point identifier for given index">
<Function name="GetTouchPointId" retType="int" paramCount="1" desc="Get touch point identifier for provided index">
<Param type="int" name="index" desc="" />
</Function>
<Function name="GetTouchPointCount" retType="int" paramCount="0" desc="Get number of touch points">
@ -2036,7 +2042,7 @@
<Param type="int" name="x" desc="" />
<Param type="int" name="y" desc="" />
</Function>
<Function name="ImageClearBackground" retType="void" paramCount="2" desc="Clear image background with given color">
<Function name="ImageClearBackground" retType="void" paramCount="2" desc="Clear image background with provided color">
<Param type="Image *" name="dst" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
@ -2132,6 +2138,13 @@
<Param type="Rectangle" name="rec" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="ImageDrawRectanglePro" retType="void" paramCount="5" desc="Draw a color-filled rectangle with pro parameters within and image">
<Param type="Image *" name="dst" desc="" />
<Param type="Rectangle" name="rec" desc="" />
<Param type="Vector2" name="origin" desc="" />
<Param type="float" name="rotation" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="ImageDrawRectangleLines" retType="void" paramCount="6" desc="Draw rectangle lines within an image">
<Param type="Image *" name="dst" desc="" />
<Param type="int" name="posX" desc="" />
@ -2146,6 +2159,14 @@
<Param type="int" name="thick" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="ImageDrawRectangleGradientEx" retType="void" paramCount="6" desc="Draw rectangle with gradient colors within an image, counter-clockwise color order">
<Param type="Image *" name="dst" desc="" />
<Param type="Rectangle" name="rec" desc="" />
<Param type="Color" name="col1" desc="" />
<Param type="Color" name="col2" desc="" />
<Param type="Color" name="col3" desc="" />
<Param type="Color" name="col4" desc="" />
</Function>
<Function name="ImageDrawCircle" retType="void" paramCount="5" desc="Draw a filled circle within an image">
<Param type="Image *" name="dst" desc="" />
<Param type="int" name="centerX" desc="" />
@ -2186,6 +2207,14 @@
<Param type="int" name="posY" desc="" />
<Param type="Color" name="tint" desc="" />
</Function>
<Function name="ImageDrawImageEx" retType="void" paramCount="6" desc="Draw an image with scaling and rotation within an image">
<Param type="Image *" name="dst" desc="" />
<Param type="Image" name="src" desc="" />
<Param type="Vector2" name="position" desc="" />
<Param type="float" name="rotation" desc="" />
<Param type="float" name="scale" desc="" />
<Param type="Color" name="tint" desc="" />
</Function>
<Function name="ImageDrawImageRec" retType="void" paramCount="5" desc="Draw a part of an image defined by a rectangle within an image">
<Param type="Image *" name="dst" desc="" />
<Param type="Image" name="src" desc="" />
@ -2219,6 +2248,17 @@
<Param type="float" name="spacing" desc="" />
<Param type="Color" name="tint" desc="" />
</Function>
<Function name="ImageDrawTextPro" retType="void" paramCount="9" desc="Draw text using Font and pro parameters (rotation)">
<Param type="Image *" name="dst" desc="" />
<Param type="Font" name="font" desc="" />
<Param type="const char *" name="text" desc="" />
<Param type="Vector2" name="position" desc="" />
<Param type="Vector2" name="origin" desc="" />
<Param type="float" name="rotation" desc="" />
<Param type="float" name="fontSize" desc="" />
<Param type="float" name="spacing" desc="" />
<Param type="Color" name="tint" desc="" />
</Function>
<Function name="LoadTexture" retType="Texture2D" paramCount="1" desc="Load texture from file into GPU memory (VRAM)">
<Param type="const char *" name="fileName" desc="" />
</Function>
@ -2983,19 +3023,6 @@
<Param type="float" name="frameB" desc="" />
<Param type="float" name="blend" desc="" />
</Function>
<Function name="UpdateModelAnimationBones" retType="void" paramCount="3" desc="Update model animation pose (bones only)">
<Param type="Model" name="model" desc="" />
<Param type="ModelAnimation" name="anim" desc="" />
<Param type="float" name="frame" desc="" />
</Function>
<Function name="UpdateModelAnimationBonesEx" retType="void" paramCount="6" desc="Update model animation bones to pose, blending two animations">
<Param type="Model" name="model" desc="" />
<Param type="ModelAnimation" name="animA" desc="" />
<Param type="float" name="frameA" desc="" />
<Param type="ModelAnimation" name="animB" desc="" />
<Param type="float" name="frameB" desc="" />
<Param type="float" name="blend" desc="" />
</Function>
<Function name="UnloadModelAnimations" retType="void" paramCount="2" desc="Unload animation array data">
<Param type="ModelAnimation *" name="animations" desc="" />
<Param type="int" name="animCount" desc="" />

View file

@ -146,7 +146,7 @@ typedef struct FunctionInfo {
} FunctionInfo;
// Output format for parsed data
typedef enum { DEFAULT = 0, JSON, XML, LUA, CODE } OutputFormat;
typedef enum { DEFAULT = 0, JSON, XML, LUA, SEXPR, CODE } OutputFormat;
//----------------------------------------------------------------------------------
// Global Variables Definition
@ -1062,6 +1062,7 @@ int main(int argc, char *argv[])
else if (outputFormat == JSON) printf("\nOutput format: JSON\n\n");
else if (outputFormat == XML) printf("\nOutput format: XML\n\n");
else if (outputFormat == LUA) printf("\nOutput format: LUA\n\n");
else if (outputFormat == SEXPR) printf("\nOutput format: SEXPR\n\n");
else if (outputFormat == CODE) printf("\nOutput format: CODE\n\n");
ExportParsedData(outFileName, outputFormat);
@ -1098,10 +1099,10 @@ static void ShowCommandLineInfo(void)
printf(" -i, --input <filename.h> : Define input header file to parse.\n");
printf(" NOTE: If not specified, defaults to: raylib.h\n\n");
printf(" -o, --output <filename.ext> : Define output file and format.\n");
printf(" Supported extensions: .txt, .json, .xml, .lua, .h\n");
printf(" Supported extensions: .txt, .json, .xml, .lua, .sexpr, .h\n");
printf(" NOTE: If not specified, defaults to: raylib_api.txt\n\n");
printf(" -f, --format <type> : Define output format for parser data.\n");
printf(" Supported types: DEFAULT, JSON, XML, LUA, CODE\n\n");
printf(" Supported types: DEFAULT, JSON, XML, LUA, SEXPR, CODE\n\n");
printf(" -d, --define <DEF> : Define functions specifiers (i.e. RLAPI for raylib.h, RMAPI for raymath.h, etc.)\n");
printf(" NOTE: If no specifier defined, defaults to: RLAPI\n\n");
printf(" -t, --truncate <after> : Define string to truncate input after (i.e. \"RLGL IMPLEMENTATION\" for rlgl.h)\n");
@ -1154,6 +1155,7 @@ static void ProcessCommandLine(int argc, char *argv[])
else if (IsTextEqual(argv[i + 1], "JSON\0", 5)) outputFormat = JSON;
else if (IsTextEqual(argv[i + 1], "XML\0", 4)) outputFormat = XML;
else if (IsTextEqual(argv[i + 1], "LUA\0", 4)) outputFormat = LUA;
else if (IsTextEqual(argv[i + 1], "SEXPR\0", 4)) outputFormat = SEXPR;
else if (IsTextEqual(argv[i + 1], "CODE\0", 5)) outputFormat = CODE;
}
else printf("WARNING: No format parameters provided\n");
@ -2007,6 +2009,131 @@ static void ExportParsedData(const char *fileName, int format)
fprintf(outFile, " }\n");
fprintf(outFile, "}\n");
} break;
case SEXPR:
{
fprintf(outFile, "(");
// Print defines info
fprintf(outFile, "(defines\n");
for (int i = 0; i < defineCount; i++)
{
if(i != 0) fprintf(outFile, "\n");
fprintf(outFile, " ((name \"%s\")\n", defines[i].name);
fprintf(outFile, " (type \"%s\")\n", StrDefineType(defines[i].type));
if ((defines[i].type == INT) ||
(defines[i].type == LONG) ||
(defines[i].type == FLOAT) ||
(defines[i].type == DOUBLE) ||
(defines[i].type == STRING))
{
fprintf(outFile, " (value %s)\n", defines[i].value);
}
else
{
fprintf(outFile, " (value \"%s\")\n", defines[i].value);
}
fprintf(outFile, " (description \"%s\"))", defines[i].desc);
}
fprintf(outFile, ")\n\n");
// Print structs info
fprintf(outFile, " (structs\n");
for (int i = 0; i < structCount; i++)
{
if(i != 0) fprintf(outFile, "\n\n");
fprintf(outFile, " ((name \"%s\")\n", structs[i].name);
fprintf(outFile, " (description \"%s\")\n", EscapeBackslashes(structs[i].desc));
fprintf(outFile, " (fields ");
for (int f = 0; f < structs[i].fieldCount; f++)
{
fprintf(outFile, "\n ((type \"%s\")\n", structs[i].fieldType[f]);
fprintf(outFile, " (name \"%s\")\n", structs[i].fieldName[f]);
fprintf(outFile, " (description \"%s\"))", EscapeBackslashes(structs[i].fieldDesc[f]));
}
fprintf(outFile, "))");
}
fprintf(outFile, ")\n\n");
// Print aliases info
fprintf(outFile, " (aliases\n");
for (int i = 0; i < aliasCount; i++)
{
if(i != 0) fprintf(outFile, "\n\n");
fprintf(outFile, " ((type \"%s\")\n", aliases[i].type);
fprintf(outFile, " (name \"%s\")\n", aliases[i].name);
fprintf(outFile, " (description \"%s\"))", aliases[i].desc);
}
fprintf(outFile, ")\n\n");
// Print enums info
fprintf(outFile, " (enums\n");
for (int i = 0; i < enumCount; i++)
{
if(i != 0) fprintf(outFile, "\n\n");
fprintf(outFile, " ((name \"%s\")\n", enums[i].name);
fprintf(outFile, " (description \"%s\")\n", EscapeBackslashes(enums[i].desc));
fprintf(outFile, " (values\n");
for (int e = 0; e < enums[i].valueCount; e++)
{
if(e != 0) fprintf(outFile, "\n\n");
fprintf(outFile, " ((name \"%s\")\n", enums[i].valueName[e]);
fprintf(outFile, " (value %i)\n", enums[i].valueInteger[e]);
fprintf(outFile, " (description \"%s\"))", EscapeBackslashes(enums[i].valueDesc[e]));
}
fprintf(outFile, "))");
}
fprintf(outFile, ")\n\n");
// Print callbacks info
fprintf(outFile, " (callbacks\n");
for (int i = 0; i < callbackCount; i++)
{
if(i != 0) fprintf(outFile, "\n\n");
fprintf(outFile, " ((name \"%s\")\n", callbacks[i].name);
fprintf(outFile, " (description \"%s\")\n", EscapeBackslashes(callbacks[i].desc));
fprintf(outFile, " (return-type \"%s\")", callbacks[i].retType);
if (callbacks[i].paramCount == 0) fprintf(outFile, "\n");
else
{
fprintf(outFile, "\n (params\n");
for (int p = 0; p < callbacks[i].paramCount; p++)
{
if(p != 0) fprintf(outFile, "\n");
fprintf(outFile, " ((type \"%s\") (name \"%s\"))", callbacks[i].paramType[p], callbacks[i].paramName[p]);
}
fprintf(outFile, ")");
}
fprintf(outFile, ")");
}
fprintf(outFile, ")\n\n");
// Print functions info
fprintf(outFile, " (functions\n");
for (int i = 0; i < funcCount; i++)
{
if(i != 0) fprintf(outFile, "\n\n");
fprintf(outFile, " ((name \"%s\")\n", funcs[i].name);
fprintf(outFile, " (description \"%s\")\n", EscapeBackslashes(funcs[i].desc));
fprintf(outFile, " (return-type \"%s\")", funcs[i].retType);
if (funcs[i].paramCount == 0) fprintf(outFile, "");
else
{
fprintf(outFile, "\n (params\n");
for (int p = 0; p < funcs[i].paramCount; p++)
{
if(p != 0) fprintf(outFile, "\n");
fprintf(outFile, " ((type \"%s\") (name \"%s\"))", funcs[i].paramType[p], funcs[i].paramName[p]);
}
fprintf(outFile, ")");
}
fprintf(outFile, ")");
}
fprintf(outFile, ")");
fprintf(outFile, ")\n");
} break;
case CODE:
default: break;
}