home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
PROTC12A.ZIP
/
PROTOC.DOC
< prev
next >
Wrap
Text File
|
1990-10-14
|
5KB
|
109 lines
PROTOC - A prototype generator for C source code.
Written by Mitchell Fisher - 2/12/90
Update: 07/25/90 - Corrected problems with comments on same line
as functions as well as a few minor problems with
parenthises within a comment.
BOUND PROTOC so that it will run under OS/2 as well as DOS
Update: 10/14/90 - Corrected problem that caused PROTOC not to run under DOS
as a BOUND application.
THIS VERSION OF PROTOC IS FREEWARE AND NO CHARGE SHOULD BE ACCEPTED FOR
THIS PRODUCT!! PLEASE FEEL FREE TO DISTRIBUTE THIS PRODUCT HOWEVER MAKE
SURE THAT THE FOLLOWING FILES EXIST:
PROTOC - Makefile for Microsoft C
PROTOC.DOC - This file
PROTOC.EXE - The PROTOC executable for DOS
CHRFUNCS.OBJ - Character functions for PROTOC
PROTOC.C - C Source code for PROTOC
PROTOC.H - Header file of function prototypes for PROTOC
PROTOC.DEF - Definition file for Linker for OS/2 not
needed for DOS.
Description:
Have you ever been writing a C program and find out you really
need function prototypes. Well, most of us normally include several .H
files for our code which is made up largely of function prototypes. If a
funcion is called with a forward reference, then most compilers will
default those calls with an integer type meaning the routines will
return only integers. Well, this can be a problem if you are working in a
far or huge memory model and you want a far poitner returned from a
function rather than an integer. However, to take out the drudgery of
going through your code and collecting all the functions and making
prototypes out of them, I wrote this program to do it for you. It is,
however, based on the Turbo C project file but project files are very
simple to create. All a project file is is a file that contains a list of
all source code that makes up the program. If you have just one source
module, sorry, protoc must use a project file so you must enter this one
file into a project file... For those Turbo C users that use project
files and include .LIB and .OBJ lines in the project, don't wory, PROTOC
will ignore these lines and only process files with the .C extension.
However, there is one thing to watch out for, if PROTOC uses the
project file HELP.PRJ, then the output file will become HELP.H so make
sure there is no .H file that is the same as your project file name. If
this is the case, just rename the project file to something unique.
For a simple useage, enter PROTOC without any parameters.
You can redirect PROTOC's output from a file to the screen. To do this
preceed the project file with a -O. Example: PROTOC -O test.prj
Commentary:
This version, version 1.2, is bundled with the source code. and is
BOUND so that it will run under OS/2 and DOS. (I have only tested the
program under OS/2 1.2.) This source code was originally compiled under
Turbo C Version 2.0 but has been recently been compiler under Microsoft C
Version 5.1 for use with OS/2.
You will also notice a .OBJ file bundled with this package - this file
contains the character functions that PROTOC uses. The source code for
these functions have not been included.
I am pleased to find that people have found this program to be of some
use. In view of this use, I shall continue to upgrade this program to
work better and faster and provide new options. Also, a Presentation
Manager version is in the works which will work in OS/2.
This version is free to all you 'C' programmers out there. With the
advent of ANSI C, this function may prove to be a necessity.
Known limitations or BUGS!
This software has been tested rather thouroghly and no MAJOR BUGS have
been found but there is always a possibility so please inform me either by
letter or phone message of any problems and I will try to correct the
problem.
One known limitation is that PROTOC will not process a function that has
it's begin and end parenthises on different lines. This rarely will
happen except for those functions that accept a lot of parameters and the
programmer divides up the function definition into two lines. If a
function has that many params anyway, the programmer should change it to
use a structure or global variables or whatever.
I hope you find this program of some use.
Mitchell Fisher
5914 W. Golden Lane
Glendale, AZ 85302
(602) 435-8723