mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Merge pull request #91 from nurupo/master
Added support of linkage with C++ code
This commit is contained in:
commit
e9e9a37867
|
@ -28,6 +28,10 @@
|
|||
|
||||
#include "net_crypto.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Current time, unix format */
|
||||
#define unix_time() ((uint32_t)time(NULL))
|
||||
|
||||
|
@ -112,4 +116,8 @@ int DHT_load(uint8_t * data, uint32_t size);
|
|||
returns 1 if we are */
|
||||
int DHT_isconnected();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -27,6 +27,9 @@
|
|||
|
||||
#include "network.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* maximum length of the data in the data packets */
|
||||
#define MAX_DATA_SIZE 1024
|
||||
|
@ -106,4 +109,8 @@ void doLossless_UDP();
|
|||
return 1 if it didn't handle the packet or if the packet was shit. */
|
||||
int LosslessUDP_handlepacket(uint8_t * packet, uint32_t length, IP_Port source);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -31,6 +31,10 @@
|
|||
#include "DHT.h"
|
||||
#include "friend_requests.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MAX_NAME_LENGTH 128
|
||||
#define MAX_USERSTATUS_LENGTH 128
|
||||
|
||||
|
@ -147,4 +151,8 @@ void Messenger_save(uint8_t * data);
|
|||
/* load the messenger from data of size length */
|
||||
int Messenger_load(uint8_t * data, uint32_t length);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
#include "DHT.h"
|
||||
#include "net_crypto.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Try to send a friendrequest to peer with public_key
|
||||
data is the data in the request and length is the length. */
|
||||
|
@ -29,6 +32,8 @@ int friendreq_handlepacket(uint8_t * packet, uint32_t length, IP_Port source);
|
|||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -26,6 +26,10 @@
|
|||
|
||||
#include "Lossless_UDP.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Our public key. */
|
||||
extern uint8_t self_public_key[crypto_box_PUBLICKEYBYTES];
|
||||
extern uint8_t self_secret_key[crypto_box_SECRETKEYBYTES];
|
||||
|
@ -129,5 +133,8 @@ void initNetCrypto();
|
|||
/* main loop */
|
||||
void doNetCrypto();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -65,6 +65,9 @@
|
|||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MAX_UDP_PACKET_SIZE 65507
|
||||
|
||||
|
@ -130,4 +133,9 @@ void shutdown_networking();
|
|||
on success returns a data in network byte order that can be used to set IP.i or IP_Port.ip.i
|
||||
on failure returns -1 */
|
||||
int resolve_addr(char *address);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user