Commit Graph

4 Commits

Author SHA1 Message Date
Peterino2 a71d236c0c parser: Fix multiple parsing issues
- Fix enum/struct/union parsing to stop at semicolons (prevents grabbing next declaration's body)
- Fix scanOpaque to handle forward declarations with mismatched names (typedef struct tagMSG MSG)
- Fix scanOpaque to reject pointer typedefs (typedef struct X *Y)
- Add support for pointer typedefs in scanTypedef
- Add type conversion for opaque struct pointers (struct X * -> *anyopaque)
- Fix double pointer type conversion (SDL_Type * const * -> [*c]const *Type)

This fixes audio, camera, and system header generation. 46/48 headers now generate successfully.
2026-01-22 19:25:22 -08:00
Peterino2 83aa5fc26c Add mutex to ignore list, keep only core SDL3 APIs 2026-01-22 18:56:56 -08:00
Peterino2 0c548e053a fix: handle hex flag values with 'u' suffix and array parameters
- Strip 'u'/'U' suffix from hex literals before parsing bit positions
- Fixed array parameter syntax (argv[]) -> converted to pointer-to-pointer
- Added type conversion for char ** and char**
- SDL_init.h now parses successfully (15/16 headers working)

Still unsupported:
- SDL_iostream.h: function pointer fields in structs (complex C syntax)
2026-01-22 18:25:58 -08:00
Peterino2 724b5e1a05 feat: add JSON export and regenerate multiple SDL headers
- Implemented --generate-json flag to export parsed API as JSON
- Added proper JSON formatting using std.json
- Fixed memory leaks in JSON generation
- Updated build.zig to generate 15 different SDL headers
- Successfully parsing 13/15 headers (init and iostream have issues)

Working headers:
- SDL_gpu, SDL_video, SDL_events, SDL_keyboard
- SDL_mouse, SDL_scancode, SDL_keycode, SDL_pixels
- SDL_rect, SDL_surface, SDL_blendmode, SDL_timer
- SDL_error

Known issues:
- SDL_init.h: array syntax in function pointer params (argv[])
- SDL_iostream.h: function pointer fields in structs not supported
2026-01-22 18:16:49 -08:00