3
extern struct SN_env * SN_create_env(int S_size, int I_size, int B_size)
5
struct SN_env * z = (struct SN_env *) calloc(1, sizeof(struct SN_env));
6
if (z == NULL) return NULL;
8
if (z->p == NULL) goto error;
12
z->S = (symbol * *) calloc(S_size, sizeof(symbol *));
13
if (z->S == NULL) goto error;
15
for (i = 0; i < S_size; i++)
18
if (z->S[i] == NULL) goto error;
24
z->I = (int *) calloc(I_size, sizeof(int));
25
if (z->I == NULL) goto error;
30
z->B = (unsigned char *) calloc(B_size, sizeof(unsigned char));
31
if (z->B == NULL) goto error;
36
SN_close_env(z, S_size);
40
extern void SN_close_env(struct SN_env * z, int S_size)
42
if (z == NULL) return;
46
for (i = 0; i < S_size; i++)
54
if (z->p) lose_s(z->p);
58
extern int SN_set_current(struct SN_env * z, int size, const symbol * s)
60
int err = replace_s(z, 0, z->l, size, s, NULL);