tqueue.h 1.8 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 35 36
taos_qall  taosAllocateQall();
void       taosFreeQall(taos_qall);
int        taosReadAllQitems(taos_queue, taos_qall);
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
37
int        taosGetQitem(taos_qall, int *type, void **pitem);
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
38 39 40 41
void       taosResetQitems(taos_qall);

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

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

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

#ifdef __cplusplus
}
#endif

陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
57 58 59
#endif