tor-coccinelle.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. * This file looks like a C header, but its purpose is a bit different.
  8. *
  9. * We never include it from our real C files; we only tell Coccinelle
  10. * about it in apply.sh.
  11. *
  12. * It tells the Coccinelle semantic patching tool how to understand
  13. * things that would otherwise not be good C syntax, or which would
  14. * otherwise not make sense to it as C. It doesn't need to produce
  15. * semantically equivalent C, or even correct C: it only has to produce
  16. * syntactically valid C.
  17. */
  18. #define MOCK_DECL(a, b, c) a b c
  19. #define MOCK_IMPL(a, b, c) a b c
  20. #define CHECK_PRINTF(a, b)
  21. #define CHECK_SCANF(a, b)
  22. #define STATIC static
  23. #define EXTERN(a,b) extern a b;
  24. #define STMT_BEGIN do {
  25. #define STMT_END } while (0)
  26. #define BUG(x) (x)
  27. #define IF_BUG_ONCE(x) if (x)
  28. #define ATTR_NORETURN
  29. #define ATTR_UNUSED
  30. #define ATTR_CONST
  31. #define ATTR_MALLOC
  32. #define ATTR_WUR
  33. #define DISABLE_GCC_WARNING(x)
  34. #define ENABLE_GCC_WARNING(x)
  35. #define HANDLE_DECL(a,b,c)
  36. #define HANDLE_IMPL(a,b,c)
  37. #define HT_ENTRY(x) void *
  38. #define HT_HEAD(a,b) struct ht_head
  39. #define HT_INITIALIZER() { }
  40. #define X509 struct x509_st
  41. #define STACK_OF(x) struct foo_stack_t
  42. #define TOR_TAILQ_HEAD(a,b) struct tailq_head
  43. #define TOR_TAILQ_ENTRY(a) struct tailq_entry
  44. #define TOR_SIMPLEQ_HEAD(a,b) struct simpleq_entry
  45. #define TOR_SIMPLEQ_ENTRY(a) struct simpleq_entry
  46. #define TOR_LIST_HEAD(a,b) struct list_head
  47. #define TOR_LIST_ENTRY(a) struct list_entry
  48. #define TOR_SLIST_HEAD(a,b) struct slist_head
  49. #define TOR_SLIST_ENTRY(a) struct slist_entry
  50. #define NS_DECL(a, b, c) a b c
  51. #define NS(a) a
  52. #define CONF_TEST_MEMBERS(a,b,c)
  53. #define DUMMY_CONF_TEST_MEMBERS
  54. #define EAT_SEMICOLON extern int dummy__;