sse client to listen commands (from mapedit)

This commit is contained in:
Ondřej Novák 2025-05-07 17:46:51 +02:00
parent 13f6c05c60
commit bb5be10adc
10 changed files with 336 additions and 29 deletions

32
platform/mtqueue.h Normal file
View file

@ -0,0 +1,32 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
typedef struct tag_mtqueue MTQUEUE;
///Create multithread queue
MTQUEUE *mtqueue_create();
///push to queue (string is copied)
/**
* @param q queue
* @param message message (string is copied)
*/
void mtqueue_push(MTQUEUE *q, const char *message);
///pop from the queue
/**
*
* @param q queue
* @return NULL, if queue is empty, or string. You have to release
* string by calling free() when you finish.
*/
char *mtqueue_pop(MTQUEUE *q);
///destroy the queue
void mtqueue_destroy(MTQUEUE *q);
#ifdef __cplusplus
}
#endif