feat: add C & Zig bindings for socket

This commit is contained in:
CJ van den Berg 2026-03-02 19:02:50 +00:00
parent e19ff271d0
commit d1cb42d53c
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
11 changed files with 209 additions and 13 deletions

19
test/socket_c_api.cpp Normal file
View file

@ -0,0 +1,19 @@
#include "tests.hpp"
#include <thespian/c/socket.h>
using namespace thespian;
// simple smoke test of socket C API: create + destroy handles
auto socket_c_api(thespian::context &ctx, bool &result, thespian::env_t env)
-> thespian::result {
(void)ctx;
(void)env;
// socket requires a valid file descriptor; we can't really test much
// without one. Just test that the API is accessible (no linking errors).
// actual socket operations would need a real FD from a socket/pipe/etc.
result = true;
return ok();
}