aboutsummaryrefslogtreecommitdiff
path: root/scope.h
blob: 7160b5e0b931282870cea74678bfdc1a68b44ceb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef SCOPE_H
#define SCOPE_H

#define HASH_SIZE 211

typedef struct hash {
	node* table[HASH_SIZE];
	struct hash *prev, *next;
	char function_boundry;
} scope;

scope* mkscope();
void free_scope(scope*);

/*stack routines*/
scope* pop_scope(scope*);
scope* push_scope(scope*);

/*helpers*/
node* scope_insert(scope*, char*);
node* scope_search_all(scope*, char*);
node* scope_search(scope*, char*);
node* scope_safe_search_all(scope*, char*);

/*hash function*/
int hashpjw(char*);
#endif