luat_soc_sdk_2024 V1.0
luat_fskv.h
浏览该文件的文档.
1/*
2 * Copyright (c) 2022 OpenLuat & AirM2M
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy of
5 * this software and associated documentation files (the "Software"), to deal in
6 * the Software without restriction, including without limitation the rights to
7 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8 * the Software, and to permit persons to whom the Software is furnished to do so,
9 * subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in all
12 * copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 */
21
22#ifndef LUAT_FSKV_H
23#define LUAT_FSKV_H
24
25#include "lfs.h"
26
27
28
40
46int luat_fskv_del(const char* key);
47
55int luat_fskv_set(const char* key, void* data, size_t len);
56
63int luat_fskv_size(const char* key, char buff[4]);
64
72int luat_fskv_get(const char* key, void* data, size_t len);
73
86int luat_fskv_stat(size_t *using_sz, size_t *max_sz, size_t *kv_count);
93int luat_fskv_next(char* buff, size_t offset);
94
99#endif
int luat_fskv_next(char *buff, size_t offset)
读取下一个偏移的数据
int luat_fskv_init(void)
初始化kv数据存储
int luat_fskv_stat(size_t *using_sz, size_t *max_sz, size_t *kv_count)
获取kv数据库状态
int luat_fskv_del(const char *key)
删除指定的key
int luat_fskv_clear(void)
清空所有数据
int luat_fskv_get(const char *key, void *data, size_t len)
读取指定key的数据
int luat_fskv_set(const char *key, void *data, size_t len)
写入指定key的数据
int luat_fskv_size(const char *key, char buff[4])
读取key大小