WRC(1)

πŸ‘‘ WRC(1) β€” Wine Developers Manual πŸ’…

okay bestie, sit down, hydrate, because we're about to talk about wrc, the Wine Resource Compiler β€” straight outta the Wine Developers Manual and honestly? iconic. πŸŽ€


✨ SYNOPSIS ✨

wrc [options] [inputfile...]

🌸 DESCRIPTION 🌸

So wrc takes resources from inputfile and compiles them into win16 and win32 compatible binary format. That's the whole vibe. πŸ’–

Before any of the actual compiling happens, the source file gets run through a builtin ANSI-C compatible preprocessor. Peep the PREPROCESSOR section below for the tea. β˜•

wrc takes a whole series of inputfile as arguments, like a little stack of snacks πŸ“. If you give it none? It reads from standard input. And if you didn't pick an output file with -o, then wrc writes the output to inputfile.res with .rc stripped off, or to wrc.tab.res if there was no inputfile at all. no cap.


πŸ’… OPTIONS πŸ’…

  • -D, --define=id[=val] β€” Define preprocessor identifier id to (optionally) the value val. Scroll down to PREPROCESSOR for more, bestie.
  • --debug=nn β€” Set debug level to nn. It's a bitmask, so you stack these bad boys up like friendship bracelets 🫢: 1=verbose, 2=dump internals, 4=resource parser trace, 8=preprocessor messages, 16=preprocessor scanner and 32=preprocessor parser trace.
  • -E β€” Preprocess only. Output goes to standard output if you didn't select an outputfile. And the output is compatible with what gcc would generate. slay πŸ”₯
  • -h, --help β€” Prints a summary message and exits. the polite little exit. πŸ‘‹
  • -i, --input=file β€” The name of the input file. If you don't use this option, wrc just grabs the first non-option argument as the input file name. And if there are no non-option arguments at all? It reads from standard input. ✨
  • -I, --include-dir=path β€” Add path to the list of directories to search for includes. You can pass -I multiple times, no limit bestie. Include files are searched in the order in which the -I options were specified. The search is compatible with gcc, where '<>' quoted filenames are searched exclusively via the -I set path, whereas '""' quoted filenames are first tried to be opened in the current directory. And resource statements with file references are located in the same way too. πŸ’œ
  • -J, --input-format=format β€” Sets the input format. The valid options are 'rc' or 'rc16'. Setting the input to 'rc16' disables the recognition of win32 keywords. important!! 😭
  • -l, --language=lang β€” Set default language to lang. The default is the neutral language 0 (i.e. "LANGUAGE 0, 0"). πŸ’–
  • -m16, -m32, -m64 β€” Generate resources for 16-bit, 32-bit or 64-bit platforms respectively. And the only difference between 32-bit and 64-bit is whether the _WIN64 preprocessor symbol is defined. that's it, that's the whole difference. ✨
  • --nls-dir=dir β€” Specify the directory to search for the NLS files containing the codepage mapping tables. 🌈
  • --nostdinc β€” Do not search the standard include path. Look for include files only in the directories you explicitly specified with the -I option. no shortcuts. πŸ‘‘
  • --no-use-temp-file β€” Ignored, for compatibility with windres. πŸ«₯
  • -o, -fo, --output=file β€” Write output to file. Default is inputfile.res with .rc stripped, or wrc.tab.res if input is read from standard input. 🌸
  • -O, --output-format=format β€” Sets the output format. The supported formats are po, pot, res, and res16. If you don't specify this option, the format defaults to res. In po mode, if an output file name is specified it must match a known language name, like en_US.po β€” only resources for the specified language are output. If no output file name is specified, a separate .po file is created for every language encountered in the input. multi-language moment πŸ’…
  • --pedantic β€” Enable pedantic warnings. Notably, redefinition of #define statements can be discovered with this option. the gossip detector. πŸ‘€
  • --po-dir=dir β€” Enable the generation of resource translations based on mo files loaded from the specified dir. That directory must follow the gettext convention β€” in particular it must contain one .mo file for each language, and a LINGUAS file listing the available languages. no getting around it bestie. πŸŽ€
  • -r β€” Ignored, for compatibility with rc. πŸ«₯
  • --preprocessor=program β€” Use this to specify the preprocessor to use, including any leading arguments. If not specified, wrc uses its builtin processor. And to disable preprocessing entirely, use --preprocessor=cat. 😌
  • --sysroot=dir β€” Prefix the standard include paths with dir. ✨
  • --utf8, -u β€” Set the default codepage of the input file to UTF-8. πŸ’–
  • -U, --undefine=id β€” Undefine preprocessor identifier id. ⚠️ Please note that only macros defined up to this point are undefined by this command. However, these include the special macros defined automatically by wrc. See PREPROCESSOR below, bestie.
  • --use-temp-file β€” Ignored, for compatibility with windres. πŸ«₯
  • -v, --verbose β€” Turns on verbose mode (equivalent to -d 1). πŸ—£οΈ
  • --version β€” Print version and exit. πŸ“Œ

