protover_rust.c 787 B

12345678910111213141516171819202122232425262728293031323334
  1. /* Copyright (c) 2016-2019, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. /*
  4. * \file protover_rust.c
  5. * \brief Provide a C wrapper for functions exposed in /src/rust/protover,
  6. * and safe translation/handling between the Rust/C boundary.
  7. */
  8. #include "core/or/or.h"
  9. #include "core/or/protover.h"
  10. #ifdef HAVE_RUST
  11. /* Define for compatibility, used in main.c */
  12. void
  13. protover_free_all(void)
  14. {
  15. }
  16. int protover_contains_long_protocol_names_(const char *s);
  17. /**
  18. * Return true if the unparsed protover in <b>s</b> would contain a protocol
  19. * name longer than MAX_PROTOCOL_NAME_LENGTH, and false otherwise.
  20. */
  21. bool
  22. protover_contains_long_protocol_names(const char *s)
  23. {
  24. return protover_contains_long_protocol_names_(s) != 0;
  25. }
  26. #endif /* defined(HAVE_RUST) */