14 #ifndef SION_SION_FILE_H 15 #define SION_SION_FILE_H 22 #define SION_FILE_FLAG_ANSI 1 23 #define SION_FILE_FLAG_SCNDANSI 2 24 #define SION_FILE_FLAG_POSIX 4 25 #define SION_FILE_FLAG_CREATE 8 26 #define SION_FILE_FLAG_WRITE 16 27 #define SION_FILE_FLAG_READ 32 29 struct _sion_fileptr_s { int _sion_file_unset_second_fileptr(_sion_fileptr *sion_fileptr)
Unset second fileptr for file if opened with ANSI.
sion_int64 _sion_file_write_ansi(const void *data, sion_int64 bytes, FILE *fileptr)
ANSI: Write data to file.
sion_int64 _sion_file_read_ansi(void *data, sion_int64 bytes, FILE *fileptr)
ANSI: Read data from file.
sion_int64 _sion_file_write(const void *data, sion_int64 bytes, _sion_fileptr *sion_fileptr)
Write data to file.
int _sion_file_close(_sion_fileptr *sion_fileptr)
Close file and destroys fileptr structure.
FILE * _sion_file_open_ansi_write_create(const char *fname, unsigned int addflags)
ANSI: Create and open a new file for writing.
int _sion_file_purge_ansi(FILE *fileptr)
ANSI: Purge the data to the disk.
char * _sion_get_fileptr_desc(_sion_fileptr *sion_fileptr)
int _sion_file_flush_posix(int fd)
POSIX: Flush the data to the disk.
long _sion_file_get_opt_blksize(_sion_fileptr *fileptr)
Get optional file system block size for a file.
int _sion_file_open_posix_write_existing(const char *fname, unsigned int addflags)
POSIX: Open a new file for writing.
sion_int64 _sion_file_get_position_ansi(FILE *fileptr)
ANSI: Get the current position in file.
long _sion_file_get_opt_blksize_posix(int fd)
POSIX: Get optional file system block size for a file.
int _sion_file_set_buffer_posix(int fd, char *buffer, sion_int32 buffer_size)
POSIX: set buffer of fd.
FILE * _sion_file_open_ansi_write_existing(const char *fname, unsigned int addflags)
ANSI: Open a new file for writing.
sion_int64 _sion_file_read_posix(void *data, sion_int64 bytes, int fd)
POSIX: Read data from file.
int _sion_file_set_buffer(_sion_fileptr *fileptr, char *buffer, sion_int32 buffer_size)
Set buffer of fp.
int _sion_file_set_buffer_ansi(FILE *fileptr, char *buffer, sion_int32 buffer_size)
ANSI: set buffer of fp.
sion_int64 _sion_file_get_position_posix(int fd)
POSIX: Get the current position in file.
int _sion_file_open_posix_write_create(const char *fname, unsigned int addflags)
POSIX: Create and open a new file for writing.
int _sion_file_purge_posix(int fd)
POSIX: Purge the data to the disk.
int _sion_file_get_fd(_sion_fileptr *sion_fileptr)
Utility function: Get POSIX fp.
int _sion_file_close_posix(int fd)
POSIX: Close a file.
sion_int64 _sion_file_set_position(_sion_fileptr *fileptr, sion_int64 startpointer)
Set new position in file.
int _sion_file_set_second_fileptr(_sion_fileptr *sion_fileptr, FILE *fileptr)
Set second fileptr for file if opened with ANSI.
_sion_fileptr * _sion_file_open(const char *fname, unsigned int flags, unsigned int addflags)
Create and open a new file for writing.
long _sion_file_get_opt_blksize_ansi(FILE *fileptr)
ANSI: Get optional file system block size for a file.
sion_int64 _sion_file_read(void *data, sion_int64 bytes, _sion_fileptr *sion_fileptr)
Read data from file.
sion_int64 _sion_file_set_position_ansi(FILE *fileptr, sion_int64 startpointer)
ANSI: Set the start position for the current task.
sion_int64 _sion_file_write_posix(const void *data, sion_int64 bytes, int fd)
POSIX: Write data to file.
int _sion_file_close_ansi(FILE *fileptr)
ANSI: Close a file.
int _sion_file_flush(_sion_fileptr *fileptr)
Flush data to file.
int _sion_file_purge(_sion_fileptr *fileptr)
Purge data to file.
sion_int64 _sion_file_set_position_posix(int fd, sion_int64 startpointer)
POSIX: Set the start position for the current task.
int _sion_file_stat_file(const char *fname)
Check if file exists (LARGE_FILE support on BlueGene)
_sion_fileptr * _sion_file_alloc_and_init_sion_fileptr(void)
Create and return _sion_fileptr.
FILE * _sion_file_open_ansi_read(const char *fname, unsigned int addflags)
ANSI: Open a file for reading.
sion_int64 _sion_file_get_position(_sion_fileptr *fileptr)
Get new position in file.
int _sion_file_flush_ansi(FILE *fileptr)
ANSI: Flush the data to the disk.
int _sion_file_open_posix_read(const char *fname, unsigned int addflags)
POSIX: Open a file for reading.