Release calc version 2.10.2t30

This commit is contained in:
Landon Curt Noll
1996-07-06 04:17:00 -07:00
commit 4618313a82
388 changed files with 85904 additions and 0 deletions

77
symbol.h Normal file
View File

@@ -0,0 +1,77 @@
/*
* Copyright (c) 1993 David I. Bell
* Permission is granted to use, distribute, or modify this source,
* provided that this copyright notice remains intact.
*/
#ifndef SYMBOL_H
#define SYMBOL_H
#include "zmath.h"
/*
* Symbol Declarations.
*/
#define SYM_UNDEFINED 0 /* undefined symbol */
#define SYM_PARAM 1 /* parameter symbol */
#define SYM_LOCAL 2 /* local symbol */
#define SYM_GLOBAL 3 /* global symbol */
#define SYM_STATIC 4 /* static symbol */
#define SCOPE_GLOBAL 0 /* file scope level for global variables */
#define SCOPE_STATIC 1 /* lowest file scope for static variables */
typedef struct global GLOBAL;
struct global {
int g_len; /* length of symbol name */
short g_filescope; /* file scope level of symbol (0 if global) */
short g_funcscope; /* function scope level of symbol */
char *g_name; /* global symbol name */
VALUE g_value; /* global symbol value */
GLOBAL *g_next; /* next symbol in hash chain */
};
/*
* Routines to search for global symbols.
*/
extern GLOBAL *addglobal(char *name, BOOL isstatic);
extern GLOBAL *findglobal(char *name);
/*
* Routines to return names of variables.
*/
extern char *localname(long n);
extern char *paramname(long n);
extern char *globalname(GLOBAL *sp);
/*
* Routines to handle entering and leaving of scope levels.
*/
extern void resetscopes(void);
extern void enterfilescope(void);
extern void exitfilescope(void);
extern void enterfuncscope(void);
extern void exitfuncscope(void);
/*
* Other routines.
*/
extern long addlocal(char *name);
extern long findlocal(char *name);
extern long addparam(char *name);
extern long findparam(char *name);
extern void initlocals(void);
extern void initglobals(void);
extern int writeglobals(char *name);
extern int symboltype(char *name);
extern void showglobals(void);
#endif
/* END CODE */