home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 3
/
goldfish_volume_3.bin
/
files
/
text
/
edit
/
macro
/
scanner
/
texdefs.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-10-17
|
1KB
|
47 lines
/*
** ***********************************************************************
**
** ScanHandlerTeXDefs (c) by Stefan Schor
**
** ***********************************************************************
*/
#include <exec/types.h>
#define UPPER(a) ((a) & 95)
__asm
ULONG
ScanHandlerTeXDefs(register __d0 ULONG len, register __a0 char **text)
{
const char *version = "$VER: TeXDefs 1.0 (17.10.94)";
if (len > 5)
{
char *pos = *text;
char *last = *text + len -1;
if ( *pos++ == '\\'
&& *pos++ == 'd'
&& *pos++ == 'e'
&& *pos++ == 'f'
&& *pos == '\\' )
{
*text = pos; /* Hier beginnt der Text */
while (pos<last && *++pos!='{' && *pos!='\\'); /* Solange kein { und kein \ */
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;
}