home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kyūkyoku!! X68000 Emulator
/
X68000Book.dat
/
mac
/
OLS
/
X68000
/
Ko-Window
/
kow142s.lzh
/
wsrv
/
common.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-13
|
1KB
|
57 lines
/* 1991 COR.*/
/* 1995 11/12 microstrlib é╓ÅCÉ│ */
#include <stdio.h>
#include "wlib.h"
static unsigned char *CommonPtr;
/* ïñùLù╠êµé╠èmò█ */
unsigned char *
CommonOpen( name )
unsigned char *name;
{
return CommonPtr= WindowGetCommon( (char*)name, 0 );
}
/* éPìsÉ╪éΦÅoé╡ */
unsigned char *
CommonGetLine( line )
unsigned char *line;
{
if( !*CommonPtr )
return NULL;
for(; *CommonPtr != '\n' && *CommonPtr ; *line++= *CommonPtr++ );
*line= '\0';
if( *CommonPtr == '\n' )
CommonPtr++;
return CommonPtr;
}
/* éPâÅü[âhÉ╪éΦÅoé╡ */
unsigned char *
CommonGetWord( buf )
unsigned char *buf;
{
unsigned char c;
int flag;
/* while( isspace( c = *CommonPtr ) && c )*/
for(; (c= *CommonPtr) && c <= ' ' ; CommonPtr++ );
if( c == '\0' )
return 0;
CommonPtr++;
flag= ( c == '\"' );
if( flag )
c= *CommonPtr++;
/* while( ((flag && c != '\"')||(!flag && !isspace( c )) ) && c ){*/
while( ((flag && c != '\"')||(!flag && c > ' ') ) && c ){
*buf++= c;
c= *CommonPtr++;
}
CommonPtr+= flag;
*buf= '\0';
return CommonPtr;
}