chore: add docs and example
This commit is contained in:
19
example/01_simple_struct/main.c
Normal file
19
example/01_simple_struct/main.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <stdio.h>
|
||||
#include "cmeta.h"
|
||||
|
||||
typedef struct {
|
||||
int int_field;
|
||||
} Foo_Struct;
|
||||
|
||||
int main(void) {
|
||||
printf("Foo_Struct infos:\n");
|
||||
printf(" name = %s\n", foo_struct_info.name);
|
||||
printf(" fields_count = %zu\n", foo_struct_info.fields_count);
|
||||
|
||||
for (size_t i = 0; i < foo_struct_info.fields_count; i += 1) {
|
||||
Field_Info field = foo_struct_info.fields[i];
|
||||
printf(" .%s: %s\n", field.name, field.type);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user