forked from cory/tildefriends
android: Fix some crashes, callstacks, and warnings I'm seeing in the logs.
This commit is contained in:
@@ -23,6 +23,12 @@ typedef struct _tf_packetstream_t tf_packetstream_t;
|
||||
*/
|
||||
typedef void(tf_packetstream_onreceive_t)(int packet_type, const char* begin, size_t length, void* user_data);
|
||||
|
||||
/**
|
||||
** A function called when a packetstream reads EOF.
|
||||
** @param user_data User data.
|
||||
*/
|
||||
typedef void(tf_packetstream_on_close_t)(void* user_data);
|
||||
|
||||
/**
|
||||
** Create a packet stream.
|
||||
** @return The packet stream.
|
||||
@@ -58,6 +64,14 @@ void tf_packetstream_send(tf_packetstream_t* stream, int packet_type, const char
|
||||
*/
|
||||
void tf_packetstream_set_on_receive(tf_packetstream_t* stream, tf_packetstream_onreceive_t* callback, void* user_data);
|
||||
|
||||
/**
|
||||
** Register a callback for when a stream reads EOF.
|
||||
** @param stream The packet stream.
|
||||
** @param callback The callback.
|
||||
** @param user_data User data to pass to the callback.
|
||||
*/
|
||||
void tf_packetstream_set_on_close(tf_packetstream_t* stream, tf_packetstream_on_close_t* callback, void* user_data);
|
||||
|
||||
/**
|
||||
** Close a packet stream.
|
||||
** @param stream The packet stream.
|
||||
|
Reference in New Issue
Block a user