/*External stuff for ScianScripts
  Eric Pepke
*/

extern Bool runningScript;
extern Bool abortScript;
extern Bool settingUp;

#define SHIFTKW(d, s) {int k; SKIPBLANKS(s); begToken = s; k = 0; while (*s && (isalpha (*s) || isdigit(*s) || *s == '\\' || *s == '_')) {if (*s == '\\') {++s; d[k++] = *s++;} else if (*s == '_') {d[k++] = ' '; ++s;} else d[k++] = *s++;} endToken = s; d[k] = 0;}
#define SHIFTNUM(d, s) {int k; SKIPBLANKS(s); begToken = s; k = 0; while (*s && (isalpha(*s) || isdigit(*s) || *s == '+' || *s == '-' || *s == '.')) {d[k++] = *s++;} endToken = s; d[k] = 0;}

extern char *begToken, *endToken;	/*Beginning and ending of current token*/
extern char *wholeLine;

extern WinInfoPtr scriptWindow;

extern int nextLogElement;
#define logging (nextLogElement)

#define ERROBJ	((ObjPtr) -1)		/*Evil Satanic test value*/

#ifdef PROTO
void BeginScript(char *);
void EndScript(void);
Bool ReadScriptLine(void);
Bool InterpretScriptLine(char *);
ObjPtr FindFullNamedObject(char *);
void MakeFullObjectName(char *, ObjPtr, ObjPtr);
void MakeObjectName(char *, ObjPtr);
void Log(char *);
void LogControl(ObjPtr);
void LogVariable(ObjPtr, NameTyp);
void LogObjectName(ObjPtr);
char *PrintScriptObject(char *, ObjPtr);
void InhibitLogging(Bool);
char *PrintScriptString(char *, char *);
void ShowScriptControlPanels(Bool);
FILE *OpenLogFile(char *);
void CloseLogFile();
char *ParseObjectArg(char *s, ObjPtr *o);
#else
void BeginScript();
void EndScript();
Bool ReadScriptLine();
Bool InterpretScriptLine();
ObjPtr FindFullNamedObject();
void MakeFullObjectName();
void MakeObjectName();
void Log();
void LogControl();
void LogVariable();
void LogObjectName();
void InhibitLogging();
char *PrintScriptString();
void ShowScriptControlPanels();
FILE *OpenLogFile();
void CloseLogFile();
char *ParseObjectArg();
#endif
