Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ derez(1) — A/UX 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought




derez(1) derez(1)
NAME derez - decompile a resource file SYNOPSIS derez [option]... resource-file [resource-description- file]... DESCRIPTION derez creates a text representation (resource description) of a compiled resource file according to the resource type declarations in the resource-description-files. The resource-file parameter specifies the name of the file containing the compiled resources. You must specify a resource file; derez never reads the standard input. The resource-description-file parameter specifies one or more files containing the type declarations used by the resource file. derez can provide meaningful output only if you provide the type declarations. The type declarations in the resource description file fol- low the same format as that used by the resource compiler, rez. The type declarations for standard Macintosh resources are contained in the files types.r and systypes.r in the directory /mac/lib/rincludes. If you do not specify a resource description file, the output consists of data statements giving the resource data in hexadecimal form, without any additional format information. The resource description is written to standard output. If the output of derez is used as input to rez with the same resource description files, it produces the same resource file that was originally input to derez. derez is not guaranteed to be able to run a declaration backward: if it can't, it produces a data statement instead of the appropri- ate resource statement. derez ignores all include (but not #include), read, data, and resource statements found in the resource-description- file. (It still parses these statements for correct syn- tax.) Appendix C in the A/UX Toolbox: Macintosh ROM Inter- face, ``Resource Compiler and Decompiler,'' describes the format of resource type declarations. The resource description consists of resource and data statements that can be understood by rez. If no errors or warnings are detected, derez runs silently. Errors and warnings are written to standard error (see intro(3S) in A/UX Programmer's Reference). April, 1990 1



derez(1) derez(1)
derez returns one of the following status values. 0 No errors 1 Error in parameters 2 Syntax error in file 3 I/O or program error You may specify one or more of the following options. -c[ompatible] Generate output that is backward-compatible with rez 1.0. -d[efine]macro[=data] Define the macro variable macro to include the value data. If data is omitted, then macro is set to the null string (note that this still means that macro is defined). The -d flag option is the same as writing #define macro [data] at the beginning of the input. The -d flag option may be repeated any number of times. -e[scape] Do not escape characters that are normally escaped (such as: \0xff). Instead, print these characters as extended Macintosh characters. Note that not all fonts have defined all the characters. Normally, characters with values between 0x20 and 0xD8 are printed as Macintosh characters. With the -e op- tion, however, all characters (except null, newline, tab, backspace, form feed, vertical tab, and rubout) are printed as characters, not as escape sequences. -ipathname(s) Search the specified directories for include files. You may specify more than one pathname. The paths are searched in the order they appear on the command line. To decompile an A/UX Toolbox resource file, use this pathname: /:mac:lib:rincludes -m[axstringsize] n Set the maximum string size to n; n must be in the 2 April, 1990



derez(1) derez(1)
range 2-120. This setting controls how wide the strings can be in the output. -o[nly] type-expr[(ID1[:ID2])] -o[nly] type-expr[resourceName] Read only resources of resource type type-expr. If an ID, range of IDs, or resource name is given, read only those resources for the given type. This option may be repeated. Note: type-expr is an expression, so straight quotes (') might be needed. If an ID, range of IDs, or name is given, the entire option parame- ter must be quoted. For example, derez -only "'MENU'(1:128)" ... See also the EXAMPLES later in this section. Note: The -only flag option cannot be specified together with the -skip flag option. -o[nly] type Read only resources of the specified type. This is a simpler version of the above option. No quotes are needed to specify a literal type as long as it starts with a letter. Do not use escape characters or other special characters. For example, derez -only MENU ... -p Display progress and version information. -rd Suppress warning messages if a resource type is rede- clared. -s[kip] type-expr [(ID1[:ID2])] -s[kip] type-expr [resourceName] Skip resources of type type-expr in the resource file. For example, you can save execution time by skipping CODE resources. The -s option may be repeated any number of times. Note: type-expr is an expression, so straight quotes (') might be needed. If an ID, range of IDs, or name is given, the entire option parame- ter must be quoted. See the note under - only type-expr earlier in this section. April, 1990 3



derez(1) derez(1)
-s[kip] type Skip resources of the specified type. This is a simpler version of the -s option. No quotes are needed to specify a literal as long as it starts with a letter. -u[ndef] macro Undefine the macro variable macro. This is the same as writing #undef macro at the beginning of the input file. (See Appendix C in A/UX Toolbox: Macintosh ROM Interface for a description of macro variables.) It is meaningful to undefine only the preset macro variables. This option may be repeat- ed. EXAMPLES The command derez -i /:mac:lib:rincludes sample types.r > sample.r decompiles the resource file %sample, using the definitions in the file /mac/lib/rincludes/types.r and writes the output to the file sample.r. If it has access to the type defini- tions, derez generates more meaningful output. derez -o MENU -i /:mac:lib:rincludes sample types.r displays all of the MENU resources in %sample. The type de- finition for MENU resources is in the file types.r. FILES /mac/bin/derez SEE ALSO A/UX Toolbox: Macintosh ROM Interface. NOTES This command is not supported in 24-bit mode and must be run from the command line while logged into the Macintosh en- vironment with the 32-bit session type. 4 April, 1990

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026