rc(1)

NAME
rc - Windows resource compiler

SYNOPSIS
rc [ -an ] [ -b ] [ -Dval ] [ -eendian ] [ -h ] [ -Ipath ] [ -i ] [ -l ] [ -ntable ] [ -ofile ] [ -Ukeyword ] [ -v ] [ -V ] [ -? ] [ --align=n ] [ --big-endian ] [ --define=val ] [ --endian=endian ] [ --include-path=path ] [ --little-endian ] [ --table-name=table ] [ --output-file=file ] [ --undefine=keyword ] [ --verbose ] [ --version ] [ --help ] SourceFile

DESCRIPTION
rc compiles a Windows resource file into a C source file. rc includes its own C preprocessor, as a replacement for cpp(1). This preprocessor can be controlled with the -D, -I, and -U switches; see the OPTIONS section below for details. rc is typically used within a TWIN makefile to compile the Windows resources, such as dialog boxes, menus, and icons, associated with a Windows application. The C source file produced by rc is compiled and linked with the executable to provide resource functionality to the application. In a project using the makefile.inc include file provided in the TWIN distribution, rc is automatically run by make(1) if the resource variable is set to the basename of the resource script in the makefile.

OPTIONS
TWIN rc supports both standard, single-character options and GNU-style long options.

-an, --align=n
    Set byte-alignment for RCDATA and user-defined resources. n can be the integer values 1, 2, or 4, for byte-alignment, word-alignment, and doubleword-alignment, respectively. -as (short alignment) is a synonym for -a2 ; -al (long alignment) is a synonym for -a4.

-b, --big-endian
    Use big-endian format for the output of integers in RCDATA and user-defined resources.

-Dval, --define=val
    Define the symbol val. If val is of the form keyword=val, define keyword to have the value val.

-eendian, --endian=endian
    Use endian-endian format for the output of integers in RCDATA and user-defined resources, where endian is either big or little.

-Ipath, --include-path=path
    Add path to the include directory search path. This path is searched for files specified in #include directives and for files referenced in resource statements.

-i, -l, --little-endian
    Use little-endian format for the output of integers in RCDATA and user-defined resources.

-ntable, --table-name=table
    Set the table name to be used for the resources. See Resource files in DLLs below.

-ofile, --output-file-name=file
    Set the output resource source file name. By default the name is the input file name with the .rc extension replaced by .res.c. The compiled file will have a .res.o extension.

-Ukeyword, --undefine=keyword
    Undefine the symbol keyword, if it was previously defined.

-v, --verbose
    Produce verbose output. This option will output status information as the resource compiler is executing.

-V, --version
    Display the version number of TWIN rc.

-h, -?, --help
    Display a summary of options.

FILES
rc uses the following files:

*.rc
    Input resource file

*.res.c
    Output C file

windows.h
    Include file containing standard constant definitions

RESOURCE FILE EXTENSIONS
Willows rc supports several extensions to the standard Microsoft resource file definition. These are used for Unix-specific considerations and the inclusion of multiple resource scripts in the same project.

  User-data resources
User-data resources are specified by RCDATA statements in the resource file, and by external type names. rc supports two extensions to the standard format, which can also be controlled from the command line. The ALIGN statement allows a specific user-defined resource to be aligned to a specific boundary. ALIGN 1 forces integers to be byte-aligned (the default, unless the -a switch is given). ALIGN 2 or ALIGN short forces integers to be word-aligned (the same as the -a2 or -as command-line switches); ALIGN 4 or ALIGN long forces integers to be doubleword-aligned (equivalent to the -a4 or -al switches). The ENDIAN statement controls the output format of integers. ENDIAN little (or -l, -i, or --endian=little from the command line) forces integers to be in little-endian format, with the least-significant byte coming first in the output file. ENDIAN big (or --endian=big or -b) causes integers to be output in big-endian format, placing the most-significant byte first. These statements come after the RCDATA declaration but before the data definition:
    "foo" RCDATA ALIGN short ENDIAN little { 0x04, 0x0d }

  Resource files in DLLs
TWIN expects each module's resource script to have a different internal name. Applications should have the table name "appl", the default. Windows Dynamic Link Libraries (DLLs) or TWIN shared-object DLLs should have the table name be the same as that of the library. This can be done from the command line with the -nname or --table-name=name switches, or by placing the TABLENAME name directive in the resource script, where name is the name of the library. More generally, the -n and --table-name switches and the TABLENAME directive can be used to give a resource script any internal name, possibly to use more than one resource file in the same project. The table name must also be changed in the command line to the module-definition compiler, mdc, using the -r switch. TABLENAME can appear anywhere in a resource script outside of a resource definition:
    #include <windows.h> TABLENAME table DIALOG ...

SEE ALSO
Willows Toolkit Getting Started Guide, mdc(1)

BUGS
The internal preprocessor does not properly handle parameterized macros. Constructs such as #define LOWORD(x) ((x)&0xFFFF) are not properly expanded. Such a statement, if encountered in a header file, will be recognized and processed, but the macro expansion will cause an error. Segment-load flags on individual string-table resources are ignored. The last specified set of flags applies to all string-table resources. Many platforms have preprocessor-specific directives. CodeWarrior on the Macintosh has a __option macro; HP/UX supports a #ident directive. The former will cause a parse error, while the latter will cause an "unknown preprocessor directive" error. These problems can be avoided by enclosing all system header include files in an #ifndef RC_INVOKED block. Error reporting is spotty at best.