std: add "get_quirk(key: u32) u64"

This commit is contained in:
Nigel Tao committed 2023-07-16 12:04:09 +10:00
1 parent 84d1aa0d79
commit 4dfd70928b
20 files changed
+879

No files matched your search

+16
View File
@@ -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