Tor  0.4.7.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-2021, 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) */
config_type_t
Definition: conftypes.h:39
int typed_var_kvassign(void *target, const config_line_t *line, char **errmsg, const var_type_def_t *def)
Definition: typedvar.c:67
void typed_var_mark_fragile(void *value, const var_type_def_t *def)
Definition: typedvar.c:228
void typed_var_free(void *target, const var_type_def_t *def)
Definition: typedvar.c:95
struct config_line_t * typed_var_kvencode(const char *key, const void *value, const var_type_def_t *def)
Definition: typedvar.c:129
bool typed_var_eq(const void *a, const void *b, const var_type_def_t *def)
Definition: typedvar.c:187
int typed_var_assign(void *target, const char *value, char **errmsg, const var_type_def_t *def)
Definition: typedvar.c:44
bool typed_var_ok(const void *value, const var_type_def_t *def)
Definition: typedvar.c:211
char * typed_var_encode(const void *value, const var_type_def_t *def)
Definition: typedvar.c:111
int typed_var_copy(void *dest, const void *src, const var_type_def_t *def)
Definition: typedvar.c:154