From 73020f7270ed43d4eb961dc44fae9ba12b061de2 Mon Sep 17 00:00:00 2001 From: Nathanne Isip Date: Mon, 10 Feb 2025 07:57:16 +0800 Subject: [PATCH] Initial net module package function implementations --- std/n8std/Net.cc | 33 +++++++++++++++++++++++++++++++++ std/n8std/Net.hpp | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 std/n8std/Net.cc create mode 100644 std/n8std/Net.hpp diff --git a/std/n8std/Net.cc b/std/n8std/Net.cc new file mode 100644 index 0000000..47a9042 --- /dev/null +++ b/std/n8std/Net.cc @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2024 - Nathanne Isip + * This file is part of N8. + * + * N8 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * N8 is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with N8. If not, see . + */ + +#include "n8std/Net.hpp" + +#include + +#include + +N8_FUNC(net_init) { + quoneq_net::init(); + return {}; +} + +N8_FUNC(net_deinit) { + quoneq_net::cleanup(); + return {}; +} diff --git a/std/n8std/Net.hpp b/std/n8std/Net.hpp new file mode 100644 index 0000000..dbd6d65 --- /dev/null +++ b/std/n8std/Net.hpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2025 - Nathanne Isip + * This file is part of N8. + * + * N8 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * N8 is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with N8. If not, see . + */ + +#ifndef N8_STDLIB_NET_CC +#define N8_STDLIB_NET_CC + +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wreturn-type-c-linkage" +#endif + +#include "N8Library.hpp" + +N8_LIB_START + +N8_FUNC(net_init); +N8_FUNC(net_deinit); + +N8_LIB_END + +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + +#endif