2
* convertprototype.c - Helper program for the solaris package creation.
5
* Marco van den Heuvel <blackystardust68@yahoo.com>
7
* This file is part of VICE, the Versatile Commodore Emulator.
8
* See README for copyright notice.
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
30
static void convertprototype(unsigned char *readbuffer, int filesize)
34
while (counter<filesize)
36
while (!isspace(readbuffer[counter]) || !isdigit(readbuffer[counter+1]))
38
printf("%c",readbuffer[counter]);
41
printf("%c",readbuffer[counter]);
42
printf("%c",readbuffer[counter+1]);
43
printf("%c",readbuffer[counter+2]);
44
printf("%c",readbuffer[counter+3]);
47
while (readbuffer[counter] != '\n')
53
int main(int argc, char **argv)
57
unsigned char *buffer=NULL;
61
if (stat(argv[1], &statbuf)>=0)
63
if (statbuf.st_size>0)
65
buffer=(unsigned char*)malloc(statbuf.st_size);
68
infile=fopen(argv[1],"rb");
71
if (fread(buffer,1,statbuf.st_size,infile)==statbuf.st_size)
73
convertprototype(buffer,statbuf.st_size);