aboutsummaryrefslogtreecommitdiffstats
path: root/src/gen.c
diff options
context:
space:
mode:
authorkatherine <shmibs@airen-no-jikken.icu>2019-05-23 03:23:59 -0700
committerkatherine <shmibs@airen-no-jikken.icu>2019-05-23 03:23:59 -0700
commit101d5ad1f3e864f3b6442b6063151ffb47178099 (patch)
tree7b2d941bffe231cf7e05eafbd6071016c4d4f507 /src/gen.c
parent031ff654cf9ad4de5cecf3fabff92e4bb2352c17 (diff)
downloadconfconf-101d5ad1f3e864f3b6442b6063151ffb47178099.tar.gz
add basetype-use-checks to analyse
Diffstat (limited to 'src/gen.c')
-rw-r--r--src/gen.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/gen.c b/src/gen.c
index e69de29..98e067b 100644
--- a/src/gen.c
+++ b/src/gen.c
@@ -0,0 +1,38 @@
+#include "gen.h"
+
+#include "version.h"
+
+#include <time.h>
+
+static const char header[] =
+"#ifndef CONFCONF_PRIV_H\n"
+"#define CONFCONF_PRIV_H\n"
+"\n"
+"#include <stdbool.h>\n"
+"#include <stdio.h>\n"
+"#include <ctype.h>\n"
+"\n"
+"struct confconf_priv_fstate {\n"
+" void *f;\n"
+" int (*gcp)(void *);\n"
+" size_t line;\n"
+" size_t col;\n"
+" size_t byte;\n"
+"};\n"
+"\n"
+"#endif\n"
+;
+
+void gen(FILE *f, struct parse_result_s pr, struct analyse_result_s ar)
+{
+ time_t t;
+ struct tm *ti;
+
+ time(&t);
+ ti = localtime(&t);
+
+ fprintf(f, "/* generated by %s on %04d-%02d-%02d */\n",
+ VERSION, ti->tm_year + 1900, ti->tm_mon + 1, ti->tm_mday);
+
+ fprintf(f, header);
+}