diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-08-22 17:11:58 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2024-10-28 17:02:14 +0100 |
| commit | 39512e6f9b08f8057c6056473cb34bcbcf29af66 (patch) | |
| tree | b7404940e0cd34fca0d33afa34c1fa1c46d60dbc /exports/exports.go | |
| parent | 582c828d4473bc2a97d541b80fae19f8906e39a2 (diff) | |
Exports: Initial tests
Diffstat (limited to 'exports/exports.go')
| -rw-r--r-- | exports/exports.go | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/exports/exports.go b/exports/exports.go index f651c7f..511a1f9 100644 --- a/exports/exports.go +++ b/exports/exports.go @@ -14,47 +14,7 @@ package main /* -#include <stdint.h> -#include <stdlib.h> - -typedef long long int (*ReadRxBytes)(); - -typedef int (*StateCB)(int oldstate, int newstate, void* data); - -typedef void (*RefreshList)(); -typedef void (*TokenGetter)(const char* server_id, int server_type, char* out, size_t len); -typedef void (*TokenSetter)(const char* server_id, int server_type, const char* tokens); -typedef void (*ProxySetup)(int fd, const char* peer_ips); -typedef void (*ProxyReady)(); - -static long long int get_read_rx_bytes(ReadRxBytes read) -{ - return read(); -} -static int call_callback(StateCB callback, int oldstate, int newstate, void* data) -{ - return callback(oldstate, newstate, data); -} -static void call_refresh_list(RefreshList refresh) -{ - refresh(); -} -static void call_token_getter(TokenGetter getter, const char* server_id, int server_type, char* out, size_t len) -{ - getter(server_id, server_type, out, len); -} -static void call_token_setter(TokenSetter setter, const char* server_id, int server_type, const char* tokens) -{ - setter(server_id, server_type, tokens); -} -static void call_proxy_setup(ProxySetup proxysetup, int fd, const char* peer_ips) -{ - proxysetup(fd, peer_ips); -} -static void call_proxy_ready(ProxyReady ready) -{ - ready(); -} +#include "exports.h" */ import "C" |
