From d8klojo@dtek.chalmers.se Sun Feb 25 21:54 GMT 1996
Received: from cheviot.ncl.ac.uk (cheviot.ncl.ac.uk [128.240.2.10]) by burnmoor.ncl.ac.uk (8.6.12/8.6.10-cf revision 2 for Solaris 2.x) with ESMTP id VAA04582; Sun, 25 Feb 1996 21:54:48 GMT
Received: from ponyets.dtek.chalmers.se by cheviot.ncl.ac.uk id <VAA16163@cheviot.ncl.ac.uk>
  (8.6.12/ for ncl.ac.uk) with SMTP; Sun, 25 Feb 1996 21:57:36 GMT
Received: (from d8klojo@localhost) by ponyets.dtek.chalmers.se (8.6.9/8.6.9) id WAA10829 for Craig.Graham@newcastle.ac.uk; Sun, 25 Feb 1996 22:54:44 +0100
From: Johan Klockars <d8klojo@dtek.chalmers.se>
Message-Id: <199602252154.WAA10829@ponyets.dtek.chalmers.se>
Subject: Re: My stuff
To: Craig.Graham@newcastle.ac.uk (Craig. Graham)
Date: Sun, 25 Feb 1996 22:54:43 +0100 (MET)
In-Reply-To: <Pine.HPP.3.91-941213.960225114118.1737C-100000@pike12.ncl.ac.uk> from "Craig. Graham" at Feb 25, 96 11:56:09 am
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
Content-Length: 2103
Status: RO

Hi,

> I've sort of started stripping the C++ comments out myself as well

No need for that. As I mentioned earlier, I wrote a program to change
them to the standard format. I've not gotten around to cleaning it up,
so it's a bit rough, but I'm sure you'll have no trouble with it.
The program worked last time I tried...

By the way, when do you think a new source release (or diff) will be 
released? For some reason I can't get my current (patched) sources to
work anymore (even using Lattice C). No mouse clicks are ever acted upon.  :-(
Everything was fine yesterday, but then I experimented a bit with a home
compiled patch v2.1...
Is there a more recent executable than 1.2 anywhere? The diffs generated
by Martin don't seem to work with 1.2.

Regards,
Johan

--- cut here ---
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define BUFSIZE 200

void main(int argc, char **argv)
{
	char buf[BUFSIZE], *comment, *tmp;
	FILE *infile, *outfile;
	int i, n;

	if (argc < 2) {
		printf("Usage: xlc2gcc infiles\n");
		exit(-1);
	}

for(i = 1;i <= argc;i++) {	
for(n = strlen(argv[i]);(argv[i][n] != '\\') && (argv[i][n] != '/');n--) ;
strcpy(buf, &argv[i][n + 1]);
printf("Original: %s    New: %s\n", argv[i], buf);

	if ((infile = fopen(argv[i],"r")) == NULL) {
		printf("Can't find file!\n");
		exit(-1);
	}

	if ((outfile = fopen(buf,"w")) == NULL) {
		printf("Can't open file!\n");
		fclose(infile);
		exit(-1);
	}
	
	fgets(buf, BUFSIZE, infile);
	do {
		if (comment = strstr(buf, "//")) {
			comment[1] = '*';
			for(tmp = &buf[strlen(buf)];*tmp < ' ';tmp--)
				*tmp = '\0';
			strcat(buf, " */\n");
		}
		fputs(buf, outfile);
		buf[0] = '\0';
		fgets(buf, BUFSIZE, infile);
	} while (!feof(infile));
	
	if (strlen(buf))
		fputs(buf, outfile);

	fclose(outfile);
	fclose(infile);
}
}


-- 
  Chalmers University   | Why are these |  e-mail:   rand@cd.chalmers.se
     of Technology      |  .signatures  |            johan@rand.thn.htu.se
                        | so hard to do |  WWW/ftp:  rand.thn.htu.se
   Gothenburg, Sweden   |     well?     |            (MGIFv5, QLem, BAD MOOD)

