home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
shroud.zip
/
SHROUD.MAN
< prev
next >
Wrap
Text File
|
1990-01-14
|
5KB
|
119 lines
SHROUD (1) SHROUD (1)
NAME
SHROUD - ANSI-conforming C language source code shrouder Version 2
SYNOPSIS
shroud [ option ] file [ file ] ...
DESCRIPTION
shroud copies the input [ files ] to standard output, expanding C
language macros and executing C language preprocessor directives as
specified in the Draft Proposed ANSI Standard for the C Language.
In the process, all white space is removed, and the output is formed
into long lines. All identifiers, other than those first encountered
in library header (#include <...>) files are replaced with
gobbledygook.
The following options are recognized.
-d or -D Define the following (empty) macro.
-l or -L Shroud identifiers in library headers as well.
-w or -W Leave whitespace unaffected.
-x or -X Do not recognize Watcom extended keywords.
The preprocessed output may be used as input to most C compilers.
#pragmas and extended keywords specific to the Watcom C compiler are
specifically recognized.
EXAMPLES
The following command displays the source file EXAMPLE.C on standard
output, after performing all preprocessing directives, replacing all
macros, and shrouding.
shroud example.c
The following command deposits the shrouded source of EXAMPLE.C in the
file EXAMPLE.SHR. White space is retained, library headers are
shrouded, extended keywords are treated as ordinary identifiers, and a
macro is defined as if by "#define MACRO_NAME".
shroud -wlxdMACRO_NAME example.c >example.shr
The following command deposits the shrouded source of EXAMPLE.H and
EXAMPLE.C in the file EXAMPLE.SHR. EXAMPLE.H is handled as if the
directive "#include "example.h"" precedes the first line of EXAMPLE.C.
shroud example.h example.c >example.shr
SEE ALSO
Steven Bruce Williams
"Using Tomorrow's C Standard Today"
Computer Language Magazine
Volume 5, Number 7
July 1988
Draft Proposed American National Standard for Information Systems --
Programming Language C - X3 Secretariat: Computer and Business
Equipment Manufacturers Association - Available from Global
Engineering Documents, Inc. 800-854-7179
WATCOM C Optimizing Compiler and Tools User's Guide
WATCOM Publications Limited
415 Phillip Street
Waterloo, Ontario, Canada
N2L 3X2
519-886-3700
BUGS
Token pasting is quite limited. The left token must be an identifier.
The right token must be either an identifier or an integer. The
result is always an identifier. Although this probably permits the
most common usage, there are certainly others that are valid.
The shrouding is quite unsophisticated.
If more than one shrouded modules need to have linkage to each other,
the programmer must sit funny in his chair while writing the
unshrouded source code, as follows.
1. All objects with external linkage (see ANSI 3.1.2.2) must be
declared in #include files. (It can be argued that it is bad form
to declare objects with external linkage other than in #include
files in any case.)
2. These #include files must contain #if directives that render them
empty if #included more than once. For example, the file EXAMPLE.H
might start with:
#if !defined(EXAMPLE_H)
#define EXAMPLE_H
and end with:
#endif
3. ALL #include files used by ANY of the modules must precede EACH
module on the shroud command line, in exactly the same order. For
example:
shroud include1.h include2.h include3.h module1.c >module1.shr
shroud include1.h include2.h include3.h module2.c >module2.shr
shroud include1.h include2.h include3.h module3.c >module3.shr
Remember, ALL #include files must precede EVERY module, even if the
module does not use the include file.
These steps are necessary because each identifier's gobbledygook
replacement is determined, in part, by the order in which identifiers
are encountered. Including every #include file in the same order for
each module ensures that the gobbledygook for identifiers with
external linkage is the same for each module.