Supported template field types
As of version 0.6, ResKnife's template editor fully supports the following ResEdit field types:
- DBYT, DWRD, DLNG
- 1‐, 2‐ and 4‐byte big‐endien signed integer.
- FBYT, FWRD, FLNG
- 1‐, 2‐ and 4‐byte fillers.
- CHAR
- Single character. (MacRoman)
- TNAM
- Four character type code. (MacRoman)
- PSTR, ESTR, OSTR, WSTR, LSTR
- Pascal strings. (MacRoman)
- CSTR, ECST, OCST
- Null‐terminated C strings. (MacRoman)
- OCNT, ZCNT
- Counter for element lists (arrays).
- LSTB, LSTC, LSTZ, LSTE
- List begin, begin counted, and end.
In addition, there are about as many again Resorcerer‐only field types supported. Some further common field types are handled but displayed in an incorrect format (e.g. HWRD is displayed as DWRD). As the software develops these discrepencies will be eliminated. See below for a full enumeration.
In the end, we want to support at least all the field types Resorcerer supports. An exception may be made for field types that are deemed to be no longer interesting on MacOS X, and those types nobody is willing to implement.
Full list
The following tables provide a quick reference showing which resource edditors support white template field types.
In the tables below the three editors represented are ResEdit (2.1.3), Resourcerer (2.0) and ResKnife (0.6) respectivly.
A bullet denotes full support whereas an x indicates that a field type is recognised but not editable in its native format.
Decimal and Hex Integer Field Types
Type | Description | Size | Editors |
DBYT | Signed Decimal Byte | 1 byte | • | • | • |
DWRD | Signed Decimal Word | 2 bytes | • | • | • |
DLNG | Signed Decimal Long | 4 bytes | • | • | • |
DLLG | Signed Decimal Long Long | 8 bytes | - | - | • |
UBYT | Unsigned Decimal Byte | 1 byte | - | • | • |
UWRD | Unsigned Decimal Word | 2 bytes | - | • | • |
ULNG | Unsigned Decimal Long | 4 bytes | - | • | • |
ULLG | Unsigned Decimal Long Long | 8 bytes | - | - | • |
HBYT | Hex Byte | 1 byte | • | • | x |
HWRD | Hex Word | 2 bytes | • | • | x |
HLNG | Hex Long | 4 bytes | • | • | x |
HLLG | Hex Long Long | 8 bytes | - | - | x |
Bit and Bit Field Types
Type | Description | Size | Editors |
BBIT | Bit Within a Byte | 1 bit | • | • | - |
BBnn | Bit Field Within a Byte | nn bits | • | • | - |
WBIT | Bit Within a Word | 1 bit | - | • | - |
WBnn | Bit Field Within a Word | nn bits | - | • | - |
LBIT | Bit Within a Long | 1 bit | - | • | - |
LBnn | Bit Field Within a Long | nn bits | - | • | - |
BFLG | Byte Boolean Flag (low-order bit) | 1 byte | - | • | x |
WFLG | Word Boolean Flag (low-order bit) | 2 bytes | - | • | x |
LFLG | Long Boolean Flag (low-order bit) | 4 bytes | - | • | x |
Parsing proceeds from high-order bits first.
Miscellaneous Graphic and System Field Types
Type | Description | Size | Editors |
RSID | Signed Resource ID Integer | 2 bytes | - | • | • |
BOOL | Boolean Word * | 2 bytes | • | • | x |
CHAR | ASCII Character | 1 byte | • | • | • |
TNAM | Type Name | 4 bytes | • | • | • |
DATE | Macintosh System Date/Time (seconds) | 4 bytes | - | • | • |
MDAT | Modification Date/Time (seconds) | 4 bytes | - | • | • |
LLDT | Long Date/Time | 8 bytes | - | - | x |
SCPC | MacOS System Script Code | 2 bytes | - | • | x |
LNGC | MacOS System Language Code | 2 bytes | - | • | x |
RGNC | MacOS System Region Code | 2 bytes | - | • | x |
STYL | QuickDraw Font Style | 1 byte | - | - | x |
PNT | QuickDraw Point | 4 bytes | • | • | x |
RECT | QuickDraw Rectangle | 8 bytes | • | • | x |
COLR | QuickDraw Colour RGB Triplet | 6 bytes | - | • | - |
CLUT | Colour Lookup Table Hex Dump | variable | - | • | - |
CODE | 680x0 Disassembled Code Dump | variable | - | • | - |
* You can configure Resorcerer to use any 16-bit non-zero value when setting a BOOL field to true.
Floating and Fixed Point Field Types
Type | Description | Size | Editors |
REAL | Single Precision Float | 4 bytes | - | • | x |
DOUB | Double Precision Float | 8 bytes | - | • | x |
EXTN | Extended 80-bit SANE Float | 10 bytes | - | • | - |
XT96 | Extended 96-bit SANE Float | 12 bytes | - | • | - |
UNIV | THINK C Universal 96-bit Float | 12 bytes | - | • | - |
FIXD | 16:16 Fixed Point Number | 4 bytes | - | • | • |
FRAC | 2:30 Fixed Point Fraction | 4 bytes | - | • | • |
SFRC | 0:16 Fixed Point Small Fraction | 2 bytes | - | • | x |
FWID | 4:12 Fixed Point Font Width | 2 bytes | - | • | x |
FXYZ | 1:15 Fixed Point Colour Component | 2 bytes | - | • | x |
ASCII Text String Field Types
Type | Description | Bytes | Editors |
PSTR | Pascal String | 1 ... 256 | • | • | • |
ESTR | Even-Padded Pascal String | 2 ... 256 | • | • | • |
PPST | Even Pascal String (pad included) | 2 .... 256 | - | • | - |
OSTR | Pascal String Odd-Padded | 1 ... 255 | • | • | • |
CSTR | Null-Terminated C String | 1 or more | • | • | • |
ECST | Even-Padded C String | 2 or more | • | • | • |
OCST | C String Odd-Padded | 1 or more | • | • | • |
BSTR | Byte Length String (same as PSTR) | 1 ... 256 | - | • | • |
WSTR | Word Length String | 2 ... 65KB | • | • | • |
LSTR | Long Length String | 4 ... 4MB | • | • | • |
TXTS | Sized Text Dump | variable | - | • | - |
Pnnn | Pascal String with Fixed Padding * | $nnn bytes | • | • | - |
Wnnn | Word Pascal String with Fixed Padding | $nnn bytes | - | - | - |
Lnnn | Long Pascal String with Fixed Padding | $nnn bytes | - | - | - |
Cnnn | C String with Fixed Padding | $nnn bytes | • | • | - |
Tnnn | Text with Fixed Padding | $nnn bytes | - | • | - |
* In Resorcerer, this field type's behavior is configurable between ResEdit-style and Resorcerer's own style.
Hexadecimal Dump Field Types
Type | Description | Bytes | Editors |
BHEX | Byte Length Hex Dump | 1 ... 256 | - | • | - |
WHEX | Word Length Hex Dump | 2 ... 65KB | - | • | - |
LHEX | Long Length Hex Dump | 4 ... 4MB | - | • | - |
BSHX | Byte Length - 1 Hex Dump | 1 ... 255 | - | • | - |
WSHX | Word Length - 2 Hex Dump | 2 ... 65KB-2 | - | • | - |
LSHX | Long Length - 4 Hex Dump | 4 ... 4MB-4 | - | • | - |
Hnnn | Fixed-Length Hex Dump | $nnn | • | • | - |
HEXS | Sized Hex Dump | variable | - | • | - |
HEXD | Hex Dump * | variable | • | • | x |
* This field type's behavior is more general in Resorcerer than in ResEdit. Uneditable in ResKnife.
Skip Offset Field Types
Type | Description | Size | Editors |
BSKP | Offset to SKPE in Byte, inclusive | 1 byte | - | • | - |
WSKP | Offset to SKPE in Word, inclusive | 2 bytes | - | • | - |
LSKP | Offset to SKPE in Long, inclusive | 4 bytes | - | • | - |
BSIZ | Offset to SKPE in Byte, exclusive | 1 byte | - | • | - |
WSIZ | Offset to SKPE in Word, exclusive | 2 bytes | - | • | - |
LSIZ | Offset to SKPE in Long, exclusive | 4 bytes | - | • | - |
SKPE | End of Skip or Sizeof | 0 bytes | - | • | - |
Automatically computed.
Symbolic Constants and Comments
Type | Description | Size | Editors |
CASE | Symbolic and/or Default Value | 0 bytes | - | • | x |
CMNT | Comment | 0 bytes | - | - | x |
DVDR | Divider Line with Optional Comment | 0 bytes | - | • | x |
Counted Lists/Arrays
Type | Description | Size | Editors |
OCNT | (One-Based) Count of List Items | 2 bytes | • | • | • |
ZCNT | Zero-Based Count of List Items | 2 bytes | • | • | • |
BCNT | Byte Count of List Items | 1 byte | - | • | • |
BZCT | Zero-Based Byte Count of List Items | 1 byte | - | - | • |
WCNT | Word Count of List Items (same as OCNT) | 2 bytes | - | • | • |
WZCT | Zero-Based Word Count of List Items (same as ZCNT) | 2 bytes | - | - | • |
LCNT | Long Count of List Items | 4 bytes | - | • | • |
LZCT | Zero-Based Long Count of List Items | 4 bytes | - | • | • |
FCNT | Fixed Count of List Items | 0 bytes | - | • | - |
LSTC | Begin Counted List Item | 0 bytes | • | • | • |
LSTB | Begin Non-Counted List Item | 0 bytes | • | • | • |
LSTZ | Begin Non-Counted List Item, List Terminated by Zero Byte | 0 bytes | • | • | • |
LSTS | Begin Sized List Item | 0 bytes | - | • | - |
LSTE | End of List Item | 0 or 1 bytes | • | • | • |
SELF | List Item is Entire TMPL | variable | - | • | - |
Key Values for Subsequent Variant Items
Type | Description | Size | Editors |
KBYT | Signed Decimal Byte Key | 1 byte | - | • | x |
KWRD | Signed Decimal Word Key | 2 bytes | - | • | x |
KLNG | Signed Decimal Long Key | 4 bytes | - | • | x |
KLLG | Signed Decimal Long Long Key | 8 bytes | - | - | x |
KUBT | Unsigned Decimal Byte Key | 1 byte | - | • | x |
KUWD | Unsigned Decimal Word Key | 2 bytes | - | • | x |
KULG | Unsigned Decimal Long Key | 4 bytes | - | • | x |
KULL | Unsigned Decimal Long Long Key | 8 bytes | - | - | x |
KHBT | Hex Byte Key | 1 byte | - | • | x |
KHWD | Hex Word Key | 2 bytes | - | • | x |
KHLG | Hex Long Key | 4 bytes | - | • | x |
KHLL | Hex Long Long Key | 8 bytes | - | - | x |
KCHR | Single ASCII Character Key | 1 byte | - | • | x |
KTYP | Four-Character Type Key | 4 bytes | - | • | x |
KRID | Key on Current Resource ID | 0 bytes | - | • | x |
KIDX | Key on List Index # (Zero-based) | 0 bytes | - | - | x |
KEYB | Begin Keyed Item for Previous CASE | 0 bytes | - | • | - |
KEYE | End of Keyed Item | 0 bytes | - | • | - |
Alignment Field Types
Type | Description | Bytes | Editors |
AWRD | Align to 2-byte boundary | 0 or 1 | • | • | - |
ALNG | Align to 4-byte boundary | 0 ... 3 | • | • | - |
AL08 | Align to 8-byte boundary | 0 ... 7 | - | • | - |
AL16 | Align to 16-byte boundary | 0 ... 15 | - | • | - |
Annn | Align to byte boundary | 0 ... $nnn | - | - | - |
Uneditable.
Filler Field Types
Type | Description | Size | Editors |
FBYT | Fill Byte | 1 byte | • | • | • |
FWRD | Fill Word | 2 bytes | • | • | • |
FLNG | Fill Long | 4 bytes | • | • | • |
Fnnn | Fill Bytes | $nnn bytes | - | • | - |
Uneditable.
Inserting New Data Fields in Existing Resources
Type | Description | Bytes | Editors |
+BYT | Insert a Byte When Opening | 1 | - | • | - |
+WRD | Insert a Word When Opening | 2 | - | • | - |
+LNG | Insert a Long When Opening | 4 | - | • | - |
+nnn | Insert Bytes When Opening | $nnn | - | • | - |
+PST | Insert a Pascal String When Opening | 1 ... 256 | - | • | - |
+EST | Insert an Even Pascal String When Opening | 2 ... 256 | - | • | - |
+CST | Insert a C String When Opening | 1 or more | - | • | - |
Deleting Old Data Fields from Existing Resources
Type | Description | Bytes | Editors |
-BYT | Delete a Byte When Closing | 1 | - | • | - |
-WRD | Delete a Word When Closing | 2 | - | • | - |
-LNG | Delete a Long When Closing | 4 | - | • | - |
-nnn | Delete Bytes When Closing | $nnn | - | • | - |
-PST | Delete a Pascal String When Closing | 1 ... 256 | - | • | - |
-EST | Delete an Even Pascal String When Closing | 2 ... 256 | - | • | - |
-CST | Delete a C String When Closing | 1 or more | - | • | - |
Big and Little-Endian Parsing
Type | Description | Size | Editors |
BNDN | Use Big-Endian Data Parsing | 0 | - | • | - |
LNDN | Use Little-Endian Data Parsing | 0 | - | • | - |
Pre- and Post-Processing Data with Code Filters
Type | Description | Size | Editors |
FLTR | Declare Filtered Template (with comment) | 0 | - | • | - |
Common Template Mistakes
Here's a list of simplifications or improvements one can make to existing templates.
- Use correct type where available, e.g. RGNC for RegionCodes instead of a DWRD.
- Use fillers (FWRD etc) for ‘Reserved’ values. Labels are optional.
- PSTR followed by AWRD: Use ESTR instead.