home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 3
/
goldfish_volume_3.bin
/
files
/
text
/
edit
/
macro
/
scanner
/
stdefines.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-10-17
|
1KB
|
55 lines
/*
** ***********************************************************************
**
** ScanHandlerSDefine (c) by Stefan Schor
**
** ***********************************************************************
*/
#include <exec/types.h>
#define UPPER(a) ((a) & 95)
__asm
ULONG
ScanHandlerSDefine(register __d0 ULONG len, register __a0 char **text)
{
const char *version = "$VER: SDefine 1.1 (17.10.94)";
if (len > 8)
{
char *pos = *text;
char *last = *text + len -1;
if ( *pos++ == '#'
&& UPPER(*pos++) == 'D'
&& UPPER(*pos++) == 'E'
&& UPPER(*pos++) == 'F'
&& UPPER(*pos++) == 'I'
&& UPPER(*pos++) == 'N'
&& UPPER(*pos++) == 'E'
&& *pos == ' ' )
{
while (pos<last && *++pos==' '); /* Alle Spaces übergehen */
*text = pos; /* Hier beginnt der Text */
while (pos<last && *++pos!=' ' && *pos!='('); /* Solange bis Space oder ( */
if (*pos == ' ' || *pos == '(')
return ((ULONG)pos - (ULONG)*text); /* Länge zurück */
else
return ((ULONG)pos - (ULONG)*text + 1); /* Länge zurück */
}
}
return 0;
}