Mario Zechner e324cf5cb1 [c] Port type extractor to TypeScript and improve codegen
- Ported extract-spine-cpp-types.js to TypeScript in type-extractor.ts
- Improved type interfaces with discriminated unions for better type safety
- Added proper isConst tracking for const-qualified methods
- Fixed exclusions to check method.isConst instead of return type
- Removed special type mappings (utf8, spine_void) - primitives pass through unchanged
- Made toCTypeName strict with proper error handling
- Documented all conversion functions with examples
- Excluded SpineObject from extraction (matches JS behavior)
- Removed original JS extractor as it's now replaced by TypeScript version

The TypeScript extractor produces identical output (107 files, 164 types) while providing better type information including isConst for methods and consistent isStatic fields.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 02:27:20 +02:00

26 lines
631 B
C

#include <stdio.h>
#include <stdlib.h>
#include <spine-c.h>
int main() {
printf("Testing spine-c-new...\n");
// Test version functions
printf("Spine version: %d.%d\n", spine_major_version(), spine_minor_version());
// Test debug extension
spine_enable_debug_extension(1);
// Test loading an atlas (will fail but tests the API)
spine_atlas atlas = spine_atlas_load("test.atlas");
if (!atlas) {
printf("Failed to load atlas (expected)\n");
} else {
spine_atlas_dispose(atlas);
}
// Report any memory leaks
spine_report_leaks();
return 0;
}