Beast - Music Synthesizer and Composer  0.11.1+10.g2da35
gslfilehash.hh File Reference
#include <bse/gsldefs.hh>
#include <bse/gslcommon.hh>
Include dependency graph for gslfilehash.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  GslHFile
 
struct  GslRFile
 

Functions

GslHFilegsl_hfile_open (const gchar *file_name)
 
GslLong gsl_hfile_pread (GslHFile *hfile, GslLong offset, GslLong n_bytes, gpointer bytes)
 
GslLong gsl_hfile_zoffset (GslHFile *hfile)
 
void gsl_hfile_close (GslHFile *hfile)
 
GslRFilegsl_rfile_open (const gchar *file_name)
 
gchar * gsl_rfile_name (GslRFile *rfile)
 
GslLong gsl_rfile_pread (GslRFile *rfile, GslLong offset, GslLong n_bytes, gpointer bytes)
 
GslLong gsl_rfile_read (GslRFile *rfile, GslLong n_bytes, gpointer bytes)
 
GslLong gsl_rfile_seek_set (GslRFile *rfile, GslLong offset)
 
GslLong gsl_rfile_position (GslRFile *rfile)
 
GslLong gsl_rfile_length (GslRFile *rfile)
 
void gsl_rfile_close (GslRFile *rfile)
 

Function Documentation

void gsl_hfile_close ( GslHFile hfile)
Parameters
hfilevalid GslHFile

Close and destroy a GslHFile. This function is MT-safe and may be called from any thread.

Referenced by gsl_data_handle_new_crop(), gsl_hfile_zoffset(), and gsl_rfile_close().

Here is the call graph for this function:

Here is the caller graph for this function:

GslHFile* gsl_hfile_open ( const gchar *  file_name)
Parameters
file_namename 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.

Referenced by gsl_data_handle_new_crop(), and gsl_rfile_open().

Here is the call graph for this function:

Here is the caller graph for this function:

GslLong gsl_hfile_pread ( GslHFile hfile,
GslLong  offset,
GslLong  n_bytes,
gpointer  bytes 
)
Parameters
hfilevalid GslHFile
offsetoffset in bytes within 0 and file end
n_bytesnumber of bytes to read
bytesbuffer 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.

Referenced by gsl_data_handle_new_crop(), gsl_hfile_zoffset(), gsl_rfile_pread(), and gsl_rfile_read().

Here is the call graph for this function:

Here is the caller graph for this function:

GslLong gsl_hfile_zoffset ( GslHFile hfile)
Parameters
hfilevalid GslHFile
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.

Referenced by gsl_data_handle_new_crop().

Here is the call graph for this function:

Here is the caller graph for this function:

void gsl_rfile_close ( GslRFile rfile)
Parameters
rfilevalid GslRFile

Close and destroy a GslRFile.

Referenced by Bse::Flac1Handle::create().

Here is the call graph for this function:

Here is the caller graph for this function:

GslLong gsl_rfile_length ( GslRFile rfile)
Parameters
rfilevalid GslRFile
Returns
total length of the GslRFile in bytes

Retrieve the file length of rfile in bytes.

Referenced by Bse::Flac1Handle::read_data().

Here is the call graph for this function:

Here is the caller graph for this function:

gchar* gsl_rfile_name ( GslRFile rfile)
Parameters
rfilevalid GslRFile
Returns
the file name used to open this file

Retrieve the file name used to open rfile.

Here is the call graph for this function:

GslRFile* gsl_rfile_open ( const gchar *  file_name)
Parameters
file_namename 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.

Referenced by Bse::Flac1Handle::read_data().

Here is the call graph for this function:

Here is the caller graph for this function:

GslLong gsl_rfile_position ( GslRFile rfile)
Parameters
rfilevalid GslRFile
Returns
current position within 0 and gsl_rfile_length()

Retrieve the current GslRFile seek position.

Referenced by Bse::Flac1Handle::read_data().

Here is the call graph for this function:

Here is the caller graph for this function:

GslLong gsl_rfile_pread ( GslRFile rfile,
GslLong  offset,
GslLong  n_bytes,
gpointer  bytes 
)
Parameters
rfilevalid GslRFile
offsetoffset in bytes within 0 and gsl_rfile_length()
n_bytesnumber of bytes to read
bytesbuffer 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.

Here is the call graph for this function:

GslLong gsl_rfile_read ( GslRFile rfile,
GslLong  n_bytes,
gpointer  bytes 
)
Parameters
rfilevalid GslRFile
n_bytesnumber of bytes to read
bytesbuffer 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.

Referenced by Bse::Flac1Handle::read_data().

Here is the call graph for this function:

Here is the caller graph for this function:

GslLong gsl_rfile_seek_set ( GslRFile rfile,
GslLong  offset 
)
Parameters
rfilevalid GslRFile
offsetnew seek position within 0 and gsl_rfile_length()+1
Returns
resulting position within 0 and gsl_rfile_length()+1

Set the current GslRFile seek position.

Referenced by Bse::Flac1Handle::read_data().

Here is the call graph for this function:

Here is the caller graph for this function: