Skip to content

Commit

Permalink
Add magic and eof types to ksy definition
Browse files Browse the repository at this point in the history
The added granularity allows us to correctly decode the BOF and EOF
sequences in ksdump, annotating each part of the objects that form
those. NB. the description could be more detailed than initially
committed here.

Related to: kaitai-io/kaitai_struct_visualizer#61
  • Loading branch information
ross-spencer committed Nov 5, 2023
1 parent 71dbd32 commit 7491c31
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 8 deletions.
30 changes: 26 additions & 4 deletions kaitai/eyeglass_big_endian.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ doc: |
The eyeglass file format. A digital preservation training format.
seq:
- id: magic
type: magic
size: 14
type: str
encoding: utf-8
- id: version
size: 1
- id: endianness
Expand Down Expand Up @@ -65,6 +64,29 @@ seq:
- id: next_checkup_years
type: f4
- id: eof
type: eof
size: 4
type: str
encoding: utf-8
types:
magic:
seq:
- id: magic_1
size: 3
doc: "contains non-UTF-8 characters per the specification"
- id: magic_2
size: 8
encoding: utf-8
type: str
doc: "string 'eyeglass'"
- id: magic_3
size: 3
doc: "contains non-UTF-8 characters per the specification"
eof:
seq:
- id: eof_1
size: 1
doc: "single non-UTF-8 character prefix"
- id: eof_2
size: 3
type: str
encoding: utf-8
doc: "string 'eof'"
30 changes: 26 additions & 4 deletions kaitai/eyeglass_little_endian.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ doc: |
The eyeglass file format. A digital preservation training format.
seq:
- id: magic
type: magic
size: 14
type: str
encoding: utf-8
- id: version
size: 1
- id: endianness
Expand Down Expand Up @@ -65,6 +64,29 @@ seq:
- id: next_checkup_years
type: f4
- id: eof
type: eof
size: 4
type: str
encoding: utf-8
types:
magic:
seq:
- id: magic_1
size: 3
doc: "contains non-UTF-8 characters per the specification"
- id: magic_2
size: 8
encoding: utf-8
type: str
doc: "string 'eyeglass'"
- id: magic_3
size: 3
doc: "contains non-UTF-8 characters per the specification"
eof:
seq:
- id: eof_1
size: 1
doc: "single non-UTF-8 character prefix"
- id: eof_2
size: 3
type: str
encoding: utf-8
doc: "string 'eof'"

0 comments on commit 7491c31

Please sign in to comment.