diff options
Diffstat (limited to 'tiff-tables.awk')
-rwxr-xr-x | tiff-tables.awk | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tiff-tables.awk b/tiff-tables.awk index 2d93c36..29b462b 100755 --- a/tiff-tables.awk +++ b/tiff-tables.awk @@ -2,6 +2,22 @@ BEGIN { FS = ", *" print "// Generated by tiff-tables.awk. DO NOT MODIFY." + print "" + print "#ifndef TIFF_TABLES_CONSTANTS_ONLY" + print "#include <stddef.h>" + print "#include <stdint.h>" + print "" + print "struct tiff_value {" + print "\tconst char *name;" + print "\tuint16_t value;" + print "};" + print "" + print "struct tiff_entry {" + print "\tconst char *name;" + print "\tuint16_t tag;" + print "\tstruct tiff_value *values;" + print "};" + print "#endif" } { @@ -55,8 +71,10 @@ function flushvalues() { function flushsection() { if (section) { flushvalues() - print "};\n\n" allvalues "static struct tiff_entry " \ + print "};\n\n" allvalues "#ifndef TIFF_TABLES_CONSTANTS_ONLY" + print "static struct tiff_entry " \ sectionsnakecase "_entries[] = {" fields "\n\t{}\n};" + print "#endif" } } |