Muteki
EABI code execution on Besta® RTOS devices.
Loading...
Searching...
No Matches
file.h
Go to the documentation of this file.
1/*
2 * Copyright 2021-present dogtopus
3 * SPDX-License-Identifier: MIT
4 */
5
10
11#ifndef __MUTEKI_FS_FILE_H__
12#define __MUTEKI_FS_FILE_H__
13
14#include "../common.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
31
33typedef struct bxc_fs_file_s bxc_fs_file_t;
38struct bxc_fs_file_s;
39
47extern bxc_fs_file_t *_afopen(const char *pathname, const char *mode);
48
56extern bxc_fs_file_t *__wfopen(const UTF16 *pathname, const UTF16 *mode);
57
67extern size_t _fread(void *ptr, size_t size, size_t nmemb, bxc_fs_file_t *stream);
68
78extern size_t _fwrite(const void *ptr, size_t size, size_t nmemb, bxc_fs_file_t *stream);
79
90extern int __fseek(bxc_fs_file_t *stream, long offset, int whence);
91
98extern long _ftell(bxc_fs_file_t *stream);
99
107extern int __fflush(bxc_fs_file_t *stream);
108
115extern int _fclose(bxc_fs_file_t *stream);
116
117#ifdef __cplusplus
118} // extern "C"
119#endif
120
121#endif // __MUTEKI_FS_FILE_H__
Common include file for all muteki-shims headers.
#define UTF16
"Portable" Besta UTF-16 type used by other headers.
Definition common.h:54
int _fclose(bxc_fs_file_t *stream)
Close a file.
int __fflush(bxc_fs_file_t *stream)
Flush the cached writes to the file.
bxc_seek_whence_e
whence values for __fseek().
Definition file.h:23
@ BXC_SEEK_SET
Definition file.h:25
@ BXC_SEEK_CUR
Definition file.h:27
@ BXC_SEEK_END
Definition file.h:29
bxc_fs_file_t * _afopen(const char *pathname, const char *mode)
Open a file located at pathname.
bxc_fs_file_t * __wfopen(const UTF16 *pathname, const UTF16 *mode)
Open a file located at UTF-16-encoded pathname.
struct bxc_fs_file_s bxc_fs_file_t
File descriptor type.
Definition file.h:33
long _ftell(bxc_fs_file_t *stream)
Return the current position of the file.
size_t _fread(void *ptr, size_t size, size_t nmemb, bxc_fs_file_t *stream)
Read nmemb data units of size size from a file.
size_t _fwrite(const void *ptr, size_t size, size_t nmemb, bxc_fs_file_t *stream)
Write nmemb data units of size size to a file.
int __fseek(bxc_fs_file_t *stream, long offset, int whence)
Seek to a specific position in an opened file.