You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lokinet/include/lokinet/lokinet_context.h

54 lines
1.3 KiB
C

#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <unistd.h>
#ifdef __cplusplus
extern "C"
{
#endif
struct lokinet_context;
/// allocate a new lokinet context
struct lokinet_context*
lokinet_context_new();
/// free a context allocated by lokinet_context_new
void
lokinet_context_free(struct lokinet_context*);
/// spawn all the threads needed for operation and start running
/// return 0 on success
/// return non zero on fail
int
lokinet_context_start(struct lokinet_context*);
/// return 0 if we our endpoint has published on the network and is ready to send
/// return -1 if we don't have enough paths ready
/// retrun -2 if we look deadlocked
/// retrun -3 if context was null or not started yet
int
lokinet_status(struct lokinet_context*);
/// wait at most N milliseconds for lokinet to build paths and get ready
/// return 0 if we are ready
/// return nonzero if we are not ready
int
lokinet_wait_for_ready(int N, struct lokinet_context*);
/// stop all operations on this lokinet context
void
lokinet_context_stop(struct lokinet_context*);
/// load a bootstrap RC from memory
/// return 0 on success
/// return non zero on fail
int
lokinet_add_bootstrap_rc(const char*, size_t, struct lokinet_context*);
#ifdef __cplusplus
}
#endif