mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 08:32:11 +01:00
std: add "get_quirk(key: u32) u64"
This commit is contained in:
1 parent
84d1aa0d79
commit
4dfd70928b
20 files changed
+879
No files matched your search
@@ -62,6 +62,22 @@ pub func decoder.add_dictionary!(dict: slice base.u8) {
|
||||
this.got_dictionary = true
|
||||
}
|
||||
|
||||
pub func decoder.get_quirk(key: base.u32) base.u64 {
|
||||
var key : base.u32
|
||||
|
||||
if (args.key == base.QUIRK_IGNORE_CHECKSUM) and this.ignore_checksum {
|
||||
return 1
|
||||
} else if args.key >= QUIRKS_BASE {
|
||||
key = args.key - QUIRKS_BASE
|
||||
if key < QUIRKS_COUNT {
|
||||
if this.quirks[key] {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
pub func decoder.set_quirk!(key: base.u32, value: base.u64) base.status {
|
||||
if this.header_complete {
|
||||
this.bad_call_sequence = true
|
||||
|
||||
Reference in new issue
Block a user