summaryrefslogtreecommitdiff
path: root/src/or/protover_rust.c
diff options
context:
space:
mode:
authorChelsea Holland Komlo <me@chelseakomlo.com>2017-10-11 15:21:20 -0400
committerNick Mathewson <nickm@torproject.org>2017-10-27 10:02:08 -0400
commitbe583a34a3815c2c10e86094ab0610e4b7f9c869 (patch)
treebe9ffef37a21f54a81e628c1911c9171bbeef202 /src/or/protover_rust.c
parent0c04b54d4d78f7f3117948358b3d05e644fa1aeb (diff)
downloadtor-be583a34a3815c2c10e86094ab0610e4b7f9c869.tar.gz
tor-be583a34a3815c2c10e86094ab0610e4b7f9c869.zip
use tor allocator for string allocation in rust
Diffstat (limited to 'src/or/protover_rust.c')
-rw-r--r--src/or/protover_rust.c92
1 files changed, 0 insertions, 92 deletions
diff --git a/src/or/protover_rust.c b/src/or/protover_rust.c
index 261555d1ec..27f19c5fea 100644
--- a/src/or/protover_rust.c
+++ b/src/or/protover_rust.c
@@ -9,103 +9,11 @@
#include "or.h"
#include "protover.h"
-#include "rust_types.h"
#ifdef HAVE_RUST
-int rust_protover_all_supported(const char *s, char **missing);
-rust_str_ref_t rust_protover_compute_for_old_tor(const char *version);
-rust_str_ref_t rust_protover_compute_vote(const smartlist_t *proto_votes,
- int threshold);
-rust_str_ref_t rust_protover_get_supported_protocols(void);
-int rust_protocol_list_supports_protocol(const char *list, protocol_type_t tp,
- uint32_t version);
-int rust_protover_is_supported_here(protocol_type_t pr, uint32_t ver);
-
/* Define for compatibility, used in main.c */
void protover_free_all(void) {};
-/*
- * Wrap rust_protover_is_supported_here, located in /src/rust/protover
- */
-int
-protover_is_supported_here(protocol_type_t pr, uint32_t ver)
-{
- return rust_protover_is_supported_here(pr, ver);
-}
-
-/*
- * Wrap rust_protover_list_supports_protocol, located in /src/rust/protover
- */
-int
-protocol_list_supports_protocol(const char *list, protocol_type_t tp,
- uint32_t version)
-{
- return rust_protocol_list_supports_protocol(list, tp, version);
-}
-
-/*
- * Wrap rust_protover_get_supported_protocols, located in /src/rust/protover
- */
-const char *
-protover_get_supported_protocols(void)
-{
- rust_str_ref_t rust_protocols = rust_protover_get_supported_protocols();
-
- char *protocols = NULL;
- if (rust_protocols != NULL) {
- move_rust_str_to_c_and_free(rust_protocols, &protocols);
- }
- return protocols;
-}
-
-/*
- * Wrap rust_protover_compute_vote, located in /src/rust/protover
- */
-char *
-protover_compute_vote(const smartlist_t *proto_strings,
- int threshold)
-{
- rust_str_ref_t rust_protocols = rust_protover_compute_vote(proto_strings,
- threshold);
-
- char *protocols = NULL;
- if (rust_protocols != NULL) {
- move_rust_str_to_c_and_free(rust_protocols, &protocols);
- }
- return protocols;
-}
-
-/*
- * Wrap rust_protover_all_supported, located in /src/rust/protover
- */
-int
-protover_all_supported(const char *s, char **missing_out)
-{
- rust_str_ref_t missing_out_copy = NULL;
- int is_supported = rust_protover_all_supported(s, &missing_out_copy);
-
- if (!is_supported && missing_out_copy != NULL) {
- move_rust_str_to_c_and_free(missing_out_copy, missing_out);
- }
-
- return is_supported;
-}
-
-/*
- * Wrap rust_compute_for_old_tor, located in /src/rust/protover
- */
-const char *
-protover_compute_for_old_tor(const char *version)
-{
- rust_str_ref_t rust_protocols = rust_protover_compute_for_old_tor(version);
-
- char *protocols = NULL;
- if (rust_protocols != NULL) {
- move_rust_str_to_c_and_free(rust_protocols, &protocols);
- }
- return protocols;
-}
-
#endif