Common process - adapter the semaphore api provide by OS
更多...
#include "tuya_cloud_types.h"
浏览源代码.
Common process - adapter the semaphore api provide by OS
- 版本
- 0.1
- 日期
- 2020-11-09
- 版权所有
- Copyright 2021-2030 Tuya Inc. All Rights Reserved.
◆ tkl_system_calloc()
| VOID_T * tkl_system_calloc |
( |
size_t |
nitems, |
|
|
size_t |
size |
|
) |
| |
Allocate and clear the memory
- 参数
-
| [in] | nitems | the numbers of memory block |
| [in] | size | the size of the memory block |
- 返回
- the memory address calloced
◆ tkl_system_free()
| VOID_T tkl_system_free |
( |
VOID_T * |
ptr | ) |
|
Free memory of system
- 参数
-
- 注解
- This API is used to free memory of system.
- 返回
- VOID_T
◆ tkl_system_get_free_heap_size()
| INT_T tkl_system_get_free_heap_size |
( |
VOID_T |
| ) |
|
Get system free heap size
- 参数
-
- 返回
- heap size
◆ tkl_system_malloc()
| VOID_T * tkl_system_malloc |
( |
SIZE_T |
size | ) |
|
Alloc memory of system
- 参数
-
- 注解
- This API is used to alloc memory of system.
- 返回
- the memory address malloced
◆ tkl_system_memcmp()
| INT_T tkl_system_memcmp |
( |
CONST VOID_T * |
str1, |
|
|
CONST VOID_T * |
str2, |
|
|
SIZE_T |
n |
|
) |
| |
Compare the first n bytes of store str1 and store str2
- 参数
-
| [in] | str1 | point to string1 |
| [in] | str2 | point to string2 |
| [in] | n | first n bytes |
- 注解
- This API is used to compare two strings
- 返回
- value < 0: str1 is less than str2; value > 0: str1 is greater than str2; value = 0: str1 is equal to str2;
◆ tkl_system_memcpy()
| VOID_T * tkl_system_memcpy |
( |
VOID_T * |
dst, |
|
|
CONST VOID_T * |
src, |
|
|
SIZE_T |
n |
|
) |
| |
Alloc memory of system
- 参数
-
- 注解
- This API is used to alloc memory of system.
- 返回
- the memory address malloced
◆ tkl_system_memset()
| VOID_T * tkl_system_memset |
( |
VOID_T * |
src, |
|
|
INT_T |
ch, |
|
|
SIZE_T |
n |
|
) |
| |
set memory
- 参数
-
- 注解
- This API is used to alloc memory of system.
- 返回
- the memory address malloced
◆ tkl_system_realloc()
| VOID_T * tkl_system_realloc |
( |
VOID_T * |
ptr, |
|
|
size_t |
size |
|
) |
| |
Re-allocate the memory
- 参数
-
| [in] | nitems | source memory address |
| [in] | size | the size after re-allocate |
- 返回
- VOID_T