ffi.rs 711 B

123456789101112131415161718192021222324252627
  1. // Copyright (c) 2016-2018, The Tor Project, Inc. */
  2. // See LICENSE for licensing information */
  3. //! FFI functions to announce Rust support during tor startup, only to be
  4. //! called from C.
  5. //!
  6. use tor_log::{LogDomain, LogSeverity};
  7. /// Returns a short string to announce Rust support during startup.
  8. ///
  9. /// # Examples
  10. /// ```c
  11. /// char *rust_str = rust_welcome_string();
  12. /// printf("%s", rust_str);
  13. /// tor_free(rust_str);
  14. /// ```
  15. #[no_mangle]
  16. pub extern "C" fn rust_log_welcome_string() {
  17. tor_log_msg!(
  18. LogSeverity::Notice,
  19. LogDomain::General,
  20. "rust_log_welcome_string",
  21. "Tor is running with Rust integration. Please report \
  22. any bugs you encounter."
  23. );
  24. }