Squashed 'external/toxcore/c-toxcore/' changes from 67badf694..82460b212

82460b212 feat: add ngc events
24b54722a fix: Ensure we have allocators available for the error paths.
48dbcfebc cleanup: Remove redundant `-DSODIUM_EXPORT` from definitions.
0cef46ee9 cleanup: Fix a few more clang-tidy warnings.
0c5b918e9 cleanup: Fix a few more clang-tidy warnings.
4d3c97f49 cleanup: Enforce stricter identifier naming using clang-tidy.
a549807df refactor: Add `mem` module to allow tests to override allocators.
6133fb153 chore: Add devcontainer setup for codespaces.
620e07ecd chore: Set a timeout for tests started using Conan
c0ec33b16 chore: Migrate Windows CI from Appveyor to Azure DevOps
8ed47f3ef fix incorrect documentation
a1e245841 docs: Fix doxygen config and remove some redundant comments.
b0f633185 chore: Fix the Android CI job
7469a529b fix: Add missing `#include <array>`.
2b1a6b0d2 add missing ngc constants getter declarations and definitions
2e02d5637 chore: Add missing module dependencies.
REVERT: 67badf694 feat: add ngc events

git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: 82460b2124216af1ac9d63060de310a682a2fd15
This commit is contained in:
2023-10-10 19:37:39 +02:00
parent 227425b90e
commit a3126d581b
114 changed files with 2090 additions and 1653 deletions

View File

@ -14,6 +14,7 @@
#include <stdint.h> // uint*_t
#include "logger.h"
#include "mem.h"
#ifdef __cplusplus
extern "C" {
@ -533,7 +534,7 @@ void networking_poll(const Networking_Core *net, void *userdata);
* Return false on failure.
*/
non_null()
bool net_connect(const Logger *log, Socket sock, const IP_Port *ip_port);
bool net_connect(const Memory *mem, const Logger *log, Socket sock, const IP_Port *ip_port);
/** @brief High-level getaddrinfo implementation.
*
@ -549,11 +550,11 @@ bool net_connect(const Logger *log, Socket sock, const IP_Port *ip_port);
* @retval -1 on error.
*/
non_null()
int32_t net_getipport(const char *node, IP_Port **res, int tox_type);
int32_t net_getipport(const Memory *mem, const char *node, IP_Port **res, int tox_type);
/** Deallocates memory allocated by net_getipport */
nullable(1)
void net_freeipport(IP_Port *ip_ports);
non_null(1) nullable(2)
void net_freeipport(const Memory *mem, IP_Port *ip_ports);
/**
* @return true on success, false on failure.
@ -600,13 +601,13 @@ void net_kill_strerror(char *strerror);
*
* If error is non NULL it is set to 0 if no issues, 1 if socket related error, 2 if other.
*/
non_null(1, 2, 3) nullable(6)
non_null(1, 2, 3, 4) nullable(7)
Networking_Core *new_networking_ex(
const Logger *log, const Network *ns, const IP *ip,
const Logger *log, const Memory *mem, const Network *ns, const IP *ip,
uint16_t port_from, uint16_t port_to, unsigned int *error);
non_null()
Networking_Core *new_networking_no_udp(const Logger *log, const Network *ns);
Networking_Core *new_networking_no_udp(const Logger *log, const Memory *mem, const Network *ns);
/** Function to cleanup networking stuff (doesn't do much right now). */
nullable(1)