home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d5xx
/
d598
/
ansi.lha
/
ANSI
/
ANSI.doc
< prev
next >
Wrap
Text File
|
1992-02-01
|
2KB
|
49 lines
ANSI
====
Dr. Andrew C. R. Martin
SciTech Software
This program is not in the public domain, but it may be freely copied
and distributed for no charge providing this header is included.
The code may be modified as required, but any modifications must be
documented so that the person responsible can be identified. If someone
else breaks this code, I don't want to be blamed for code that does not
work! The code may not be sold commercially without prior permission from
the author, although it may be given away free with commercial products,
providing it is made clear that this program is free and that the source
code is provided with the program.
****************************************************************************
Description
===========
This program alters function definitions to convert non-ANSI C code to
ANSI form. The -k and -p flags allow conversion from ANSI to K&R and
generation of prototypes respectively.
There are two *minor* problems:
1. In generation of prototypes. If a function has been defined with no
explicit type it defaults to being int. Strictly the prototype should
explicitly state this is int, but doesn't.
2. If a conversion actually occurs (either to or from ANSI) any comments
which were in the definition will be lost.
The only restriction (that I can think of!) on the code being processed
is that a function definition must be the first thing on a line.
i.e. if a comment is placed on the same line as the definition but before
it, the program will think the whole line is a comment.
****************************************************************************
Usage:
======
The program may only be used from the CLI:
ansi [-k -p] <in.c> <out.c>
-k generates K&R form code from ANSI
-p generates a set of prototypes