tor  0.4.2.1-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-2019, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
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) */
bool struct_var_ok(const void *object, const struct_member_t *member)
Definition: structvar.c:141
const void * struct_get_ptr(const void *object, const struct_member_t *member)
Definition: structvar.c:76
const char * struct_var_get_name(const struct_member_t *member)
Definition: structvar.c:194
uint32_t struct_var_get_flags(const struct_member_t *member)
Definition: structvar.c:216
Integer definitions used throughout Tor.
struct config_line_t * struct_var_kvencode(const void *object, const struct_member_t *member)
Definition: structvar.c:169
void * struct_get_mptr(void *object, const struct_member_t *member)
Definition: structvar.c:65
const char * struct_var_get_typename(const struct_member_t *member)
Definition: structvar.c:207
int struct_var_kvassign(void *object, const struct config_line_t *line, char **errmsg, const struct_member_t *member)
Definition: structvar.c:154
int struct_var_copy(void *dest, const void *src, const struct_member_t *member)
Definition: structvar.c:113
void struct_var_mark_fragile(void *object, const struct_member_t *member)
Definition: structvar.c:183
bool struct_var_eq(const void *a, const void *b, const struct_member_t *member)
Definition: structvar.c:127
void struct_var_free(void *object, const struct_member_t *member)
Definition: structvar.c:100
void struct_check_magic(const void *object, const struct_magic_decl_t *decl)
Definition: structvar.c:48
void struct_set_magic(void *object, const struct_magic_decl_t *decl)
Definition: structvar.c:36