Merge branch 'tor-gitlab/mr/583' into maint-0.4.7
[tor.git] / src / lib / confmgt / structvar.h
blobf04fd62eb87ff6891df15e6c6f3020d10a48eff7
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 */
7 /**
8 * @file structvar.h
9 * @brief Header for lib/confmgt/structvar.c
10 **/
12 #ifndef TOR_LIB_CONFMGT_STRUCTVAR_H
13 #define TOR_LIB_CONFMGT_STRUCTVAR_H
15 struct struct_magic_decl_t;
16 struct struct_member_t;
17 struct config_line_t;
19 #include <stdbool.h>
20 #include "lib/cc/torint.h"
22 void struct_set_magic(void *object,
23 const struct struct_magic_decl_t *decl);
24 void struct_check_magic(const void *object,
25 const struct struct_magic_decl_t *decl);
27 void *struct_get_mptr(void *object,
28 const struct struct_member_t *member);
29 const void *struct_get_ptr(const void *object,
30 const struct struct_member_t *member);
32 void struct_var_free(void *object,
33 const struct struct_member_t *member);
34 int struct_var_copy(void *dest, const void *src,
35 const struct struct_member_t *member);
36 bool struct_var_eq(const void *a, const void *b,
37 const struct struct_member_t *member);
38 bool struct_var_ok(const void *object,
39 const struct struct_member_t *member);
40 void struct_var_mark_fragile(void *object,
41 const struct struct_member_t *member);
43 const char *struct_var_get_name(const struct struct_member_t *member);
44 const char *struct_var_get_typename(const struct struct_member_t *member);
45 uint32_t struct_var_get_flags(const struct struct_member_t *member);
47 int struct_var_kvassign(void *object, const struct config_line_t *line,
48 char **errmsg,
49 const struct struct_member_t *member);
50 struct config_line_t *struct_var_kvencode(
51 const void *object,
52 const struct struct_member_t *member);
54 #endif /* !defined(TOR_LIB_CONFMGT_STRUCTVAR_H) */