aboutsummaryrefslogtreecommitdiff
path: root/src/env.h
blob: 3415410e1685983cc82e63f8e5f68d69406ef91a (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
#ifndef ENV_H
#define ENV_H

#include "list.h"

// #include "value.h"
typedef struct value * _value_t;

typedef struct env * env_t;
#define ENV_EMPTY NULL

enum env_kv_flag {
    ENV_KV_FREE_KEY     = 1,
    ENV_KV_CIRCULAR_REF = 2
};

env_t env_create(env_t parent);
void env_destroy(env_t env);

int env_insert(env_t env, char *key, _value_t value,
               _value_t *prevval, int flags);
int env_query(env_t env, char *key, _value_t *data);

env_t env_copy(env_t env);

#endif