summaryrefslogtreecommitdiff
path: root/gen_inl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gen_inl.c')
-rw-r--r--gen_inl.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/gen_inl.c b/gen_inl.c
index 975b7a5..e5ec31e 100644
--- a/gen_inl.c
+++ b/gen_inl.c
@@ -101,12 +101,15 @@ int write_file(FILE *out, char *source) {
return 1;
}
- fprintf(out, "/*%s*\n", repeat(67, '*'));
- fprintf(out, " *%s*\n", repeat(67, ' '));
- fprintf(out, " * File: %s%s*\n", source,
- repeat(55 - strlen(source), ' '));
- fprintf(out, " *%s*\n", repeat(67, ' '));
- fprintf(out, " *%s*/\n", repeat(67, '*'));
+ fprintf(out, "// "
+ "====================================================="
+ "===========\n");
+ fprintf(out, "//\n");
+ fprintf(out, "// File: %s\n", source);
+ fprintf(out, "//\n");
+ fprintf(out, "// "
+ "====================================================="
+ "===========\n");
char line[200];
char buf[400];
@@ -147,7 +150,8 @@ int main(int argc, char **argv) {
fprintf(out, "// kit.inl.h\n");
fprintf(out, "// https://guattari.tech/kit.git\n");
fprintf(out, "//\n");
- fprintf(out, "// Single header-only cross-platform utility library for C.\n");
+ fprintf(out, "// Single header-only cross-platform utility "
+ "library for C.\n");
fprintf(out, "//\n");
fprintf(out, "// "
"====================================================="
@@ -207,7 +211,19 @@ int main(int argc, char **argv) {
return 1;
}
- fprintf(out, "#ifdef KIT_IMPLEMENTATION\n");
+ fprintf(out, "#endif\n");
+ fprintf(out, "// "
+ "====================================================="
+ "===========\n");
+ fprintf(out, "//\n");
+ fprintf(out, "// IMPLEMENTATION\n");
+ fprintf(out, "//\n");
+ fprintf(out, "// "
+ "====================================================="
+ "===========\n");
+ fprintf(out, "#if defined(KIT_IMPLEMENTATION) && "
+ "!defined(KIT_INL_H_IMPL)\n");
+ fprintf(out, "#define KIT_INL_H_IMPL\n");
for (int i = 0; i < sizeof IMPL / sizeof *IMPL; i++)
if (write_file(out, IMPL[i]) != 0) {
@@ -216,7 +232,6 @@ int main(int argc, char **argv) {
}
fprintf(out, "#endif\n");
- fprintf(out, "#endif\n");
fclose(out);
return 0;