//e3.h Copyright (C) 1989-2000 I.Pedley (CTPP) Thu 22-Mar-2001 at 16:29:10

//following on from E2 which is specific to the ChaOS filesystem
//E3 is to be more filesystem independent, with the added quirk
//of an archiving facility on FAT12, FAT16 and FAT32 which is
//compatible with the old UNDEL, and EXP tools used to write
//ChaOS so far on a DOS 6.2 host

//the main change is to include a PATH structure in the main editor
//structure E3 instead on a CHAOSFILE structure

struct  E3
{
    UL  lines;
    CH* buf;
    UL  wx,wy,curx,cury,modified,loaded,maxlines;
    SL  braces,brackets,parentheses,quotes;
    UL  argtoggle,argx,argy,argw,argh;
    CH  name[256];
    PATH sp;
};

#define MAXEFILES   150
#define MEMLINELEN  512
#define MAXLINELEN  400
#define EDITEXTRAS  100

#define VSCROLLINC   45
#define AUTOSCROLL   10


#define ENDOFLINE        0x0a0d // '\r\n'
#define C_STARTCOMMENT   0x2a2f // '/*'
#define C_ENDCOMMENT     0x2f2a // '*/'
#define CPP_COMMENT      0x2f2f // '//'
#define LINECONTINUATION 0x0a5c // '\r\\'


////structure to hold macro-substitution strings
//struct MACRO
//{
//    CH* ident;  //ident is a pascal string
//    CH* equ;    //equ is an ascii string in the source buffer, length equlen
//    UL  equlen;
//    UL  parms;  //macro arguments
//};

MACRO* macromatch  (VD);
SL     addmacro    (VD);
SL     comparemacro(MACRO* m);
SL     argmacro    (MACRO* m);
SL     deletemacro (MACRO* m);

//E-nametable support
CH* entbadd(CH* str,UL len);


//preprocessor parser subroutines
SL  ppblanks(VD);
SL  ppident (VD);
VD  pskip   (VD);

SL  iscsymf(SL c);
SL  iscsym (SL c);