47 lines
891 B
C
47 lines
891 B
C
#ifndef __CONTEXT_H__
|
|
#define __CONTEXT_H__
|
|
|
|
#include <pthread.h>
|
|
|
|
#include "ptQueue/inc/ptQueue.h"
|
|
#include "wsServer/include/ws.h"
|
|
|
|
#include "linkedlist.h"
|
|
#include "sized_ptr.h"
|
|
|
|
#include "streamed.h"
|
|
#include "flatcc/flatcc_builder.h"
|
|
|
|
typedef struct {
|
|
SizedPtr* bufs;
|
|
uint8_t buffersCount;
|
|
_Atomic (uint8_t) readRequestIdx;
|
|
_Atomic (uint8_t) currWritingIdx;
|
|
} OutgoingBuffers;
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
uint8_t* emulState;
|
|
uint64_t* clockCounter;
|
|
LinkedListEntry** clientsHead;
|
|
uint8_t* utilizedFlag;
|
|
OutgoingBuffers* outBufs;
|
|
DeviceSegStreamReg** deviceStreamRegs;
|
|
uint8_t** devicesMem;
|
|
size_t devicesCount;
|
|
flatcc_builder_t stream_builder;
|
|
} EmulContext;
|
|
|
|
|
|
typedef struct {
|
|
pthread_mutex_t registerMutex;
|
|
ptQueue* regQueue;
|
|
uint8_t* accessToken;
|
|
EmulContext* emulContext;
|
|
} ServerContext;
|
|
|
|
|
|
|
|
#endif //ifndef __CONTEXT_H__
|