-
Notifications
You must be signed in to change notification settings - Fork 5
/
env.h
35 lines (28 loc) · 800 Bytes
/
env.h
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
28
29
30
31
32
33
34
35
#ifndef ENV_H_
#define ENV_H_
#include "utils/hash_table.h"
#include "utils/vector.h"
#include "value.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct __env_t env_t;
struct __env_t {
vector_t data;
env_t *outer;
};
extern env_t *env_empty_new(void);
extern env_t *env_new(env_t *);
extern void env_free(env_t *);
extern void env_push(env_t *, const char *, value_t *, int *, int *);
extern void env_set(env_t *, const char *, value_t *);
extern int env_isempty(env_t *);
extern int env_locate(env_t *, const char *, int *, int *);
extern int env_update(env_t *, int, int, value_t *);
extern value_t *env_get(env_t *, const char *);
extern value_t *env_ref(env_t *, int, int);
extern value_t **env_getaddr(env_t *, const char *);
#ifdef __cplusplus
}
#endif
#endif /* ENV_H_ */