[libpng16] Changed chunk handler warnings into benign errors, incrementally
load iCCP
diff --git a/scripts/options.awk b/scripts/options.awk
index a8dff04..f5d7729 100755
--- a/scripts/options.awk
+++ b/scripts/options.awk
@@ -286,15 +286,15 @@
# Else fall through to the error handler
}
-# chunk NAME [requires OPT] [on|off|disabled]
+# chunk NAME [requires OPT] [enables LIST] [on|off|disabled]
# Expands to the 'option' settings appropriate to the reading and
# writing of an ancilliary PNG chunk 'NAME':
#
# option READ_NAME requires READ_ANCILLARY_CHUNKS [READ_OPT]
-# option READ_NAME enables NAME
+# option READ_NAME enables NAME LIST
# [option READ_NAME off]
# option WRITE_NAME requires WRITE_ANCILLARY_CHUNKS [WRITE_OPT]
-# option WRITE_NAME enables NAME
+# option WRITE_NAME enables NAME LIST
# [option WRITE_NAME off]
pre != 0 && $1 == "chunk" && NF >= 2{
@@ -303,6 +303,7 @@
onoff = ""
reqread = ""
reqwrite = ""
+ enables = ""
i = 3 # indicates format error
if (NF > 2) {
# read the keywords/additional OPTS
@@ -315,21 +316,25 @@
else
break # on/off conflict
}
+ req = 0
} else if ($(i) == "requires")
req = 1
- else if (req != 1)
- break # bad line: handled below
- else {
+ else if ($(i) == "enables")
+ req = 2
+ else if (req == 1){
reqread = reqread " READ_" $(i)
reqwrite = reqwrite " WRITE_" $(i)
- }
+ } else if (req == 2)
+ enables = enables " " $(i)
+ else
+ break # bad line: handled below
}
}
if (i > NF) {
# Output new 'option' lines to the intermediate file (out)
- print "option READ_" $2, "requires READ_ANCILLARY_CHUNKS" reqread, "enables", $2, onoff >out
- print "option WRITE_" $2, "requires WRITE_ANCILLARY_CHUNKS" reqwrite, "enables", $2, onoff >out
+ print "option READ_" $2, "requires READ_ANCILLARY_CHUNKS" reqread, "enables", $2 enables , onoff >out
+ print "option WRITE_" $2, "requires WRITE_ANCILLARY_CHUNKS" reqwrite, "enables", $2 enables, onoff >out
next
}
# Else hit the error handler below - bad line format!