mirror of
https://github.com/raysan5/raylib.git
synced 2026-03-29 20:01:59 +00:00
Remove trailing spaces
This commit is contained in:
@@ -34,7 +34,7 @@ int main()
|
||||
DrawFPS(10, 10);
|
||||
EndDrawing();
|
||||
}
|
||||
|
||||
|
||||
CloseWindow();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ int main()
|
||||
int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
|
||||
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
@@ -44,7 +44,7 @@ int main()
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------------------
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
<Param name="float alpha" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
|
||||
|
||||
NOTE: Generated XML text should be copied inside raylib\Notepad++\plugins\APIs\c.xml
|
||||
|
||||
|
||||
WARNING: Be careful with functions that split parameters into several lines, it breaks the process!
|
||||
|
||||
LICENSE: zlib/libpng
|
||||
@@ -42,13 +42,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
FILE *rFile = fopen(argv[1], "rt");
|
||||
FILE *rxmlFile = fopen("raylib_npp.xml", "wt");
|
||||
|
||||
|
||||
if ((rFile == NULL) || (rxmlFile == NULL))
|
||||
{
|
||||
printf("File could not be opened.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
char *buffer = (char *)calloc(MAX_BUFFER_SIZE, 1);
|
||||
int count = 0;
|
||||
|
||||
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
// Read one full line
|
||||
fgets(buffer, MAX_BUFFER_SIZE, rFile);
|
||||
|
||||
|
||||
if (buffer[0] == '/') fprintf(rxmlFile, " <!--%.*s -->\n", strlen(buffer) - 3, buffer + 2);
|
||||
else if (buffer[0] == '\n') fprintf(rxmlFile, "%s", buffer); // Direct copy of code comments
|
||||
else if (strncmp(buffer, "RLAPI", 5) == 0) // raylib function declaration
|
||||
@@ -65,33 +65,33 @@ int main(int argc, char *argv[])
|
||||
char funcTypeAux[64];
|
||||
char funcName[64];
|
||||
char funcDesc[256];
|
||||
|
||||
|
||||
char params[128];
|
||||
char paramType[16][16];
|
||||
char paramName[16][32];
|
||||
|
||||
|
||||
int index = 0;
|
||||
char *ptr = NULL;
|
||||
|
||||
|
||||
sscanf(buffer, "RLAPI %s %[^(]s", funcType, funcName);
|
||||
|
||||
|
||||
if (strcmp(funcType, "const") == 0)
|
||||
{
|
||||
{
|
||||
sscanf(buffer, "RLAPI %s %s %[^(]s", funcType, funcTypeAux, funcName);
|
||||
strcat(funcType, " ");
|
||||
strcat(funcType, funcTypeAux);
|
||||
}
|
||||
|
||||
|
||||
ptr = strchr(buffer, '/');
|
||||
index = (int)(ptr - buffer);
|
||||
|
||||
|
||||
sscanf(buffer + index, "%[^\n]s", funcDesc); // Read function comment after declaration
|
||||
|
||||
|
||||
ptr = strchr(buffer, '(');
|
||||
|
||||
|
||||
if (ptr != NULL) index = (int)(ptr - buffer);
|
||||
else printf("Character not found!\n");
|
||||
|
||||
|
||||
sscanf(buffer + (index + 1), "%[^)]s", params); // Read what's inside '(' and ')'
|
||||
|
||||
// Scan params string for number of func params, type and name
|
||||
@@ -102,23 +102,23 @@ int main(int argc, char *argv[])
|
||||
if ((funcName[0] == '*') && (funcName[1] == '*')) fprintf(rxmlFile, " <KeyWord name=\"%s\" func=\"yes\">\n", funcName + 2);
|
||||
else if (funcName[0] == '*') fprintf(rxmlFile, " <KeyWord name=\"%s\" func=\"yes\">\n", funcName + 1);
|
||||
else fprintf(rxmlFile, " <KeyWord name=\"%s\" func=\"yes\">\n", funcName);
|
||||
|
||||
|
||||
fprintf(rxmlFile, " <Overload retVal=\"%s\" descr=\"%s\">", funcType, funcDesc + 3);
|
||||
|
||||
|
||||
bool paramsVoid = false;
|
||||
|
||||
|
||||
char paramConst[8][16];
|
||||
|
||||
while (paramPtr[paramsCount] != NULL)
|
||||
{
|
||||
sscanf(paramPtr[paramsCount], "%s %s\n", paramType[paramsCount], paramName[paramsCount]);
|
||||
|
||||
|
||||
if (strcmp(paramType[paramsCount], "void") == 0)
|
||||
{
|
||||
paramsVoid = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ((strcmp(paramType[paramsCount], "const") == 0) || (strcmp(paramType[paramsCount], "unsigned") == 0))
|
||||
{
|
||||
sscanf(paramPtr[paramsCount], "%s %s %s\n", paramConst[paramsCount], paramType[paramsCount], paramName[paramsCount]);
|
||||
@@ -130,17 +130,17 @@ int main(int argc, char *argv[])
|
||||
paramsCount++;
|
||||
paramPtr[paramsCount] = strtok(NULL, ",");
|
||||
}
|
||||
|
||||
|
||||
fprintf(rxmlFile, "%s</Overload>\n", paramsVoid ? "" : "\n ");
|
||||
fprintf(rxmlFile, " </KeyWord>\n");
|
||||
|
||||
count++;
|
||||
printf("Function processed %02i: %s\n", count, funcName);
|
||||
|
||||
|
||||
memset(buffer, 0, MAX_BUFFER_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
free(buffer);
|
||||
fclose(rFile);
|
||||
fclose(rxmlFile);
|
||||
|
||||
Reference in New Issue
Block a user