flux-file-io

flux-file-io —

Synopsis




#define     FLUX_FILE_IO                    (object)
enum        FluxFileIOState;
struct      FluxFileIO;
FluxFileIO* flux_file_io_new                (gint fd);
void        flux_file_io_init               (FluxFileIO *file_io,
                                             gint fd);
void        flux_file_io_finalize           (FluxObject *file_io);
gint        flux_file_io_get_fd             (FluxFileIO *file_io);
guint64     flux_file_io_get_size           (FluxFileIO *file_io);
guint64     flux_file_io_get_position       (FluxFileIO *file_io);
void        flux_file_io_set_eof_func       (FluxFileIO *file_io,
                                             FluxEofFunc *func,
                                             gpointer data);
void        flux_file_io_set_eow_func       (FluxFileIO *file_io,
                                             FluxEowFunc *func,
                                             gpointer data);
void        flux_file_io_seek_to            (FluxFileIO *file_io,
                                             guint64 position);
void        flux_file_io_seek_relative      (FluxFileIO *file_io,
                                             gint64 offset);

Description

Details

FLUX_FILE_IO()

#define FLUX_FILE_IO(object) ((FluxFileIO *) object)

object :

enum FluxFileIOState

typedef enum
{
  FLUX_FILE_IO_IDLE,
  FLUX_FILE_IO_READING,
  FLUX_FILE_IO_WRITING
}
FluxFileIOState;


struct FluxFileIO

struct FluxFileIO {

  FluxIO                    io;

  FluxFileIOState           state;
  GIOChannel               *gioc;
  gint                      fd;
  guint64                   real_position;

  guint                     io_watch_id;

  FluxEofFunc              *eof_func;
  gpointer                  eof_func_data;

  FluxEowFunc              *eow_func;
  gpointer                  eow_func_data;
};


flux_file_io_new ()

FluxFileIO* flux_file_io_new                (gint fd);

fd :
Returns :

flux_file_io_init ()

void        flux_file_io_init               (FluxFileIO *file_io,
                                             gint fd);

file_io :
fd :

flux_file_io_finalize ()

void        flux_file_io_finalize           (FluxObject *file_io);

file_io :

flux_file_io_get_fd ()

gint        flux_file_io_get_fd             (FluxFileIO *file_io);

file_io :
Returns :

flux_file_io_get_size ()

guint64     flux_file_io_get_size           (FluxFileIO *file_io);

file_io :
Returns :

flux_file_io_get_position ()

guint64     flux_file_io_get_position       (FluxFileIO *file_io);

file_io :
Returns : The file position as it would be if all buffers were flushed. This value changes immediately when the user reads or writes data, even if it hasn't been read from/committed to disk.

flux_file_io_set_eof_func ()

void        flux_file_io_set_eof_func       (FluxFileIO *file_io,
                                             FluxEofFunc *func,
                                             gpointer data);

file_io :
func :
data :

flux_file_io_set_eow_func ()

void        flux_file_io_set_eow_func       (FluxFileIO *file_io,
                                             FluxEowFunc *func,
                                             gpointer data);

file_io :
func :
data :

flux_file_io_seek_to ()

void        flux_file_io_seek_to            (FluxFileIO *file_io,
                                             guint64 position);

file_io :
position :

flux_file_io_seek_relative ()

void        flux_file_io_seek_relative      (FluxFileIO *file_io,
                                             gint64 offset);

file_io :
offset :