home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
text
/
golded
/
data
/
tools
/
gedscan
/
define.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-27
|
2KB
|
67 lines
/* -----------------------------------------------------------------------------
Example: scan handler looking for #defines. Scan handlers are plain functions
(LoadSeg'ed by GED): no standard C startup code, no library calls.
Exemple: gestionnaire de scan recherchant des #defines. Les gestionnaires de
scan sont des fonctions plain (LoadSeg'ées par GED): pas de code de départ
C standard, pas d'appel bibliothèque. DICE-C:
DICE-C:
dcc define.c -// -l0 -md -mRR -o ram:Defines
------------------------------------------------------------------------------
*/
#include <exec/types.h>
#define UPPER(a) ((a) & 95)
ULONG
ScanHandlerGuide(__D0 ULONG len, __A0 char **text)
{
const char *version = "$VER: Define 1.0 (24.3.94)";
if (**text == '#') {
if (len > 8) {
UBYTE *next = *text + 1;
if (UPPER(*next++) == 'D') {
if (UPPER(*next++) == 'E') {
if (UPPER(*next++) == 'F') {
if (UPPER(*next++) == 'I') {
if (UPPER(*next++) == 'N') {
if (UPPER(*next++) == 'E') {
if (*next++ == ' ') {
UWORD letters = 0;
for (len -= 8; (*next == 32) && len; --len)
++next;
for (*text = next; len && (*next++ != ' '); --len)
++letters;
return(letters);
}
}
}
}
}
}
}
}
}
return(NULL);
}