Tor  0.4.6.0-alpha-dev
typedvar.h
Go to the documentation of this file.
1 /* Copyright (c) 2001 Matej Pfajfar.
2  * Copyright (c) 2001-2004, Roger Dingledine.
3  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4  * Copyright (c) 2007-2020, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
7 /**
8  * @file typedvar.h
9  * @brief Header for lib/confmgt/typedvar.c
10  **/
11 
12 #ifndef TOR_LIB_CONFMGT_TYPEDVAR_H
13 #define TOR_LIB_CONFMGT_TYPEDVAR_H
14 
15 #include <stdbool.h>
16 
17 enum config_type_t;
18 struct config_line_t;
19 
20 typedef struct var_type_fns_t var_type_fns_t;
21 typedef struct var_type_def_t var_type_def_t;
22 
23 int typed_var_assign(void *target, const char *value, char **errmsg,
24  const var_type_def_t *def);
25 void typed_var_free(void *target, const var_type_def_t *def);
26 char *typed_var_encode(const void *value, const var_type_def_t *def);
27 int typed_var_copy(void *dest, const void *src, const var_type_def_t *def);
28 bool typed_var_eq(const void *a, const void *b, const var_type_def_t *def);
29 bool typed_var_ok(const void *value, const var_type_def_t *def);
30 
31 int typed_var_kvassign(void *target, const struct config_line_t *line,
32  char **errmsg, const var_type_def_t *def);
33 struct config_line_t *typed_var_kvencode(const char *key, const void *value,
34  const var_type_def_t *def);
35 
36 void typed_var_mark_fragile(void *value, const var_type_def_t *def);
37 
38 #endif /* !defined(TOR_LIB_CONFMGT_TYPEDVAR_H) */
typed_var_mark_fragile
void typed_var_mark_fragile(void *value, const var_type_def_t *def)
Definition: typedvar.c:228
typed_var_assign
int typed_var_assign(void *target, const char *value, char **errmsg, const var_type_def_t *def)
Definition: typedvar.c:44
typed_var_encode
char * typed_var_encode(const void *value, const var_type_def_t *def)
Definition: typedvar.c:111
typed_var_ok
bool typed_var_ok(const void *value, const var_type_def_t *def)
Definition: typedvar.c:211
var_type_def_t
Definition: var_type_def_st.h:146
typed_var_free
void typed_var_free(void *target, const var_type_def_t *def)
Definition: typedvar.c:95
config_type_t
config_type_t
Definition: conftypes.h:39
typed_var_kvencode
struct config_line_t * typed_var_kvencode(const char *key, const void *value, const var_type_def_t *def)
Definition: typedvar.c:129
typed_var_copy
int typed_var_copy(void *dest, const void *src, const var_type_def_t *def)
Definition: typedvar.c:154
typed_var_eq
bool typed_var_eq(const void *a, const void *b, const var_type_def_t *def)
Definition: typedvar.c:187
config_line_t
Definition: confline.h:29
var_type_fns_t
Definition: var_type_def_st.h:49
typed_var_kvassign
int typed_var_kvassign(void *target, const config_line_t *line, char **errmsg, const var_type_def_t *def)
Definition: typedvar.c:67