symbol.h 684 Bytes
Newer Older
1 2
#ifndef GNUMERIC_SYMBOL_H
#define GNUMERIC_SYMBOL_H
3 4

typedef enum {
5
	SYMBOL_FUNCTION
6 7 8
} SymbolType;

typedef struct {
Miguel de Icaza's avatar
Miguel de Icaza committed
9 10 11 12 13 14 15 16 17
	GHashTable *hash;
} SymbolTable;

typedef struct {
	int         ref_count;
	SymbolType  type;
	char        *str;
	SymbolTable *st;
	void        *data;
18 19
} Symbol;

Miguel de Icaza's avatar
Miguel de Icaza committed
20 21 22
SymbolTable *symbol_table_new      (void);
void         symbol_table_destroy  (SymbolTable *st);

23 24
Symbol      *symbol_lookup         (SymbolTable *st, const char *str);
Symbol      *symbol_install        (SymbolTable *st, const char *str,
Miguel de Icaza's avatar
Miguel de Icaza committed
25 26 27 28
				    SymbolType type, void *data);

void         symbol_ref            (Symbol *);
void         symbol_unref          (Symbol *);
29

30
#endif /* GNUMERIC_SYMBOL_H */