WL865E4-P  36.07.001
m2mb_fs_posix.h
Go to the documentation of this file.
1  /*===============================================================================================*/
2 /* >>> Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. <<< */
25 #ifndef M2M_M2MB_FS_POSIX_H
26 #define M2M_M2MB_FS_POSIX_H
27 
44 /*-----------------------------------------------------------------------------------------------*/
45 
50 /*-----------------------------------------------------------------------------------------------*/
51 
52 /* Global declarations ==========================================================================*/
53 /* Files open modes */
54 #define M2MB_O_RDONLY 00
55 #define M2MB_O_WRONLY 01
56 #define M2MB_O_RDWR 02
57 #define M2MB_O_CREAT 0100
58 #define M2MB_O_EXCL 0200
59 #define M2MB_O_TRUNC 01000
60 #define M2MB_O_APPEND 02000
62 /* File seek flags */
63 #define M2MB_SEEK_SET 0
64 #define M2MB_SEEK_CUR 1
65 #define M2MB_SEEK_END 2
67 /* File errno value */
68 #define M2MB_FS_ENOERR 0
69 #define M2MB_FS_EPERM 1
70 #define M2MB_FS_ENOENT 2
71 #define M2MB_FS_EIO 5
72 #define M2MB_FS_EBADF 9
73 #define M2MB_FS_ENOMEM 12
74 #define M2MB_FS_EACCES 13
75 #define M2MB_FS_EBUSY 16
76 #define M2MB_FS_EEXIST 17
77 #define M2MB_FS_EXDEV 18
78 #define M2MB_FS_ENODEV 19
79 #define M2MB_FS_ENOTDIR 20
80 #define M2MB_FS_EISDIR 21
81 #define M2MB_FS_EINVAL 22
82 #define M2MB_FS_EMFILE 24
83 #define M2MB_FS_ETXTBSY 26
84 #define M2MB_FS_ENOSPC 28
85 #define M2MB_FS_ESPIPE 29
86 #define M2MB_FS_ENAMETOOLONG 36
87 #define M2MB_FS_ENOTEMPTY 39
88 #define M2MB_FS_ELOOP 40
89 #define M2MB_FS_EILSEQ 84
90 #define M2MB_FS_ETIMEDOUT 110
91 #define M2MB_FS_ESTALE 116
92 #define M2MB_FS_EDQUOT 122
95 /* Global typedefs ==============================================================================*/
96 struct M2MB_STAT
97 {
103 };
104 
106 {
116 };
117 
119 {
120  char file_path[100];
121  struct M2MB_STAT sbuf;
122 };
123 
124 /* Global functions =============================================================================*/
125 /*-----------------------------------------------------------------------------------------------*/
171 /*-----------------------------------------------------------------------------------------------*/
172 INT32 m2mb_fs_open( const CHAR *path, INT32 oflag, ... );
173 
174 /*-----------------------------------------------------------------------------------------------*/
230 /*-----------------------------------------------------------------------------------------------*/
231 
232 INT32 m2mb_fs_secure_open( const CHAR *path, INT32 oflag, const char* pwd );
233 
234 /*-----------------------------------------------------------------------------------------------*/
295 /*-----------------------------------------------------------------------------------------------*/
296 SSIZE_T m2mb_fs_read( INT32 fd, void *buf, SIZE_T nbyte );
297 
298 /*-----------------------------------------------------------------------------------------------*/
353 /*-----------------------------------------------------------------------------------------------*/
354 SSIZE_T m2mb_fs_write( INT32 fd, const void *buf, SIZE_T nbyte );
355 
356 /*-----------------------------------------------------------------------------------------------*/
416 /*-----------------------------------------------------------------------------------------------*/
418 
419 /*-----------------------------------------------------------------------------------------------*/
485 /*-----------------------------------------------------------------------------------------------*/
486 OFF_T m2mb_fs_lseek( INT32 fd, OFF_T offset, INT32 whence );
487 
488 /*-----------------------------------------------------------------------------------------------*/
528 /*-----------------------------------------------------------------------------------------------*/
529 INT32 m2mb_fs_stat( const CHAR *path, struct M2MB_STAT *buf );
530 
531 /*-----------------------------------------------------------------------------------------------*/
591 /*-----------------------------------------------------------------------------------------------*/
592 INT32 m2mb_fs_unlink( const CHAR *path );
593 /*-----------------------------------------------------------------------------------------------*/
634 /*-----------------------------------------------------------------------------------------------*/
635 INT32 m2mb_fs_statvfs( const CHAR *path, struct M2MB_STATVFS *buf );
636 /*-----------------------------------------------------------------------------------------------*/
689 /*-----------------------------------------------------------------------------------------------*/
690 INT32 m2mb_fs_ls_open( const char *path, HANDLE *handle );
691 /*-----------------------------------------------------------------------------------------------*/
771 /*-----------------------------------------------------------------------------------------------*/
772 
773 INT32 m2mb_fs_ls_next( HANDLE ls_hdl, struct M2MB_LS_ENTRY *ls_entry );
774 /*-----------------------------------------------------------------------------------------------*/
823 /*-----------------------------------------------------------------------------------------------*/
824 
825 INT32 m2mb_fs_ls_close( HANDLE ls_hdl );
826 
830 /*-----------------------------------------------------------------------------------------------*/
831 
832 #endif /* M2M_M2MB_FS_POSIX_H */
833 
OFF_T m2mb_fs_lseek(INT32 fd, OFF_T offset, INT32 whence)
Move file offset.
INT32 m2mb_fs_ls_close(HANDLE ls_hdl)
File system ls close.
INT32 SSIZE_T
Definition: m2mb_types.h:100
SSIZE_T m2mb_fs_write(INT32 fd, const void *buf, SIZE_T nbyte)
Write file.
INT32 m2mb_fs_open(const CHAR *path, INT32 oflag,...)
Open file.
INT32 m2mb_fs_secure_open(const CHAR *path, INT32 oflag, const char *pwd)
Open secure file.
SIZE_T st_size
UINT32 f_max_open_files
INT32 m2mb_fs_ls_open(const char *path, HANDLE *handle)
List over all the files in the file system. Depending on the read/write speeds of the underlying flas...
INT32 m2mb_fs_unlink(const CHAR *path)
Delete file.
UINT32 INODE_T
Definition: m2mb_types.h:105
INODE_T st_ino
Definition: m2mb_fs_posix.h:99
UINT32 f_pathmax
UINT32 SIZE_T
Definition: m2mb_types.h:99
unsigned long int UINT32
Definition: m2mb_types.h:85
char CHAR
Definition: m2mb_types.h:74
char file_path[100]
SSIZE_T m2mb_fs_read(INT32 fd, void *buf, SIZE_T nbyte)
Read file.
INT32 m2mb_fs_close(INT32 fd)
Close file.
UINT32 f_max_transaction_size
struct M2MB_STAT sbuf
void * HANDLE
Definition: m2mb_types.h:95
signed int INT32
Definition: m2mb_types.h:80
UINT16 DEV_T
Definition: m2mb_types.h:101
UINT32 st_blocks
INT32 OFF_T
Definition: m2mb_types.h:103
UINT32 st_blksize
INT32 m2mb_fs_statvfs(const CHAR *path, struct M2MB_STATVFS *buf)
File system statistics.
UINT32 f_max_file_size
DEV_T st_dev
Definition: m2mb_fs_posix.h:98
INT32 m2mb_fs_ls_next(HANDLE ls_hdl, struct M2MB_LS_ENTRY *ls_entry)
Returns the next file system entry while listing. Depending on the read/write speeds of the underlyin...
INT32 m2mb_fs_stat(const CHAR *path, struct M2MB_STAT *buf)
File status.