LAR Library: fs.h Source File

LAR Library

fs.h
Go to the documentation of this file.
1 #ifndef LARLIB_FS_H
2 #define LARLIB_FS_H
3 
60 #include <larlib/base.h>
61 
65 typedef struct fsFile_t fsFile_t;
66 
81 };
82 
90 };
91 
105 int fsSetFileNamePrefix(const char *prefix);
106 
120 int fsPushFileNamePrefix(const char *prefix);
121 
131 int fsPopFileNamePrefix(void);
132 
142 const char *fsGetFileNamePrefix(void);
143 
174 int fsOpen(const char *name, int flags, fsFile_t **file);
175 
186 int fsClose(fsFile_t *f);
187 
206 int fsRead(fsFile_t *f, int n, void *p);
207 
221 int fsReadByte(fsFile_t *f);
222 
255 int fsReadUntil(fsFile_t *f, const uint8_t *delims, int ndelim, int n, void *p);
256 
274 int fsWrite(fsFile_t *f, int n, const void *p);
275 
290 int fsWriteByte(fsFile_t *f, int b);
291 
304 int fsTell(fsFile_t *f);
305 
328 int fsSeek(fsFile_t *f, int whence, int offset);
329 
351 int fsLength(fsFile_t *f);
352 
365 int fsRemove(const char *name);
366 
382 int fsRename(const char *oldname, const char *newname);
383 
395 int fsExist(const char *name);
396 
397 /* @} */
398 
399 #endif
Open file for reading.
Definition: fs.h:76
int fsWriteByte(fsFile_t *f, int b)
Try to write a byte to a file.
Seek from the end of file.
Definition: fs.h:88
int fsRename(const char *oldname, const char *newname)
Rename the file oname to newname.
fsSeekWhence_t
Posible seek positions, see fsSeek().
Definition: fs.h:86
int fsWrite(fsFile_t *f, int n, const void *p)
Try to write a number of bytes to a file.
Move position to FS_WHENCE_END after open, forces FS_OPEN_WRITE.
Definition: fs.h:80
int fsPushFileNamePrefix(const char *prefix)
Push a new item on the file name prefix stack.
int fsExist(const char *name)
Check if file name exists.
int fsRead(fsFile_t *f, int n, void *p)
Try to read a number of bytes from a file.
Create file if not found.
Definition: fs.h:78
int fsReadUntil(fsFile_t *f, const uint8_t *delims, int ndelim, int n, void *p)
Read bytes from the input file until either one of delims bytes is found, or n bytes have been read...
int fsPopFileNamePrefix(void)
Remove the top item on the file name prefix stack.
Reset file if present.
Definition: fs.h:79
int fsSeek(fsFile_t *f, int whence, int offset)
Set the read/write position for a file.
Seek from the start of file.
Definition: fs.h:87
int fsClose(fsFile_t *f)
Close a file handle.
Open file for writing.
Definition: fs.h:77
struct fsFile_t fsFile_t
Opaque type of a file.
Definition: fs.h:65
int fsTell(fsFile_t *f)
Return the current read/write position of a file.
Larlib basic definitions.
int fsReadByte(fsFile_t *f)
Try to read the next byte from the file.
fsOpenFlags_t
Flags for fsOpen().
Definition: fs.h:75
int fsLength(fsFile_t *f)
Return the length of an open file in bytes.
int fsRemove(const char *name)
Delete file name from the file system.
const char * fsGetFileNamePrefix(void)
Return the current prefix being used.
int fsOpen(const char *name, int flags, fsFile_t **file)
Open the selected file to input and/or output.
unsigned char uint8_t
Unsigned 8-bit integer.
Definition: base.h:162
int fsSetFileNamePrefix(const char *prefix)
Set the common file name prefix.
Seek from the current position.
Definition: fs.h:89
Generated on Mon Mar 27 2017 15:42:52 for LAR Library by   doxygen 1.8.9.1