-/** Initializes all the tables described in the tables array */
-void tableinit(void);
-/** Describes the tables that should be printed */
-extern const struct tabledef tables[];
+#define WRITE_2D_ARRAY(prefix, type, name) \
+ do { \
+ const size_t array_size1 = FF_ARRAY_ELEMS(name); \
+ const size_t array_size2 = FF_ARRAY_ELEMS(name[0]); \
+ printf(prefix" "#type" "#name"[%"FMT"][%"FMT"] = {\n", \
+ array_size1, array_size2 ); \
+ write_##type##_2d_array(name, array_size1, array_size2); \
+ printf("};\n"); \
+ } while(0)
+
+
+WRITE_1D_FUNC(int8_t, "%3"PRIi8, 15)
+WRITE_1D_FUNC(uint8_t, "0x%02"PRIx8, 15)
+WRITE_1D_FUNC(uint16_t, "0x%08"PRIx16, 7)
+WRITE_1D_FUNC(uint32_t, "0x%08"PRIx32, 7)
+WRITE_1D_FUNC(float, "%.18e", 3)
+
+WRITE_2D_FUNC(int8_t)
+WRITE_2D_FUNC(uint8_t)
+WRITE_2D_FUNC(uint32_t)
+WRITE_2D_FUNC(float)
+
+static inline void write_fileheader(void)
+{
+ printf("/* This file was automatically generated. */\n");
+ printf("#include <stdint.h>\n");
+}