mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-07-20 05:04:53 -04:00
32 lines
585 B
C
32 lines
585 B
C
#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
|