Tor  0.4.7.0-alpha-dev
structvar.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 structvar.h
9  * @brief Header for lib/confmgt/structvar.c
10  **/
11 
12 #ifndef TOR_LIB_CONFMGT_STRUCTVAR_H
13 #define TOR_LIB_CONFMGT_STRUCTVAR_H
14 
15 struct struct_magic_decl_t;
16 struct struct_member_t;
17 struct config_line_t;
18 
19 #include <stdbool.h>
20 #include "lib/cc/torint.h"
21 
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);
26 
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);
31 
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);
42 
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);
46 
47 int struct_var_kvassign(void *object, const struct config_line_t *line,
48  char **errmsg,
49  const struct struct_member_t *member);
51  const void *object,
52  const struct struct_member_t *member);
53 
54 #endif /* !defined(TOR_LIB_CONFMGT_STRUCTVAR_H) */
void struct_set_magic(void *object, const struct_magic_decl_t *decl)
Definition: structvar.c:48
const void * struct_get_ptr(const void *object, const struct_member_t *member)
Definition: structvar.c:94
const char * struct_var_get_typename(const struct_member_t *member)
Definition: structvar.c:225
void * struct_get_mptr(void *object, const struct_member_t *member)
Definition: structvar.c:83
void struct_check_magic(const void *object, const struct_magic_decl_t *decl)
Definition: structvar.c:63
bool struct_var_eq(const void *a, const void *b, const struct_member_t *member)
Definition: structvar.c:145
int struct_var_kvassign(void *object, const struct config_line_t *line, char **errmsg, const struct_member_t *member)
Definition: structvar.c:172
int struct_var_copy(void *dest, const void *src, const struct_member_t *member)
Definition: structvar.c:131
void struct_var_free(void *object, const struct_member_t *member)
Definition: structvar.c:118
void struct_var_mark_fragile(void *object, const struct_member_t *member)
Definition: structvar.c:201
bool struct_var_ok(const void *object, const struct_member_t *member)
Definition: structvar.c:159
struct config_line_t * struct_var_kvencode(const void *object, const struct_member_t *member)
Definition: structvar.c:187
uint32_t struct_var_get_flags(const struct_member_t *member)
Definition: structvar.c:234
const char * struct_var_get_name(const struct_member_t *member)
Definition: structvar.c:212
Integer definitions used throughout Tor.