tqueue.h 1.7 KB
Newer Older
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
 *
 * This program is free software: you can use, redistribute, and/or modify
 * it under the terms of the GNU Affero General Public License, version 3
 * or later ("AGPL"), as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
16 17
#ifndef TAOS_QUEUE_H
#define TAOS_QUEUE_H
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
18 19 20 21 22

#ifdef __cplusplus
extern "C" {
#endif

陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
23 24 25
typedef void* taos_queue;
typedef void* taos_qset;
typedef void* taos_qall;
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
26

陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
27
taos_queue taosOpenQueue();
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
28
void       taosCloseQueue(taos_queue);
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
29 30 31 32
void      *taosAllocateQitem(int size);
void       taosFreeQitem(void *item);
int        taosWriteQitem(taos_queue, int type, void *item);
int        taosReadQitem(taos_queue, int *type, void **pitem);
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
33 34

int        taosReadAllQitems(taos_queue, taos_qall *);
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
35
int        taosGetQitem(taos_qall, int *type, void **pitem);
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
36 37 38 39 40
void       taosResetQitems(taos_qall);
void       taosFreeQitems(taos_qall);

taos_qset  taosOpenQset();
void       taosCloseQset();
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
41
int        taosAddIntoQset(taos_qset, taos_queue, void *ahandle);
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
42 43 44
void       taosRemoveFromQset(taos_qset, taos_queue);
int        taosGetQueueNumber(taos_qset);

陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
45 46
int        taosReadQitemFromQset(taos_qset, int *type, void **pitem, void **handle);
int        taosReadAllQitemsFromQset(taos_qset, taos_qall *, void **handle);
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
47 48 49

int        taosGetQueueItemsNumber(taos_queue param);
int        taosGetQsetItemsNumber(taos_qset param);
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
50 51 52 53 54

#ifdef __cplusplus
}
#endif

陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
55 56 57
#endif