version 1.1, 2014/03/25 07:08:25 |
version 1.3, 2020/10/03 08:24:14 |
|
|
/* $OpenXM$ */ |
/* $OpenXM: OpenXM/src/util/oxlistlocalf.c,v 1.2 2015/10/13 06:18:26 takayama Exp $ */ |
#include <stdio.h> |
#include <stdio.h> |
#include <ctype.h> |
#include <ctype.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
|
#include <string.h> |
#include "oxlistlocalf.h" |
#include "oxlistlocalf.h" |
|
|
|
int readcomment(); |
|
int readcomment2(); |
|
char *readstring(); |
|
int readchar(); |
|
void putchar0(int c); |
|
void printf0(char *s); |
|
void printf1(char *s); |
|
int isReserved(char *s); |
|
int shouldReplace(char *s); |
|
int fsgetc(FILE *fp); |
|
|
|
|
|
|
|
|
|
|
objectp KClval; |
objectp KClval; |
int Replace = 0; |
int Replace = 0; |
int Linenumber = 0; |
int Linenumber = 0; |
|
|
} |
} |
|
|
|
|
readcomment() { |
int readcomment() { |
int c; |
int c; |
while (1) { |
while (1) { |
c = fsgetc(Inop); |
c = fsgetc(Inop); |
|
|
} |
} |
} |
} |
|
|
readcomment2() { |
int readcomment2() { |
int c; |
int c; |
while (1) { |
while (1) { |
c = fsgetc(Inop); |
c = fsgetc(Inop); |
Line 428 char *readstring() { |
|
Line 444 char *readstring() { |
|
} |
} |
|
|
|
|
readchar() { |
int readchar() { |
int c; |
int c; |
if (Replace) putchar0('\''); |
if (Replace) putchar0('\''); |
c = fsgetc(Inop); /* 'c.' '\.c' */ |
c = fsgetc(Inop); /* 'c.' '\.c' */ |
|
|
return(c); |
return(c); |
} |
} |
|
|
putchar0(c) |
void putchar0(int c) |
int c; |
|
{ |
{ |
if (c > 0) putchar(c); |
if (c > 0) putchar(c); |
} |
} |
|
|
printf0(s) |
void printf0(char *s) |
char *s; |
|
{ |
{ |
int i = 0; |
int i = 0; |
while (s[i] != '\0') putchar0(s[i++]); |
while (s[i] != '\0') putchar0(s[i++]); |
} |
} |
|
|
printf1(s) |
void printf1(char *s) |
char *s; |
|
{ |
{ |
int i = 0; |
int i = 0; |
/* putchar0('K'); */ /* do your own replacement */ |
/* putchar0('K'); */ /* do your own replacement */ |
while (s[i] != '\0') putchar0(s[i++]); |
while (s[i] != '\0') putchar0(s[i++]); |
} |
} |
|
|
isReserved(s) |
int isReserved(char *s) |
char *s; |
|
{ |
{ |
char *r[] = {"auto","break","case","char","const","continue", |
char *r[] = {"auto","break","case","char","const","continue", |
"default","do","double","else","enum","extern", |
"default","do","double","else","enum","extern", |
|
|
|
|
} |
} |
|
|
shouldReplace(s) |
int shouldReplace(char *s) |
char *s; |
|
{ |
{ |
char *r[] = {"dummy"}; |
char *r[] = {"dummy"}; |
int n = 1; |
int n = 1; |