# raylib parser This parser scans [`raylib.h`](../src/raylib.h) to get information about `defines`, `structs`, `enums` and `functions`. All data is separated into parts, usually as strings. The following types are used for data: - `struct DefineInfo` - `struct FunctionInfo` - `struct StructInfo` - `struct EnumInfo` Check `raylib_parser.c` for details about those structs. ## Command Line ``` ////////////////////////////////////////////////////////////////////////////////// // // // raylib API parser // // // // more info and bugs-report: github.com/raysan5/raylib/parser // // // // Copyright (c) 2021-2024 Ramon Santamaria (@raysan5) // // // ////////////////////////////////////////////////////////////////////////////////// USAGE: > raylib_parser [--help] [--input ] [--output ] [--format ] OPTIONS: -h, --help : Show tool version and command line usage help -i, --input : Define input header file to parse. NOTE: If not specified, defaults to: raylib.h -o, --output : Define output file and format. Supported extensions: .txt, .json, .xml, .h NOTE: If not specified, defaults to: raylib_api.txt -f, --format : Define output format for parser data. Supported types: DEFAULT, JSON, XML, LUA -d, --define : Define functions specifiers (i.e. RLAPI for raylib.h, RMAPI for raymath.h, etc.) NOTE: If no specifier defined, defaults to: RLAPI -t, --truncate : Define string to truncate input after (i.e. "RLGL IMPLEMENTATION" for rlgl.h) NOTE: If not specified, the full input file is parsed. EXAMPLES: > raylib_parser --input raylib.h --output api.json Process to generate > raylib_parser --output raylib_data.info --format XML Process to generate as XML text data > raylib_parser --input raymath.h --output raymath_data.info --format XML --define RMAPI Process to generate as XML text data ``` ## Constraints This parser is specifically designed to work with raylib.h, so, it has some constraints: - Functions are expected as a single line with the following structure: ``` ( , ); ``` Be careful with functions broken into several lines, it breaks the process! - Structures are expected as several lines with the following form: ``` typedef struct { ; ; ; } ; ``` - Enums are expected as several lines with the following form: ``` typedef enum { = , , , } ; ``` _NOTE: For enums, multiple options are supported:_ - If value is not provided, ( + 1) is assigned - Value description can be provided or not ## Additional notes This parser _could_ work with other C header files if mentioned constraints are followed. This parser **does not require `` library**, all data is parsed directly from char buffers. ### LICENSE: zlib/libpng raylib-parser is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE) for further details.