structvar.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. /**
  7. * @file structvar.h
  8. * @brief Header for lib/confmgt/structvar.c
  9. **/
  10. #ifndef TOR_LIB_CONFMGT_STRUCTVAR_H
  11. #define TOR_LIB_CONFMGT_STRUCTVAR_H
  12. struct struct_magic_decl_t;
  13. struct struct_member_t;
  14. struct config_line_t;
  15. #include <stdbool.h>
  16. #include "lib/cc/torint.h"
  17. void struct_set_magic(void *object,
  18. const struct struct_magic_decl_t *decl);
  19. void struct_check_magic(const void *object,
  20. const struct struct_magic_decl_t *decl);
  21. void *struct_get_mptr(void *object,
  22. const struct struct_member_t *member);
  23. const void *struct_get_ptr(const void *object,
  24. const struct struct_member_t *member);
  25. void struct_var_free(void *object,
  26. const struct struct_member_t *member);
  27. int struct_var_copy(void *dest, const void *src,
  28. const struct struct_member_t *member);
  29. bool struct_var_eq(const void *a, const void *b,
  30. const struct struct_member_t *member);
  31. bool struct_var_ok(const void *object,
  32. const struct struct_member_t *member);
  33. void struct_var_mark_fragile(void *object,
  34. const struct struct_member_t *member);
  35. const char *struct_var_get_name(const struct struct_member_t *member);
  36. const char *struct_var_get_typename(const struct struct_member_t *member);
  37. uint32_t struct_var_get_flags(const struct struct_member_t *member);
  38. int struct_var_kvassign(void *object, const struct config_line_t *line,
  39. char **errmsg,
  40. const struct struct_member_t *member);
  41. struct config_line_t *struct_var_kvencode(
  42. const void *object,
  43. const struct struct_member_t *member);
  44. #endif /* !defined(TOR_LIB_CONFMGT_STRUCTVAR_H) */