codegen.h (1431B)
1 #ifndef CODEGEN_H 2 #define CODEGEN_H 3 4 #include "symbols.h" 5 #include "parser.h" 6 7 typedef struct fb_output fb_output_t; 8 9 struct fb_output { 10 /* 11 * Common namespace across files. May differ from namespace 12 * for consistent use of type names. 13 */ 14 char nsc[FLATCC_NAMESPACE_MAX + 2]; 15 char nscup[FLATCC_NAMESPACE_MAX + 2]; 16 17 FILE *fp; 18 fb_schema_t *S; 19 fb_options_t *opts; 20 fb_scope_t *current_scope; 21 int indent; 22 int spacing; 23 int tmp_indent; 24 }; 25 26 int __flatcc_fb_init_output_c(fb_output_t *out, fb_options_t *opts); 27 #define fb_init_output_c __flatcc_fb_init_output_c 28 void __flatcc_fb_end_output_c(fb_output_t *out); 29 #define fb_end_output_c __flatcc_fb_end_output_c 30 31 int __flatcc_fb_codegen_common_c(fb_output_t *out); 32 #define fb_codegen_common_c __flatcc_fb_codegen_common_c 33 34 int __flatcc_fb_codegen_c(fb_output_t *out, fb_schema_t *S); 35 #define fb_codegen_c __flatcc_fb_codegen_c 36 37 void *__flatcc_fb_codegen_bfbs_to_buffer(fb_options_t *opts, fb_schema_t *S, void *buffer, size_t *size); 38 #define fb_codegen_bfbs_to_buffer __flatcc_fb_codegen_bfbs_to_buffer 39 40 void *__flatcc_fb_codegen_bfbs_alloc_buffer(fb_options_t *opts, fb_schema_t *S, size_t *size); 41 #define fb_codegen_bfbs_alloc_buffer __flatcc_fb_codegen_bfbs_alloc_buffer 42 43 int __flatcc_fb_codegen_bfbs_to_file(fb_options_t *opts, fb_schema_t *S); 44 #define fb_codegen_bfbs_to_file __flatcc_fb_codegen_bfbs_to_file 45 46 #endif /* CODEGEN_H */