T-Box Basic dev
Loading...
Searching...
No Matches
property.h File Reference

T-Box 属性接口 More...

#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>

Go to the source code of this file.

Macros

#define TBOX_PROP_NAME_MAX   32
 属性键最大长度
#define TBOX_PROP_VALUE_MAX   256
 属性值最大长度
#define TBOX_PROP_BLOB_MAX   4096
 属性 blob 最大长度

Typedefs

typedef void(* property_callback_t) (const char *key, const char *value, void *arg)
 属性回调函数类型

Functions

int tbox_prop_init (void)
 初始化属性
int tbox_prop_clear (void)
 清空属性内存
int tbox_prop_set_bool (const char *key, bool value)
 设置布尔属性
int tbox_prop_get_bool (const char *key, bool *value, bool defaultValue)
 获取布尔属性
int tbox_prop_set_int (const char *key, int value)
 设置整数属性
int tbox_prop_get_int (const char *key, int *value, int defaultValue)
 获取整数属性
int tbox_prop_set_int64 (const char *key, int64_t value)
 设置64位整数属性
int tbox_prop_get_int64 (const char *key, int64_t *value, int64_t defaultValue)
 获取64位整数属性
int tbox_prop_set_string (const char *key, const char *value)
 设置字符串属性
int tbox_prop_get_string (const char *key, char *value, size_t *valueLen, const char *defaultValue)
 获取字符串属性
int tbox_prop_set_bytes (const char *key, const uint8_t *value, size_t valueLen)
 设置字节数组属性
int tbox_prop_get_bytes (const char *key, uint8_t *value, size_t *valueLen)
 获取字节数组属性
int tbox_prop_set_blob (const char *key, const uint8_t *value, size_t valueLen)
 设置 blob 属性(分片存入多个 property)
int tbox_prop_get_blob (const char *key, uint8_t *value, size_t *valueLen)
 获取 blob 属性
int tbox_prop_get_int_range (const char *key, int *value, int min, int max, int defaultValue)
 获取整数范围属性
int tbox_prop_get_lists (property_callback_t callback, void *arg)
 获取属性列表

Detailed Description

T-Box 属性接口

Author
HanG
Version
1.0.0
Date
2026-06-05