home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
144.lha
/
SDX.doc
< prev
next >
Wrap
Text File
|
1986-11-21
|
3KB
|
74 lines
SDX
Simple Documentation Extractor
Copyright (C) 1988 by Bryan Ford
SDX is a program which scans through C source code for documentation,
and extracts it into a file. I wrote it because Fred Fish's dex was much
more than I needed, and somewhat harder to use, mainly because you had to
have a .dexrc file. Also, it required its output to be run through a
text processor, and for some reason my text processor didn't like the
output files it created, in that backslashes were inserted before
every period. This is why I call it the "simple" documentation extractor -
because it doesn't have any fancy styles or boxes around titles - it just
extracts documentation.
To run SDX, just type SDX file1 file2 file3... Wildcards are allowed,
but right now my wildcard routines are quite buggy (I just wanted to get
this program *out*), so the only wildcards you can use are the single
asterisk (*), or a single #?, both of which mean "all the files in this
directory". This shouldn't be too much of a problem, because I *doubt* it
will find documentation in non-source code. The output goes to the
standard output, so you'll probably want to redirect it.
In all source files, SDX searches for strings like this:
<nl>/*<nl><sp>*<sp><sp>, where <nl> is a newline and <sp> is a space.
Then it checks the line that started with <sp>*<sp><sp>. If all of the
characters on that line are either non-alphabetic or uppercase, it starts
extracting. If there are any lowercase characters, it skips it and tries
to find the search string again.
If it finds documentation, it will extract it to stdout, with the
<sp>*<sp><sp> changed to four spaces. Tabs just after the first asterisk
are changed to six spaces, but others aren't affected. It stops extracting
when it comes to a line without <sp>* at the beginning, finds a <sp>*/
line, or finds the end of the file. It will then output a form-feed
character to the standard output (which will clear the screen on the
Amiga's console device).
Now that the technical junk is over, this sample doc should clarify
things. It is for a function named `xyz' which prints the specified string
to the screen, and returns TRUE if it was successful.
/*
* FUNCTION
* xyz - Prints a string to the screen
*
* SYNOPSIS
* Success = xyz(String)
*
* DESCRIPTION
* Prints the string to the screen
*
* INPUTS
* String - Pointer to the string to print
*
* RETURNS
* Returns TRUE if it was successful, or FALSE if unsuccessful.
*
*/
Although this might not be a very good example, it shows how things
work. I have used this program to extract documentation on my huge (30K)
custom library, and it has worked nicely.
Now for what you've all been waiting for. This program is in a way
Shareware, but I won't require you to send a donation. If you like this
program, and think it's worth something, just send whatever you think it's
worth to my address below. This program is freely distributable, so you
can copy it as much as you like, and are encouraged to do so.
I'm also interested in what anyone has to say about this program, or
ideas for other useful utilities which need making. My address is below.
Snail: Bryan Ford
1790 East 1400 North
Logan, UT 84321
Fone: (801)753-1159
Bitnet: FATQW@USU