home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
UTILITY
/
WCMT10.ZIP
/
WCMT.DOC
< prev
next >
Wrap
Text File
|
1994-03-06
|
6KB
|
143 lines
WCMT v1.00 by Ron L. Smith (Mar 06 1994)
WCMT (WWIV Comment) is a program for registered users of WWIV Software's
bulletin board system software, WWIV. It is used for v4.22+ to add comments
to the C source files for the external string files, so when modifying the
source code, you can easily tell what will be displayed at any given time.
Usage: WCMT [-B] [-C] [-Q] [-F] path file
-B Do NOT create backup files
-C Use C style comments instead of C++
-Q Surround string with single quotes
-F Include string filename on comment line
path Location of string files
file Listfile created by make (files to process)
Typing WCMT without parameters (or WCMT -?) will give you the help screen
shown above.
-B Normally, WCMT makes a backup of each .C file processed with an extension
of .BAK (WCMT copies the file, it does not rename it). If the -B option
is given, backup files will be created for processing, but will be
removed once comments have been successfully added to the .C file. If
some error occurs during processing of the .C file, the .BAK file will
still exist even if the -B option is given. You can then restore the
original in case the new file is damaged or wasn't fully processed.
-C By default, WCMT uses C++ style commenting, i.e., // comment.
The -C option forces the use of standard C style commenting, /* comment */.
HOWEVER, if an external string has either /* or */ in it, a C++ style
comment will be FORCED in that case. Otherwise, you would get an error,
as normally, nested commenting is not allowed by compilers. If your
C compiler does not recognize the // comment style, you can either change
the string to remove the /* */ item(s), or manually change the line to
whatever format you want after WCMT has processed it. (I am aware at this
time of only 2 cases in v4.23 source code that has this, in CONF.C, and
I don't believe 4.22 source has any stock strings with /* or */ in them).
-Q This switch tells WCMT to add ' characters around the string in the
comment, so it would look like 'This is string #1. '
If you want to be able to see whitespace characters in the strings,
then use this option.
-F The normal format WCMT uses to comment the string is to include the
string number only. This options also causes WCMT to add the string
file name next to the string number.
path REQUIRED!! This is the path to your .STR files. It doesn't matter
whether you use a trailing backslash or not. If one is not there,
WCMT will add one.
file REQUIRED!! This is the temporary file created by make which should
contain a the names of all files to be processed (normally a name like
MAKE0005.$$$ or similar, has the .obj filenames in it).
NOTES:
1) If WCMT determines it is inside a comment in the source code, it will
not process any string file directives in that part of the code.
Example: /* this get_stringx(1,100); will not be processed */
2) If CR and or LF characters are in an external string, or CR/LF combos,
WCMT will not show those in the comment with the .C file.
3) You can keep running WCMT on files you have already processed, it will
not put duplicate entries in, and if strings have changed, it will
update the comment (obvious, right? Otherwise, quite useless...).
4) Using WCMT outside of the makefile is not usually very helpful except
for getting a syntax screen. However, you can do it manually if you
create your own linkfile (older versions of Borland's Make did not
create a linkfile, you had to do it yourself).
5) No source line will be processed for commenting if it starts with
non-whitespace characters on the left margin. If normal C indention
is used, then that means function calls, prototypes, etc. will not
be processed (normal), but all others will. If you have code on the
left margin of the file you want processed, put 1 or more spaces and/or
tabs before the text starts on each line.
Configuration:
You can create a WCMT.CFG file to add additional functions to process.
By default, WCMT will only process get_stringx(strfileno,stringno)
function calls, and only for those which are set in BBSUTL.C. Here is
the default WCMT.CFG:
0 get_string(
The format of the file is the string file number, then 1 space, then
the function name, up to but not including the string number location.
For example, if I make a BBSMODS.STR file, set it up in BBSUTL.C as
string file #4, and then make a function called mod_string() that mimics
get_string() except it accesses string file #4 instead of #0, then my
cfg file would look like:
0 get_string(
4 mod_string(
If you had more than one mod_string file, and the function call was
mod_stringx(fileno, stringno)
then my cfg file would look like:
0 get_string(
4 mod_stringx(4,
5 mod_stringx(5,
6 mod_stringx(6,
A configuration file is NOT necessary, but if it does not exist, none of
the get_string() function calls will be commented (i.e., only the
get_stringx() functions will be recognized. In a CFG file is not found,
WCMT gives a warning, but you may ignore it. It is just informative in
case you forgot to make one.
Setup:
To set up WCMT to run, modify your MAKEFILE.MAK. Add these lines at the
end of your makefile:
wcmt: .\wcmt.exe
wcmt.exe -C -B c:\wwiv\gfiles &&^
$(BBS_NRM) $(BBS_OVL)
^
Of course, substitute whatever command line switches you want to use for
the ones above. No switches are required if not needed, i.e., only the
path to the string files and the make linkfile are required.
After that, executing MAKE CMNT will comment your .C files.
The Author:
Ron L. Smith Contact: Hunter #11@5508.WWIVNET
Spycom BBS, Alb., NM
(505)-891-1455
Address any comments, complaints, etc. to the above net address.