ex
Fork of mbed-os-example-mbed5-blinky by
DuerOS-Light-SDK-v1.1.0/duer-os-light/src/iot-baidu-ca-scheduler/baidu_util_list.h@47:9e361da97763, 2017-07-18 (annotated)
- Committer:
- TMBOY
- Date:
- Tue Jul 18 16:54:45 2017 +0800
- Revision:
- 47:9e361da97763
?
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| TMBOY | 47:9e361da97763 | 1 | // Copyright 2017 Baidu Inc. All Rights Reserved. |
| TMBOY | 47:9e361da97763 | 2 | // Author: Su Hao (suhao@baidu.com) |
| TMBOY | 47:9e361da97763 | 3 | // |
| TMBOY | 47:9e361da97763 | 4 | // Description: baidu_util_list |
| TMBOY | 47:9e361da97763 | 5 | |
| TMBOY | 47:9e361da97763 | 6 | #ifndef BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SCHEDULER_BAIDU_UTIL_LIST_H |
| TMBOY | 47:9e361da97763 | 7 | #define BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SCHEDULER_BAIDU_UTIL_LIST_H |
| TMBOY | 47:9e361da97763 | 8 | |
| TMBOY | 47:9e361da97763 | 9 | #ifdef __cplusplus |
| TMBOY | 47:9e361da97763 | 10 | extern "C" { |
| TMBOY | 47:9e361da97763 | 11 | #endif |
| TMBOY | 47:9e361da97763 | 12 | |
| TMBOY | 47:9e361da97763 | 13 | typedef void* bu_list_t; |
| TMBOY | 47:9e361da97763 | 14 | |
| TMBOY | 47:9e361da97763 | 15 | typedef enum { |
| TMBOY | 47:9e361da97763 | 16 | BU_NO_ERR, |
| TMBOY | 47:9e361da97763 | 17 | BU_ERR_UNEXPECTED = -10000, |
| TMBOY | 47:9e361da97763 | 18 | BU_ERR_INVALID_PARAMETER, |
| TMBOY | 47:9e361da97763 | 19 | BU_ERR_MEMORY_OVERLOW, |
| TMBOY | 47:9e361da97763 | 20 | BU_ERR_NODE_EXISTS, |
| TMBOY | 47:9e361da97763 | 21 | } bu_errors_t; |
| TMBOY | 47:9e361da97763 | 22 | |
| TMBOY | 47:9e361da97763 | 23 | bu_list_t baidu_util_list_create(void); |
| TMBOY | 47:9e361da97763 | 24 | |
| TMBOY | 47:9e361da97763 | 25 | int baidu_util_list_append(bu_list_t list, void* data); |
| TMBOY | 47:9e361da97763 | 26 | |
| TMBOY | 47:9e361da97763 | 27 | int baidu_util_list_is_empty(bu_list_t list); |
| TMBOY | 47:9e361da97763 | 28 | |
| TMBOY | 47:9e361da97763 | 29 | void* baidu_util_list_get(bu_list_t list, int index); |
| TMBOY | 47:9e361da97763 | 30 | |
| TMBOY | 47:9e361da97763 | 31 | void* baidu_util_list_remove(bu_list_t list, int index); |
| TMBOY | 47:9e361da97763 | 32 | |
| TMBOY | 47:9e361da97763 | 33 | int baidu_util_list_destroy(bu_list_t list); |
| TMBOY | 47:9e361da97763 | 34 | |
| TMBOY | 47:9e361da97763 | 35 | #ifdef __cplusplus |
| TMBOY | 47:9e361da97763 | 36 | } |
| TMBOY | 47:9e361da97763 | 37 | #endif |
| TMBOY | 47:9e361da97763 | 38 | |
| TMBOY | 47:9e361da97763 | 39 | #endif // BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SCHEDULER_BAIDU_UTIL_LIST_H |
