API参考
载入中...
搜索中...
未找到
sal_file.h
1/*
2 * This file is part of the openHiTLS project.
3 *
4 * openHiTLS is licensed under the Mulan PSL v2.
5 * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 * You may obtain a copy of Mulan PSL v2 at:
7 *
8 * http://license.coscl.org.cn/MulanPSL2
9 *
10 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13 * See the Mulan PSL v2 for more details.
14 */
15
16#ifndef SAL_FILE_H
17#define SAL_FILE_H
18
19#include "hitls_build.h"
20#ifdef HITLS_BSL_SAL_FILE
21#include <stdbool.h>
22#include <stdint.h>
23#include "bsl_sal.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29bool SAL_FileError(bsl_sal_file_handle stream);
30
31char *SAL_FGets(bsl_sal_file_handle stream, char *buf, int32_t readLen);
32
33bool SAL_FPuts(bsl_sal_file_handle stream, const char *buf);
34
35bool SAL_Flush(bsl_sal_file_handle stream);
36
37int32_t SAL_Feof(bsl_sal_file_handle stream);
38
39int32_t SAL_FSetAttr(bsl_sal_file_handle stream, int cmd, const void *arg);
40
41int32_t SAL_FGetAttr(bsl_sal_file_handle stream, void *arg);
42
43int32_t SAL_FileTell(bsl_sal_file_handle stream, long *pos);
44
45int32_t SAL_FileSeek(bsl_sal_file_handle stream, long offset, int32_t origin);
46
59int32_t BSL_SAL_ReadFile(const char *path, uint8_t **buff, uint32_t *len);
60
73int32_t BSL_SAL_WriteFile(const char *path, const uint8_t *buff, uint32_t len);
74#ifdef __cplusplus
75}
76#endif /* __cplusplus */
77
78#endif /* HITLS_BSL_SAL_FILE */
79
80#endif // SAL_FILE_H