derez(1) derez(1)NAME derez - decompiles a resource file SYNOPSIS derez [-c] [-dmacro-assignment]... [-e] [-iinclude-dir]... [-mstring-size] [-p] [-rd] [-umacro]... resource-file [resource-description-file]... derez [-c] -oscope [-dmacro-assignment]... [-e] [-iinclude-dir]... [-mstring-size] [-p] [-rd] [-umacro]... resource-file [resource-description-file]... derez [-c] -somit-scope [-dmacro-assignment]... [-e] [-iinclude-dir]... [-mstring-size] [-p] [-rd] [-umacro]... resource-file [resource-description-file]... ARGUMENTS -c[ompatible] Generates output that is backward-compatible with rez 1.0. -d[efine]macro-assignment Declares preprocessor macros in the form name=value that are equivalent to symbolic constants defined with #define macro [value] If no value is assigned, but a symbolic name is given, its value is set to the empty string (which still qualifies it as a ``defined'' macro). -e[scape] Does not honor escape sequences that are normally honored (such as \0xff); prints these characters as extended Macintosh characters instead. Not all characters are defined in all fonts. Normally, characters with values between 0x20 and 0xD8 are printed as Macintosh characters. When you specify the -e option, however, all characters (except null, newline, tab, backspace, form feed, vertical tab, and rubout) are printed as characters, not as escape sequences. -iinclude-dir Searches the specified directories for any #include instructions inside the resource description file or files. The paths are searched in the order of their appearance on the command line. To decompile an A/UX Toolbox resource file, use this command: January 1992 1
derez(1) derez(1)-i /:mac:lib:rincludes -m[axstringsize]string-size Sets the maximum string size to string-size, which must be in the range 2-120. Use this option to set the maximum width of strings in the output. -o[nly]scope Decompiles resources that fall within the scope specified only. See the description of scope later in this list. This option cannot be used if the -s option is used. -p Displays progress and version information. -rd Suppresses warning messages if a resource type is redeclared. resource-description-file Specifies files containing the (source code) type declarations used to produce the resource file. resource-file Specifies the name of the file containing the compiled resource. You must specify a resource file; derez does not read the standard input. scope omit-scope Declare the scope of resources to be either decompiled or skipped depending on whether the -o or the -s option is specified. (See the description of -o and -s earlier in this list.) The scope can be specified in several ways: resource-type Limits the scope to the specified resource type, such as `CODE'. "'resource-type'(id1)" Limits the scope to a resource type and resource ID number. "'resource-type'(id1:id2)" Limits the scope to a resource type and a range of resource ID numbers. "'resource-type'resource-name" Limits the scope to a particular resource name of a particular resource type. -s[kip]scope Skips the decompilation of resources that fall within 2 January 1992
derez(1) derez(1)the scope specified. See the descriptions of scope and omit-scope later in this list. This option cannot be used if the -o option is used. For example, you can save execution time by skipping CODE resources. You can repeat the -s option any number of times. -u[ndef]macro Undefines the macro variable macro. You can do the same thing by writing this at the beginning of the input file: #undef macro 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 description is written to standard output. If the output of derez is used as input to rez along with the same resource description files, it produces the same resource file that was originally input to derez. To help generate resource code, certain basic data-type information is read from the files you specify as the resource description file or files. The type declarations in these resource description files should consist of resource and data statements just like those that can be understood by the rez program. The derez command ignores all include (but not #include), read, data, and resource statements found in the resource description file. (It still parses these statements for correct syntax.) Appendix C, ``Resource Compiler and Decompiler,'' in A/UX Toolbox: Macintosh ROM Interface, describes the format of resource type declarations. 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 derez command is not guaranteed to be able to run a declaration backward. If derez does not run a declaration backward, the command produces a data statement instead of the appropriate resource statement. January 1992 3
derez(1) derez(1)EXAMPLES Using the definitions in the file /mac/lib/rincludes/types.r, this command decompiles the resource file %sample and writes the output to the file sample.r: derez -i /mac/lib/rincludes sample types.r > sample.r You do not need to use quotation marks to specify a literal type as long as that type starts with a letter. Do not use escape characters or other special characters. This example specifies the type `MENU': derez -only MENU ... If a resource ID, range of IDs, or resource name is given, the entire option parameter must appear inside single quotation marks, as in this example: derez -only "'MENU'(1:128)" If derez has access to the type definitions, it generates more meaningful output. For example, this command displays all of the `MENU' resources in %sample, and the type definition for `MENU' resources is in the file types.r: derez -o MENU -i /mac/lib/rincludes sample types.r STATUS MESSAGES AND VALUES If no errors or warnings are detected, derez runs silently. Errors and warnings are written to standard error output. (See intro(3S) in A/UX Programmer's Reference.) The derez command returns one of these status values: 0 No errors 1 Error in parameters 2 Syntax error in file 3 I/O or program error LIMITATIONS The derez command is not supported in 24-bit mode; you can use it only in 32-bit mode. You must run it from the command line while you are logged in to the Macintosh environment. 4 January 1992
derez(1) derez(1)FILES /mac/bin/derez Executable file SEE ALSO rez(1) intro(3s) in A/UX Programmer's Reference A/UX Toolbox: Macintosh ROM Interface January 1992 5