/*
 * Copyright (C) 2020-2020 ikonke
 */



#ifndef _DM_QUEUE_H_
#define _DM_QUEUE_H_

#include "iotx_dm.h"
#include "klist.h"

typedef struct {
    //iotx_dm_event_types_t type;
    char* chalMark[30];
    char *data;
} dm_queue_msg_t;

typedef struct {
    void *data;
    struct list_head linked_list;
} dm_queue_msg_node_t;

typedef struct {
    int max_size;
    int size;
    struct list_head message_list;
} dm_queue_msg_list_t;

typedef struct {
    void *mutex;
    void *mutex2;
    void *mutex3;
    dm_queue_msg_list_t msg_list;
    dm_queue_msg_list_t msg_list2;
    dm_queue_msg_list_t msg_list3;
} dm_queue_t;

int dm_queue_init(int max_size);
void dm_queue_deinit(void);
int dm_queue_msg_insert(void *data);
int dm_queue_msg_next(void **data);

#endif
