home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 March
/
VPR9703A.ISO
/
VPR_DATA
/
DOGA
/
SOURCES
/
REND.LZH
/
READER
/
WORD.C
< prev
next >
Wrap
C/C++ Source or Header
|
1995-07-13
|
589b
|
38 lines
#include <stdio.h>
#include <ctype.h>
#ifdef UNIX
#define toupper(c) (('A' <= (c) && (c) <= 'Z') ? ((c) - 'A' + 'a') : (c))
#endif
static int getword( char* );
void main()
{
int n ;
char buf[100] ;
n = 0 ;
for(;;)
{
if ( getword( buf ) == EOF )
break ;
printf( "#define WORD_%s\t\t%d\n", buf, n++ );
}
}
static int getword( buf )
char *buf ;
{
int c ;
while( ( c = getchar() ) != '\"' && c != EOF );
if ( c == EOF )
return( EOF );
while( ( c = getchar() ) != '\"' )
*buf++ = toupper( c );
*buf = '\0' ;
return( 0 );
}