Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!uunet!nems!science From: science@nems.dt.navy.mil (Mark Zimmermann) Newsgroups: comp.lang.c Subject: wanted: converter for fcn declarators Message-ID: <2162@nems.dt.navy.mil> Date: 4 Jun 90 11:03:46 GMT Reply-To: science@nems.dt.navy.mil (Mark Zimmermann) Organization: David Taylor Research Center, Bethesda, MD Lines: 30 I am writing C using the newer ANSI-style function declarations (see examples below) and this is great for my Macintosh and PC C compilers -- but the generic UNIX 'cc' available to me on Macintosh under A/UX, on Sun Sparcstation, and on VAX under Ultrix do NOT understand this style, alas. Could somebody help me find or develop a quick program to convert from new ANSI-prototype-style declarators to the old way? I would estimate that this could be done in 5-10 lines of awk, since I can *guarantee* that my function declarations look like the following examples and never extend over more than 2 lines. But I'm not quite good enough at awk to do it myself, and I am sure that others must have encountered this same problem often enough to have solved it cleanly. My functions currently look like: main (int argc, char *argv[]) void print_help (void) void load_docfile (FILE* docfile, unsigned char *docp, long start, long doclength) void make_index_ptrs (unsigned char *doc0, long doclength, zndxptr *ptr0, long ptrcount) long write_index_files (unsigned char *doc0, zndxptr *ptr0, long ptrcount, FILE *kfile, FILE *pfile) ... and so forth ... in each case, the function declarator is followed by a newline, an indentation, and a '{' on a line by itself before the body of the function (in my typing style, anyway) ... apologies for not putting 'int' in front of 'main' ... Tnx for help!! ^z (science@nems.dt.navy.mil on Internet)