JSON parser: Use array for function params (#2255) (#2264)

* JSON parser: Use array for function params (#2255)

* Parser: follow C convention of type before name
This commit is contained in:
gtrxAC 2022-01-04 15:06:10 +02:00 committed by GitHub
parent 2116a98745
commit 2e3cfdcc2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6955 additions and 3720 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -542,7 +542,7 @@
<Value name="NPATCH_THREE_PATCH_HORIZONTAL" integer="2" desc="Npatch layout: 3x1 tiles" />
</Enum>
</Enums>
<Functions count="489">
<Functions count="491">
<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="" />
@ -569,7 +569,7 @@
<Function name="IsWindowState" retType="bool" paramCount="1" desc="Check if one specific window flag is enabled">
<Param type="unsigned int" name="flag" desc="" />
</Function>
<Function name="SetWindowState" retType="void" paramCount="1" desc="Set window configuration state using flags">
<Function name="SetWindowState" retType="void" paramCount="1" desc="Set window configuration state using flags (only PLATFORM_DESKTOP)">
<Param type="unsigned int" name="flags" desc="" />
</Function>
<Function name="ClearWindowState" retType="void" paramCount="1" desc="Clear window configuration state flags">
@ -604,6 +604,9 @@
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
</Function>
<Function name="SetWindowOpacity" retType="void" paramCount="1" desc="Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)">
<Param type="float" name="opacity" desc="" />
</Function>
<Function name="GetWindowHandle" retType="void *" paramCount="0" desc="Get native window handle">
</Function>
<Function name="GetScreenWidth" retType="int" paramCount="0" desc="Get current screen width">
@ -1831,7 +1834,7 @@
<Function name="LoadFont" retType="Font" paramCount="1" desc="Load font from file into GPU memory (VRAM)">
<Param type="const char *" name="fileName" desc="" />
</Function>
<Function name="LoadFontEx" retType="Font" paramCount="4" desc="Load font from file with extended parameters">
<Function name="LoadFontEx" retType="Font" paramCount="4" desc="Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set">
<Param type="const char *" name="fileName" desc="" />
<Param type="int" name="fontSize" desc="" />
<Param type="int *" name="fontChars" desc="" />
@ -1870,9 +1873,13 @@
<Param type="GlyphInfo *" name="chars" desc="" />
<Param type="int" name="glyphCount" desc="" />
</Function>
<Function name="UnloadFont" retType="void" paramCount="1" desc="Unload Font from GPU memory (VRAM)">
<Function name="UnloadFont" retType="void" paramCount="1" desc="Unload font from GPU memory (VRAM)">
<Param type="Font" name="font" desc="" />
</Function>
<Function name="ExportFontAsCode" retType="bool" paramCount="2" desc="Export font as code file, returns true on success">
<Param type="Font" name="font" desc="" />
<Param type="const char *" name="fileName" desc="" />
</Function>
<Function name="DrawFPS" retType="void" paramCount="2" desc="Draw current FPS">
<Param type="int" name="posX" desc="" />
<Param type="int" name="posY" desc="" />

View File

@ -867,8 +867,8 @@ static void ExportParsedData(const char *fileName, int format)
for (int f = 0; f < structs[i].fieldCount; f++)
{
fprintf(outFile, " {\n");
fprintf(outFile, " name = \"%s\",\n", structs[i].fieldName[f]);
fprintf(outFile, " type = \"%s\",\n", structs[i].fieldType[f]);
fprintf(outFile, " name = \"%s\",\n", structs[i].fieldName[f]);
fprintf(outFile, " description = \"%s\"\n", EscapeBackslashes(structs[i].fieldDesc[f] + 3));
fprintf(outFile, " }");
if (f < structs[i].fieldCount - 1) fprintf(outFile, ",\n");
@ -921,7 +921,7 @@ static void ExportParsedData(const char *fileName, int format)
fprintf(outFile, ",\n params = {\n");
for (int p = 0; p < funcs[i].paramCount; p++)
{
fprintf(outFile, " {name = \"%s\", type = \"%s\"}", funcs[i].paramName[p], funcs[i].paramType[p]);
fprintf(outFile, " {type = \"%s\", name = \"%s\"}", funcs[i].paramType[p], funcs[i].paramName[p]);
if (p < funcs[i].paramCount - 1) fprintf(outFile, ",\n");
else fprintf(outFile, "\n");
}
@ -950,8 +950,8 @@ static void ExportParsedData(const char *fileName, int format)
for (int f = 0; f < structs[i].fieldCount; f++)
{
fprintf(outFile, " {\n");
fprintf(outFile, " \"name\": \"%s\",\n", structs[i].fieldName[f]);
fprintf(outFile, " \"type\": \"%s\",\n", structs[i].fieldType[f]);
fprintf(outFile, " \"name\": \"%s\",\n", structs[i].fieldName[f]);
fprintf(outFile, " \"description\": \"%s\"\n", EscapeBackslashes(structs[i].fieldDesc[f] + 3));
fprintf(outFile, " }");
if (f < structs[i].fieldCount - 1) fprintf(outFile, ",\n");
@ -1001,14 +1001,17 @@ static void ExportParsedData(const char *fileName, int format)
if (funcs[i].paramCount == 0) fprintf(outFile, "\n");
else
{
fprintf(outFile, ",\n \"params\": {\n");
fprintf(outFile, ",\n \"params\": [\n");
for (int p = 0; p < funcs[i].paramCount; p++)
{
fprintf(outFile, " \"%s\": \"%s\"", funcs[i].paramName[p], funcs[i].paramType[p]);
fprintf(outFile, " {\n");
fprintf(outFile, " \"type\": \"%s\",\n", funcs[i].paramType[p]);
fprintf(outFile, " \"name\": \"%s\"\n", funcs[i].paramName[p]);
fprintf(outFile, " }");
if (p < funcs[i].paramCount - 1) fprintf(outFile, ",\n");
else fprintf(outFile, "\n");
}
fprintf(outFile, " }\n");
fprintf(outFile, " ]\n");
}
fprintf(outFile, " }");