mirror of https://github.com/tailix/libshmemq.git
Define basic data structures
This commit is contained in:
parent
d8ba048c35
commit
f8ec4af541
|
@ -1,2 +1,3 @@
|
|||
nobase_include_HEADERS = \
|
||||
shmemq.h \
|
||||
shmemq/dummy.h
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
#ifndef SHMEMQ_INCLUDED
|
||||
#define SHMEMQ_INCLUDED 1
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#define SHMEMQ_FRAME_SIZE ((size_t)8)
|
||||
|
||||
#define SHMEMQ_FRAME_DATA_SIZE \
|
||||
(SHMEMQ_FRAME_SIZE - sizeof(struct Shmemq_FrameHeader))
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct Shmemq_FrameHeader {
|
||||
size_t frame_size;
|
||||
};
|
||||
|
||||
struct Shmemq_Frame {
|
||||
struct Shmemq_FrameHeader header;
|
||||
unsigned char data[SHMEMQ_FRAME_DATA_SIZE];
|
||||
};
|
||||
|
||||
struct Shmemq_QueueHeader {
|
||||
size_t frames_count;
|
||||
size_t read_frame_index;
|
||||
size_t write_frame_index;
|
||||
};
|
||||
|
||||
struct Shmemq_Queue {
|
||||
struct Shmemq_QueueHeader header;
|
||||
struct Shmemq_Frame frames[];
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -2,6 +2,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <shmemq.h>
|
||||
#include <shmemq/dummy.h>
|
||||
|
||||
int main()
|
||||
|
|
Loading…
Reference in New Issue