aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat_rust.h
blob: 752a29b56c911c52d0c391b3b49704389308b2d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* Copyright (c) 2017, The Tor Project, Inc. */
/* See LICENSE for licensing information */

/**
 * \file rust_compat.h
 * \brief Headers for rust_compat.c
 **/

#ifndef TOR_RUST_COMPAT_H
#define TOR_RUST_COMPAT_H

#include "torint.h"

/**
 * Strings allocated in Rust must be freed from Rust code again. Let's make
 * it less likely to accidentally mess up and call tor_free() on it, because
 * currently it'll just work but might break at any time.
 */
typedef uintptr_t rust_str_t;

void rust_str_free(rust_str_t);

const char *rust_str_get(const rust_str_t);

rust_str_t rust_welcome_string(void);

#endif