In future, if a dev edits the second arg and miscalulates the corresponding 3rd arg, there will be a buffer overflow or the string (2nd arg) will be cut short. This commit prevents that.
The parser assumes all lines end in newlines, but sometimes this isn't
true. Check for a null terminator along with '\n' when stripping leading
spaces.
* parser: Fail gracefully if a nonexistent file is passed on the command line
Before, if a nonexistent file was passed to LoadFileText(), it would
return NULL, and the parser would happily dereference it.
* parser: Refactor Makefile and update the path to easings.h (now reasings.h)
Before, the `make all` target would simply segfault, see 0a679d79
Now, if a file in the `make all` target doesn't exist, make will write
an error.
Individual API files can be generated likeso, provided the header file
the target depends on exists:
FORMAT=JSON EXTENSION=json make raygui_api.json
In order for the `make all` target to succeed, raygui.h, physac.h and
rmem.h need to be added to the correct directory.
* Fix parser function description detection
Some functions in easings.h are defined on a single line and include a
division which was mistaken for the start of the description.
* Fix parser detection of macros including spaces
* Add support for self-referencing structs to parser
* Fix parser code style
* Fix parser handling of multiple fields on one line
* Increase parser MAX_STRUCT_FIELDS
For internal rlglData State struct (internal structs are still not
supported but this makes it less wrong).
* Add description helper to parser
* Regenerate parser output
* Add cakkbacks to parser
* Regenerate parser output
* Refactor funcLines to be an array of line numbers
It used to be an array of pointers into the text buffer but was changed
to be an array of pointers to the lines. Now it is an array of line
numbers like the others.
* Fix code style
* Move array size from name to type
* Regenerate parser output
* added defines to parser
* added value and description for defines in parser
* parser: fixed lua defines output, fixed makefile for raygui, added LONG type for defines
* parser defines: remove postfix for LONG/FLOAT, support for hexadecimal consts, convert hex ints to decimal for JSON output
* removed defines from raylib_apis
* Parse enum descriptions and value descriptions
* Put braces on newline
* Properly escape strings
* Realise that XML doesn't actually need backslash escapes
* Replace FPrintfEscapes with EscapeBackslashes
* Remove #include <stdarg.h>
* Update EscapeBackslashes description