diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-19 16:19:01 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-19 16:19:01 +0200 |
| commit | abe3588e56850403f7ebaf3c9090552e5f4830c6 (patch) | |
| tree | 2e9301bed577ca3d711361f255df43cd46a097da /exports/servers.go | |
| parent | 5f2e7ef988ac1267fe5038419b19b0154f9d5a84 (diff) | |
Exports: Simplify building
- Remove subdir c
- Do not compile c code as a separate shared library
- Move all definitions/declarations into the preamble as they shouldn't be shared anyways. So no headers are needed
- Define the callback as static, needed so we don't get a duplicate declaration
Diffstat (limited to 'exports/servers.go')
| -rw-r--r-- | exports/servers.go | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/exports/servers.go b/exports/servers.go index d33ac1f..2dfb14b 100644 --- a/exports/servers.go +++ b/exports/servers.go @@ -1,9 +1,50 @@ package main /* -// for free +// for free and size_t #include <stdlib.h> -#include "c/servers.h" + +// The struct for a single server profile +typedef struct serverProfile { + const char* id; + const char* display_name; + //const char* proto_list; + int default_gateway; +} serverProfile; + +// The struct for all server profiles +typedef struct serverProfiles { + int current; + serverProfile** profiles; + size_t total_profiles; +} serverProfiles; + +// The struct for server locations +typedef struct serverLocations { + const char** locations; + size_t total_locations; +} serverLocations; + +// The struct for a single server +typedef struct server { + const char* identifier; + const char* display_name; + const char* server_type; + const char* country_code; + const char** support_contact; + size_t total_support_contact; + serverProfiles* profiles; + unsigned long long int expire_time; +} server; + +// The struct for all servers +typedef struct servers { + server** custom_servers; + size_t total_custom; + server** institute_servers; + size_t total_institute; + server* secure_internet_server; +} servers; */ import "C" |