🧚 PREPROCESSOR 🧚

The preprocessor is ANSI-C compatible with some of the extensions of the gcc preprocessor. periodt.

The preprocessor recognizes these directives: #include, #define (both simple and macro), #undef, #if, #ifdef, #ifndef, #elif, #else, #endif, #error, #warning, #line, # (both null- and line-directive), #pragma (ignored), #ident (ignored). that's the full list, don't come for me. πŸ’…

The preprocessor sets by default several defines:

  • RC_INVOKED β€” set to 1
  • __WRC__ β€” Major version of wrc
  • __WRC_MINOR__ β€” Minor version of wrc
  • __WRC_PATCHLEVEL__ β€” Patch level

Win32 compilation mode also sets _WIN32 to 1. πŸ”₯

Special macros __FILE__, __LINE__, __TIME__ and __DATE__ are also recognized and expand to their respective equivalent. iconic behavior fr fr. πŸ¦‹


🌈 LANGUAGE SUPPORT 🌈

Language, version and characteristics can be bound to all resource types that have inline data, such as RCDATA. This is an extension to Microsoft's resource compiler, which lacks this support completely. we're just better. πŸ’…

Only VERSIONINFO cannot have version and characteristics attached, but languages are propagated properly if you declare it correctly before the VERSIONINFO resource starts. πŸ’–

Example:

1 RCDATA DISCARDABLE
LANGUAGE 1, 0
VERSION 312
CHARACTERISTICS 876
{
     1, 2, 3, 4, 5, "and whatever more data you want"
     '00 01 02 03 04 05 06 07 08'
}

πŸ‘‘ AUTHORS πŸ‘‘

wrc was written by Bertho A. Stultiens and is a nearly complete rewrite of the first wine resource compiler (1994) by Martin von Loewis.

Additional resource types were contributed by Ulrich Czekalla and Albert den Haan. Many cleanups by Dimitrie O. Paun in 2002-2003. Bugfixes have been contributed by many Wine developers. give them their flowers, all of them. 🌸


πŸ’€ BUGS πŸ’€

ngl, there's some stuff to know:

  • The preprocessor recognizes variable argument macros, but does not expand them correctly. 😭
  • Error reporting should be more precise, as currently the column and line number reported are those of the next token.
  • Default memory options should differ between win16 and win32.

There is no support for:

  • RT_DLGINCLUDE, RT_VXD, RT_PLUGPLAY and RT_HTML (unknown format)
  • PUSHBOX control is unsupported due to lack of original functionality.

Fonts are parsed and generated, but there is no support for the generation of the FONTDIR yet. The user must supply the FONTDIR resource in the source to match the FONT resources. don't forget bestie!! πŸ™ˆ

Bugs can be reported on the Wine bug tracker.


⭐ AVAILABILITY ⭐

wrc is part of the Wine distribution, which is available through WineHQ, the Wine development headquarters. 🌈


🫢 SEE ALSO 🫢

  • wine(1),
  • Wine documentation and support.

okay and that's the whole page, bestie!! πŸŽ€ this was Wine 11.20, dated October 2005 β€” yeah she's an elder icon but she still ate and left no crumbs. πŸ’–βœ¨πŸ‘‘πŸ’…

πŸ“¦ where this page comes from