Rez.1   [plain text]


.TH REZ 1 "July 25, 2000" "Mac OS X"
.na
.nh
.SH NAME
Rez
\- compiles resources
.SH SYNOPSIS
.B Rez 
[
.I rezFile1
] [
.I rezFile2
] ...
.br
[
.B \-align word
|
.B longword
]
[
.B \-a\fR[\fBppend\fR]
]
.br
[
.B \-c\fR[\fBreator\fR]
.I creatorExpr
]
[
.B \-d\fR[\fBefine\fR]
.I macro
[ =
.I data
] ] 
.br
[
.B \-i
.I directoryPath 
]
[
.B \-m\fR[\fBodification\fR]
]
.br
[
.B \-noResolve
[
.B output
|
.B include
] ] 
[
.B \-o
.I outputFile
] 
.br
[
.B \-ov
] 
[
.B \-p\fR[\fBrogress\fR]
] [
.B \-rd
] [
.B \-ro
] 
.br
[
.B \-s
.I directoryPath
]
.br
[
.B \-script Roman
|
.B Japanese
|
.B Korean
|
.br
.B \ \ \ SimpChinese
|
.B TradChinese
] 
.br
[
.B \-t\fR[\fBype\fR]
.I typeExpr
] [
.B \-u\fR[\fBndef\fR]
.I macro
]
.br
[
.B -useDF
]
.SH DESCRIPTION
The
.B Rez
tool compiles the resource fork of a file according to the textual
description contained in the resource description files. These resource
description files must contain both the type declarations and the resource
definitions needed to compile the resources. This data can come directly
from the resource description files, as in this example:
.PP
Rez SysTypes.r Types.r myResource.r 
.PP
The data can also come from other text files that are included in resource
description files using 
.B #include
and
.B read
directives. For example,
.B myResource.r
could use
.B #include
to include the files
.B SysTypes.r
and
.B Types.r.
.SH INPUT
Standard input, unless you specify one or more resource description files. For all input files on the command line, the following search rules are applied:
.PP
.PD 0
.IP 1. 3
The
.B Rez
tool tries to open the file with the name specified as is.
.IP 2. 3
If the first rule fails and the filename contains no colons or begins with a colon, 
.B Rez 
appends the filename to each of the pathnames specified by the 
.B {RIncludes} 
variable and tries to open the file.
.PD
.SH OUTPUT
Normally 
.B Rez 
writes the resource fork to the file 
.B Rez.out\fR.
You can specify a different output file by using the 
\.B -o
option. Errors and warnings are written to diagnostic output. The
.B Rez
tool does not write to standard output.
.SH ALIAS RESOLUTION
This command resolves Finder aliases in all input and output file specifications. This includes input source files, listing files, output object files, paths specified with the
.B -i
and
.B -s
options, and paths specified within source code using
.B INCLUDE
or
.B #include 
statements. This behavior may be changed for resource files by using the 
.B -noResolve 
option.
.SH STATUS
.B Rez 
can return the following status codes:
.PP
.PD 0
.TP 3
.B 0 
no errors
.TP 3
.B 1
error in parameters
.TP 3
.B 2
syntax error in resource description file
.TP 3
.B 3
I/O or program error
.PD
.PP
.B Note
.br
If any errors are detected, 
.B Rez
sets the output filešs modification date to 
.B 0,
which is January 1, 1904, 12:00
.SM A.M.
.SH PARAMETERS
.TP
\fIrezFile1\fR [ \fIrezFile2\fR ] ...
Specifies one or more resource description files that contain type declarations and resource definitions. Typically this pairs a file containing only resource definitions with another containing only type declarations. The type declarations for the standard Macintosh resources are contained in the 
.B Types.r 
and 
.B SysTypes.r 
files, contained in the 
.B {RIncludes} 
folder. 
.IP
You can also specify resource description files by using 
.B #include. 
For example, a file containing only resource definitions could include those containing the appropriate type declarations (for example, 
.B myResource.r 
could include 
.B Types.r\fR). 
In addition, you can also include resource files that have already been compiled by 
.B Rez. To do this, you use the 
.B include 
directive.
.IP
The 
.B -script 
option enables 
.B Rez 
to correctly process the 2- byte character sets for foreign-language script systems.
.SH OPTIONS
.TP 
\fB-align word \fR|\fB longword
Aligns resources along word or longword boundaries. This allows the Resource Manager to load these resources faster. The 
.B Rez 
tool ignores this option if you use \fB-a\fR[\fBppend\fR].
.TP
\fB-a\fR[\fBppend\fR]
Appends new resources to the output file rather than replacing the output file.
.IP
.B Note
.br
The 
.B Rez 
tool cannot append resources to a resource file that has its read-only bit set. It also cannot replace a resource that has its protected bit set unless you specify 
.B-ov.
.IP
.B WARNING
.br
The 
.B Rez 
tool overwrites any existing resource of the same type and ID without any warning message. In addition, it is not recommended that you append a resource directly to a running System file. 
.TP
\fB-c\fR[\fBreator\fR] \fIcreatorExpr\fR
Sets the output file creator. (The default value is '????'.) Note that 
.I creatorExpr 
is a Rez expression such as
.IP
-c "3*200+5"
.IP
If the creator begins with a letter and does not contain any spaces or special characters, you can simply type it in, as in this example:
.IP
-c APPL
.IP
Otherwise, you must format the creator as a numeric expression or as a literal expression such as
.IP
-c " '@@@@' "
.TP
\fB-d\fR[\fBefine\fR] \fImacro\fR  [= \fIdata\fR ]
Defines the macro variable 
.I macro 
as having the value 
.I data\fR. 
You can use this option more than once on a command line.
.RS
.IP \fImacro\fR
Specifies the macro variable to be defined. 
.IP \fIdata\fR
Specifies the value of macro. This is the same as writing
.IP
#define \fImacro\fR [\fIdata\fR] 
.IP
at the beginning of the input.
.IP
If you do not specify 
.I data\fR, 
.B Rez 
sets the value of 
.I data 
to the null string. Note that this still defines the macro.
.RE
.TP 
\fB-i \fIdirectoryPath\fR
Directs 
.B Rez 
to search this directory for
.B #include 
files. You can specify this option more than once. The 
.B Rez 
tool searches directories in the order in which they appear on the command line. 	
.TP
\fB-m\fR[\fBodification\fR]
Does not change the output filešs modification date. If an error occurs, the output filešs modification date is set to zero, even if you use this option. A date of 0 means January 1, 1904, 12:00 
.SM A.M.
.TP
\fB-noResolve \fR[\fBoutput\fR|\fBinclude\fR]
Overrides the default alias resolution behavior by not resolving leaf aliases in the output resource file specification or in any included resource input files.
.RS
.IP \fBoutput\fR
If 
.B output 
is specified, 
.B Rez 
overrides the default Finder alias resolution behavior by not resolving leaf aliases in the output resource file specification. This allows you to modify a Finder alias file directly.
.IP \fBinclude\fR
If 
.B include 
is specified with 
.B -noResolve 
then 
.B Rez 
overrides the default Finder alias resolution behavior by not resolving leaf aliases in any included resource input files. This allows you to 
.B include 
resources directly from Finder alias files.
.RE
.TP
\fB-o\fR \fIoutputFile\fR 
Places output in the specified output file. The default output file is 
.B Rez.out\fR.
.TP
.B -ov
Overrides the protected bit when replacing resources with \fB-a\fR[\fBppend\fR].
.TP
\fB-p\fR[\fBrogress\fR]
Writes version and progress information to diagnostic output.
.TP
.B -rd
Suppresses warning messages for redeclared resource types.
.TP 
.B -ro 
Sets the 
.B mapReadOnly 
flag in the resource map. 
.TP 
\fB-s \fIdirectoryPath\fR
Directs 
.B Rez 
to search this directory for resource 
.B include 
files. You can specify this option more than once. The 
.B Rez 
tool searches directories in the order in which they appear on the command line.
.TP
\fB-script Roman \fR|\fB Japanese \fR|\fB Korean \fR|\fB SimpChinese \fR|\fB TradChinese\fR
Enables the recognition of any of several 2-byte character script systems to use when compiling and decompiling files. This option insures that 2-byte characters in strings are handled as indivisible entities. The default language is 
.B Roman 
and specifies 1-byte character sets.
.TP
\fB-t\fR[\fBype\fR]\fB \fItypeExpr\fR
Sets the type of the output file (the default is 'APPL'). Note that 
.I typeExpr 
is a 
.B Rez 
expression, such as
.IP
-t "3*200+5"
.IP
If the type begins with a letter and does not contain any spaces or special characters, you can simply type it in, as in this example:
.IP
-t MPST
.IP
Otherwise, you must format it as a numeric expression or literal expression, such as
.IP
-t " '@@@@' "
.TP
\fB-u\fR[\fBndef\fR] \fImacro
Undefines the preset macro variable 
.Imacro\fR. 
This is the same as writing
.IP
#undef 
.I macro 
.IP
at the beginning of the input. This option can be repeated more than once on a command line.
.TP
.B -useDF
Reads and writes resouce information from the files' data forks, instead of their resource forks.
.SH EXAMPLES
The following command line generates a resource fork for the file 
.B Sample\fR, 
based on the type declarations and resource definitions in 
.B Types.r 
and 
.B Sample.r\fR:
.PP
Rez Types.r Sample.r -o Sample
.SH SEE ALSO
.B DeRez
.br
Standard resource type declarations in the 
.B {RIncludes} 
directory.