|
| #define | VirtualFileWrite(ptr, size, n, f) (VirtualFileGetSource(f)->fWrite(ptr, size, n, f)) |
| | Writes data to a file.
|
| |
| #define | VirtualFileRead(ptr, size, n, f) (VirtualFileGetSource(f)->fRead(ptr, size, n, f)) |
| | Reads data from a file.
|
| |
| #define | VirtualFileGetc(f) (VirtualFileGetSource(f)->fGetc(f)) |
| | Reads a single character from a file.
|
| |
| #define | VirtualFilePutc(caractere, f) (VirtualFileGetSource(f)->fPutc(caractere, f)) |
| | Writes a single character to a file.
|
| |
| #define | VirtualFileGets(str, maxLen, f) (VirtualFileGetSource(f)->fGets(str, maxLen, f)) |
| | Reads a string from a file.
|
| |
| #define | VirtualFilePuts(s, f) (VirtualFileGetSource(f)->fPuts(s, f)) |
| | Writes a string to a file.
|
| |
| #define | VirtualFileSeek(f, offset, whence) (VirtualFileGetSource(f)->fSeek(f, offset, whence)) |
| | Sets the current file position.
|
| |
| #define | VirtualFileTell(f) (VirtualFileGetSource(f)->fTell(f)) |
| | Returns the current file pointer position.
|
| |
| #define | VirtualFileEof(f) (VirtualFileGetSource(f)->fEof(f)) |
| | Checks if the end of a file has been reached.
|
| |
Routines for reading/writing to a virtual file.
◆ VirtualFileWrite
Writes data to a file.
- Parameters
-
| ptr | Pointer to the data to write. |
| size | Size of each element to write. |
| n | Number of elements to write. |
| f | Pointer to the virtual file. |
- Returns
- The number of bytes effectively written.
◆ VirtualFileRead
Reads data from a file.
- Parameters
-
| ptr | Pointer to the buffer where the data will be stored. |
| size | Size of each element to read. |
| n | Number of elements to read. |
| f | Pointer to the virtual file. |
- Returns
- The number of bytes effectively read.
◆ VirtualFileGetc
Reads a single character from a file.
- Parameters
-
| f | Pointer to the virtual file. |
- Returns
- The next character (byte) in the file.
◆ VirtualFilePutc
Writes a single character to a file.
- Parameters
-
| caractere | The character to write. |
| f | Pointer to the virtual file. |
- Returns
- The character value if successful, -1 otherwise.
◆ VirtualFileGets
Reads a string from a file.
- Parameters
-
| str | Pointer to the buffer where the string will be stored. |
| maxLen | Maximum length of the string. |
| f | Pointer to the virtual file. |
- Returns
- A pointer to the read string.
◆ VirtualFilePuts
Writes a string to a file.
- Parameters
-
| s | Pointer to the string to write. |
| f | Pointer to the virtual file. |
◆ VirtualFileSeek
Sets the current file position.
- Parameters
-
| f | Pointer to the virtual file. |
| offset | Offset from the whence parameter. |
| whence | Position to base the offset from (SEEK_SET, SEEK_CUR, SEEK_END). |
◆ VirtualFileTell
Returns the current file pointer position.
- Parameters
-
| f | Pointer to the virtual file. |
- Returns
- The current file position.
◆ VirtualFileEof
Checks if the end of a file has been reached.
- Parameters
-
| f | Pointer to the virtual file. |
- Returns
- 1 if the end of the file is reached, 0 otherwise.