70 lines
2.9 KiB
C
70 lines
2.9 KiB
C
/*----------------------------------------------------------------------------
|
|
* Copyright (c) Fenda Technologies Co., Ltd. 2021. All rights reserved.
|
|
*
|
|
* Description: fs_api_ext.h
|
|
*
|
|
* Author: saimen
|
|
*
|
|
* Create: 2024-06-28
|
|
*--------------------------------------------------------------------------*/
|
|
#ifndef FS_API_EXT_H
|
|
#define FS_API_EXT_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
|
|
//base
|
|
// int tjd_fs_api_create_lock(void);
|
|
// int tjd_fs_api_mount(void);
|
|
// int tjd_fs_api_format(void);
|
|
// int tjd_fs_api_unmount(void);
|
|
// unsigned int tjd_fs_api_used(void);
|
|
// unsigned int tjd_fs_api_unused(void);
|
|
// unsigned int tjd_fs_api_total(void);
|
|
// int tjd_fs_api_stat(const char *path, bool *isDir);
|
|
// int tjd_fs_api_file_open(const char *path, int flags, lfs_file_t *file);
|
|
// int tjd_fs_api_file_close(lfs_file_t *file);
|
|
// int tjd_fs_api_file_write(lfs_file_t *file, void *buffer, uint32_t size);
|
|
// int tjd_fs_api_file_read(lfs_file_t *file, void *buffer, uint32_t size);
|
|
// int tjd_fs_api_file_seek(lfs_file_t *file, uint32_t oft, int flags);
|
|
// int tjd_fs_api_file_oft_read(lfs_file_t *file, uint32_t oft, void *buffer, uint32_t size);
|
|
// int tjd_fs_api_file_oft_write(lfs_file_t *file, uint32_t oft, void *buffer, uint32_t size);
|
|
// int tjd_fs_api_file_exist(const char *path);
|
|
// int tjd_fs_api_file_create(const char *path);
|
|
// int tjd_fs_api_file_truncate(lfs_file_t *file, uint32_t oft);
|
|
// void* tjd_fs_api_file_handle_create(void);
|
|
// int tjd_fs_api_file_handle_delete(void * file_handle);
|
|
// int tjd_fs_api_dir_open(const char *path, void* dir);
|
|
// int tjd_fs_api_dir_close(void* dir);
|
|
// int tjd_fs_api_dir_read(void* dir, void *info);
|
|
// int tjd_fs_api_dir_create(const char *path);
|
|
// int tjd_fs_api_unlink(const char *path);
|
|
// int tjd_fs_api_rename(const char *oldpath, const char *newpath);
|
|
//ext
|
|
int tjd_fs_api_path_exist(const char *path, uint32_t *size, bool *isdir);
|
|
int tjd_fs_api_path_remove(const char *path);
|
|
int tjd_fs_api_dir_scan_exclude_child_dir(const char *path, int (*cb)(bool, const char*, int32_t, void*), void* arg);
|
|
int tjd_fs_api_dir_scan(const char *path, int (*cb)(bool, const char*, int32_t, void*), void* arg);
|
|
int tjd_fs_api_file_store(const char *path, uint32_t oft, const void *buffer, uint32_t size);
|
|
int tjd_fs_api_file_append(const char *path, const void *buffer, uint32_t size);
|
|
int tjd_fs_api_file_load(const char *path, uint32_t oft, void *buffer, uint32_t size);
|
|
int tjd_fs_api_get_dir_by_full_path(const char *path, char *buf);
|
|
int tjd_fs_api_get_file_name_by_full_path(const char *path, char *file_name);
|
|
// 创建目录,可以创建多级目录.
|
|
int tjd_fs_api_dir_full_path_create(const char *path);
|
|
// 创建文件,可以创建多级目录.
|
|
int tjd_fs_api_file_full_path_create(const char *path);
|
|
|
|
void tjd_fs_api_print_dir_list(const char *path);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /*LFS_INTERFACE_H*/
|