toxcore/toxcore/tox_private.h
zoff99 cdafc6ff5e
Add new semi-private API functions to set per-packet-id custom handlers.
This is to prepare for ToxAV becoming independent of toxcore internal calls.
2020-04-16 12:28:13 +00:00

45 lines
1.2 KiB
C

/* SPDX-License-Identifier: GPL-3.0-or-later
* Copyright © 2016-2020 The TokTok team.
* Copyright © 2013 Tox project.
*/
#ifndef C_TOXCORE_TOXCORE_TOX_PRIVATE_H
#define C_TOXCORE_TOXCORE_TOX_PRIVATE_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Set the callback for the `friend_lossy_packet` event for a specific packet ID.
* Pass NULL to unset.
*
* allowed packet ID range:
* from `PACKET_ID_RANGE_LOSSY_START` to `PACKET_ID_RANGE_LOSSY_END` (both inclusive)
*/
void tox_callback_friend_lossy_packet_per_pktid(Tox *tox, tox_friend_lossy_packet_cb *callback, uint8_t pktid);
/**
* Set the callback for the `friend_lossless_packet` event for a specific packet ID.
* Pass NULL to unset.
*
* allowed packet ID range:
* from `PACKET_ID_RANGE_LOSSLESS_CUSTOM_START` to `PACKET_ID_RANGE_LOSSLESS_CUSTOM_END` (both inclusive)
* and
* `PACKET_ID_MSI`
*/
void tox_callback_friend_lossless_packet_per_pktid(Tox *tox, tox_friend_lossless_packet_cb *callback, uint8_t pktid);
void tox_set_av_object(Tox *tox, void *object);
void *tox_get_av_object(const Tox *tox);
#ifdef __cplusplus
}
#endif
#endif // C_TOXCORE_TOXCORE_TOX_PRIVATE_H