FORM  4.2.1
Macros | Functions
pre.c File Reference
#include "form3.h"
#include "vector.h"

Go to the source code of this file.

Macros

#define STRINGIFY(x)   STRINGIFY__(x)
 
#define STRINGIFY__(x)   #x
 
#define SKIPBUFSIZE   20
 
#define KILL   "kill"
 
#define KILLALL   "killall"
 
#define DAEMON   "daemon"
 
#define SHELL   "shell"
 
#define STDERR   "stderr"
 
#define TRUE_EXPR   "true"
 
#define FALSE_EXPR   "false"
 
#define NOSHELL   "noshell"
 
#define TERMINAL   "terminal"
 

Functions

UBYTE GetInput ()
 
VOID ClearPushback ()
 
UBYTE GetChar (int level)
 
VOID CharOut (UBYTE c)
 
VOID UnsetAllowDelay ()
 
UBYTE * GetPreVar (UBYTE *name, int flag)
 
int PutPreVar (UBYTE *name, UBYTE *value, UBYTE *args, int mode)
 
VOID PopPreVars (int tonumber)
 
VOID IniModule (int type)
 
VOID IniSpecialModule (int type)
 
VOID PreProcessor ()
 
int PreProInstruction ()
 
int LoadInstruction (int mode)
 
int LoadStatement (int type)
 
int ExpandTripleDots (int par)
 
KEYWORDFindKeyWord (UBYTE *theword, KEYWORD *table, int size)
 
KEYWORDFindInKeyWord (UBYTE *theword, KEYWORD *table, int size)
 
int TheDefine (UBYTE *s, int mode)
 
int DoCommentChar (UBYTE *s)
 
int DoPreAssign (UBYTE *s)
 
int DoDefine (UBYTE *s)
 
int DoRedefine (UBYTE *s)
 
int ClearMacro (UBYTE *name)
 
int TheUndefine (UBYTE *name)
 
int DoUndefine (UBYTE *s)
 
int DoInclude (UBYTE *s)
 
int DoReverseInclude (UBYTE *s)
 
int Include (UBYTE *s, int type)
 
int DoPreExchange (UBYTE *s)
 
int DoCall (UBYTE *s)
 
int DoDebug (UBYTE *s)
 
int DoTerminate (UBYTE *s)
 
int DoDo (UBYTE *s)
 
int DoBreakDo (UBYTE *s)
 
int DoElse (UBYTE *s)
 
int DoElseif (UBYTE *s)
 
int DoEnddo (UBYTE *s)
 
int DoEndif (UBYTE *s)
 
int DoEndprocedure (UBYTE *s)
 
int DoIf (UBYTE *s)
 
int DoIfdef (UBYTE *s, int par)
 
int DoIfydef (UBYTE *s)
 
int DoIfndef (UBYTE *s)
 
int DoInside (UBYTE *s)
 
int DoEndInside (UBYTE *s)
 
int DoMessage (UBYTE *s)
 
int DoPipe (UBYTE *s)
 
int DoPrcExtension (UBYTE *s)
 
int DoPreOut (UBYTE *s)
 
int DoPrePrintTimes (UBYTE *s)
 
int DoPreAppend (UBYTE *s)
 
int DoPreCreate (UBYTE *s)
 
int DoPreRemove (UBYTE *s)
 
int DoPreClose (UBYTE *s)
 
int DoPreWrite (UBYTE *s)
 
int DoProcedure (UBYTE *s)
 
int DoPreBreak (UBYTE *s)
 
int DoPreCase (UBYTE *s)
 
int DoPreDefault (UBYTE *s)
 
int DoPreEndSwitch (UBYTE *s)
 
int DoPreSwitch (UBYTE *s)
 
int DoPreShow (UBYTE *s)
 
int DoSystem (UBYTE *s)
 
int PreLoad (PRELOAD *p, UBYTE *start, UBYTE *stop, int mode, char *message)
 
int PreSkip (UBYTE *start, UBYTE *stop, int mode)
 
VOID StartPrepro ()
 
int EvalPreIf (UBYTE *s)
 
UBYTE * PreIfEval (UBYTE *s, int *value)
 
int PreCmp (int type, int val, UBYTE *t, int type2, int val2, UBYTE *t2, int cmpop)
 
int PreEq (int type, int val, UBYTE *t, int type2, int val2, UBYTE *t2, int eqop)
 
UBYTE * pParseObject (UBYTE *s, int *type, LONG *val2)
 
UBYTE * PreCalc ()
 
UBYTE * PreEval (UBYTE *s, LONG *x)
 
void AddToPreTypes (int type)
 
void MessPreNesting (int par)
 
int DoPreAddSeparator (UBYTE *s)
 
int DoPreRmSeparator (UBYTE *s)
 
int DoExternal (UBYTE *s)
 
int DoPrompt (UBYTE *s)
 
int DoSetExternal (UBYTE *s)
 
int DoSetExternalAttr (UBYTE *s)
 
int DoRmExternal (UBYTE *s)
 
int DoFromExternal (UBYTE *s)
 
int DoToExternal (UBYTE *s)
 
UBYTE * defineChannel (UBYTE *s, HANDLERS *h)
 
int writeToChannel (int wtype, UBYTE *s, HANDLERS *h)
 
int DoFactDollar (UBYTE *s)
 
WORD GetDollarNumber (UBYTE **inp, DOLLARS d)
 
int DoSetRandom (UBYTE *s)
 
int DoOptimize (UBYTE *s)
 
int DoClearOptimize (UBYTE *s)
 
int DoSkipExtraSymbols (UBYTE *s)
 
int DoPreReset (UBYTE *s)
 
int DoPreAppendPath (UBYTE *s)
 
int DoPrePrependPath (UBYTE *s)
 
int DoTimeOutAfter (UBYTE *s)
 

Detailed Description

This is the preprocessor and all its routines.

Definition in file pre.c.

Function Documentation

int PutPreVar ( UBYTE *  name,
UBYTE *  value,
UBYTE *  args,
int  mode 
)

Inserts/Updates a preprocessor variable in the name administration.

Parameters
nameCharacter string with the variable name.
valueCharacter string with a possible value. Special case: if this argument is zero, then we have no value. Note: This is different from having an empty argument! This should only occur when the name starts with a ?
argsCharacter string with possible arguments.
mode=0: always create a new name entry, =1: try to do a redefinition if possible.
Returns
Index of used entry in name list.

Definition at line 642 of file pre.c.

References pReVaR::argnames, pReVaR::name, pReVaR::nargs, pReVaR::value, and pReVaR::wildarg.

Referenced by Generator(), PF_BroadcastRedefinedPreVars(), StartVariables(), and TheDefine().

int TheDefine ( UBYTE *  s,
int  mode 
)

Preprocessor assignment. Possible arguments and values are treated and the new preprocessor variable is put into the name administration.

Parameters
sPointer to the character string following the preprocessor command.
modeBitmask. 0-bit clear: always create a new name entry, 0-bit set: try to redefine an existing name, 1-bit set: ignore preprocessor if/switch status.
Returns
zero: no errors, negative number: errors.

Definition at line 1942 of file pre.c.

References PutPreVar().

int DoPreAppendPath ( UBYTE *  s)

Appends the given path (absolute or relative to the current file directory) to the FORM path.

Syntax: #appendpath <path>

Definition at line 6954 of file pre.c.

int DoPrePrependPath ( UBYTE *  s)

Prepends the given path (absolute or relative to the current file directory) to the FORM path.

Syntax: #prependpath <path>

Definition at line 6971 of file pre.c.