summaryrefslogtreecommitdiff
path: root/src/cli_objects.h
blob: 8bbff64f2c0aade32c6eaa3e70c6957b5c8d5ee5 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef CLI_OBJ_H
#define CLI_OBJ_H

#include "cli_val.h"

#ifdef __cplusplus
extern "C" {
#endif

/* names of VYATTA env vars */
#define ENV_EDIT_LEVEL "VYATTA_EDIT_LEVEL"
#define ENV_TEMPLATE_LEVEL "VYATTA_TEMPLATE_LEVEL"
#define ENV_A_DIR "VYATTA_ACTIVE_CONFIGURATION_DIR"
#define ENV_C_DIR "VYATTA_CHANGES_ONLY_DIR"
#define ENV_M_DIR "VYATTA_TEMP_CONFIG_DIR"
#define ENV_T_DIR "VYATTA_CONFIG_TEMPLATE"
#define ENV_TMP_DIR "VYATTA_CONFIG_TMP"
#define DEF_A_DIR "/opt/vyatta/config/active"
#define DEF_T_DIR "/opt/vyatta/share/ofr/template"

/* the string to use as $(@), must be set 
   before call to expand_string */
char* get_at_string(void);
void free_at_string(void);

boolean is_in_delete_action(void);
boolean is_in_commit(void);
boolean is_in_exec(void);
void set_in_exec(boolean b);

valstruct* get_cli_value_ptr(void);

first_seg* get_f_seg_a_ptr(void);
first_seg* get_f_seg_c_ptr(void);
first_seg* get_f_seg_m_ptr(void);

const char* get_tdirp(void);
const char* get_cdirp(void);
const char* get_adirp(void);
const char* get_mdirp(void);
const char* get_tmpp(void);

void init_paths(boolean for_commit);

#ifdef __cplusplus
}
#endif

#endif /* CLI_OBJ_H */