tor  0.4.2.1-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-2019, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
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) */
int typed_var_copy(void *dest, const void *src, const var_type_def_t *def)
Definition: typedvar.c:145
struct config_line_t * typed_var_kvencode(const char *key, const void *value, const var_type_def_t *def)
Definition: typedvar.c:120
int typed_var_assign(void *target, const char *value, char **errmsg, const var_type_def_t *def)
Definition: typedvar.c:43
void typed_var_free(void *target, const var_type_def_t *def)
Definition: typedvar.c:86
char * typed_var_encode(const void *value, const var_type_def_t *def)
Definition: typedvar.c:102
bool typed_var_eq(const void *a, const void *b, const var_type_def_t *def)
Definition: typedvar.c:178
bool typed_var_ok(const void *value, const var_type_def_t *def)
Definition: typedvar.c:202
int typed_var_kvassign(void *target, const config_line_t *line, char **errmsg, const var_type_def_t *def)
Definition: typedvar.c:66
config_type_t
Definition: conftypes.h:39
void typed_var_mark_fragile(void *value, const var_type_def_t *def)
Definition: typedvar.c:219