Go to the source code of this file.
void gsl_hfile_close |
( |
GslHFile * |
hfile | ) |
|
- Parameters
-
Close and destroy a GslHFile. This function is MT-safe and may be called from any thread.
GslHFile* gsl_hfile_open |
( |
const gchar * |
file_name | ) |
|
- Parameters
-
file_name | name of the file to open |
- Returns
- a new opened GslHFile or NULL if an error occoured (errno set)
Open a file for reading and return the associated GSL hashed file. The motivation for using a GslHFile over normal unix file descriptors is to reduce the amount of opened unix file descriptors and to ensure thread safety upon reading offset relative byte blocks. Multiple open GslHFiles with equal file names will share a single unix file descriptor as long as the file wasn't modified meanwhile. This function is MT-safe and may be called from any thread.
GslLong gsl_hfile_pread |
( |
GslHFile * |
hfile, |
|
|
GslLong |
offset, |
|
|
GslLong |
n_bytes, |
|
|
gpointer |
bytes |
|
) |
| |
- Parameters
-
hfile | valid GslHFile |
offset | offset in bytes within 0 and file end |
n_bytes | number of bytes to read |
bytes | buffer to store read bytes |
- Returns
- amount of bytes read or -1 if an error occoured (errno set)
Read a block of bytes from a GslHFile. This function is MT-safe and may be called from any thread.
GslLong gsl_hfile_zoffset |
( |
GslHFile * |
hfile | ) |
|
- Parameters
-
- Returns
- offset of first zero byte or -1
Find the offset of the first zero byte in a GslHFile. This function is MT-safe and may be called from any thread.
void gsl_rfile_close |
( |
GslRFile * |
rfile | ) |
|
- Parameters
-
Close and destroy a GslRFile.
GslLong gsl_rfile_length |
( |
GslRFile * |
rfile | ) |
|
- Parameters
-
- Returns
- total length of the GslRFile in bytes
Retrieve the file length of rfile in bytes.
gchar* gsl_rfile_name |
( |
GslRFile * |
rfile | ) |
|
- Parameters
-
- Returns
- the file name used to open this file
Retrieve the file name used to open rfile.
GslRFile* gsl_rfile_open |
( |
const gchar * |
file_name | ) |
|
- Parameters
-
file_name | name of the file to open |
- Returns
- a new opened GslRFile or NULL if an error occoured (errno set)
Open a file for reading and create a GSL read only file handle for it. The motivation for using a GslRFile over normal unix files is to reduce the amount of opened unix file descriptors by using a GslHFile for the actual IO.
GslLong gsl_rfile_position |
( |
GslRFile * |
rfile | ) |
|
GslLong gsl_rfile_pread |
( |
GslRFile * |
rfile, |
|
|
GslLong |
offset, |
|
|
GslLong |
n_bytes, |
|
|
gpointer |
bytes |
|
) |
| |
- Parameters
-
rfile | valid GslRFile |
offset | offset in bytes within 0 and gsl_rfile_length() |
n_bytes | number of bytes to read |
bytes | buffer to store read bytes |
- Returns
- amount of bytes read or -1 if an error occoured (errno set)
Read a block of bytes from a GslRFile at a specified position.
GslLong gsl_rfile_read |
( |
GslRFile * |
rfile, |
|
|
GslLong |
n_bytes, |
|
|
gpointer |
bytes |
|
) |
| |
- Parameters
-
rfile | valid GslRFile |
n_bytes | number of bytes to read |
bytes | buffer to store read bytes |
- Returns
- amount of bytes read or -1 if an error occoured (errno set)
Read a block of bytes from a GslRFile from the current seek position and advance the seek position.
GslLong gsl_rfile_seek_set |
( |
GslRFile * |
rfile, |
|
|
GslLong |
offset |
|
) |
| |