## Input from unstructured files

Input from unstructured files —

## Synopsis

    struct      GsfInput;
    GsfInfile*  gsf_input_container             (GsfInput *input);
    GsfInput*   gsf_input_dup                   (GsfInput *input,
                                                 GError **err);
    gsf_off_t   gsf_input_size                  (GsfInput *input);
    gboolean    gsf_input_eof                   (GsfInput *input);
    gsf_off_t   gsf_input_remaining             (GsfInput *input);
    gsf_off_t   gsf_input_tell                  (GsfInput *input);
    gboolean    gsf_input_seek                  (GsfInput *input,
                                                 gsf_off_t offset,
                                                 GSeekType whence);
    GQuark      gsf_input_error                 (void);
    GsfInput*   gsf_input_sibling               (GsfInput const *input,
                                                 char const *name,
                                                 GError **err);

    gboolean    gsf_input_copy                  (GsfInput *input,
                                                 GsfOutput *output);
    GsfInput*   gsf_input_uncompress            (GsfInput *src);

    gboolean    gsf_input_set_name              (GsfInput *input,
                                                 char const *name);
    gboolean    gsf_input_set_container         (GsfInput *input,
                                                 GsfInfile *container);
    gboolean    gsf_input_set_size              (GsfInput *input,
                                                 gsf_off_t size);
    gboolean    gsf_input_seek_emulate          (GsfInput *input,
                                                 gsf_off_t pos);

## Object Hierarchy

      GObject
       +----GsfInput
             +----GsfInfile
             +----GsfInputGZip
             +----GsfInputMemory
             +----GsfInputStdio
             +----GsfInputTextline

## Properties

      "eof"                  gpointer              : Read
      "name"                 gpointer              : Read
      "position"             gpointer              : Read
      "remaining"            gpointer              : Read
      "size"                 gpointer              : Read

## Description

## Details

### struct GsfInput

    struct GsfInput;

### gsf_input_container ()

    GsfInfile*  gsf_input_container             (GsfInput *input);

`input` : |
Returns : | , but does not add a reference to `input`'s container. Potentially NULL

### gsf_input_dup ()

    GsfInput*   gsf_input_dup                   (GsfInput *input,
                                                 GError **err);

Duplicates input `src` leaving the new one at the same offset.

`input` : | The input to duplicate
`err` : | optionally NULL
Returns : | : the duplicate, or NULL on error

### gsf_input_size ()

    gsf_off_t   gsf_input_size                  (GsfInput *input);

Looks up and caches the number of bytes in the input

`input` : | The input
Returns : | : the size or -1 on error

### gsf_input_eof ()

    gboolean    gsf_input_eof                   (GsfInput *input);

Are we at the end of the file ?

`input` : | the input
Returns : | : TRUE if the input is at the eof.

### gsf_input_remaining ()

    gsf_off_t   gsf_input_remaining             (GsfInput *input);

`input` : |
Returns : | the number of bytes left in the file.

### gsf_input_tell ()

    gsf_off_t   gsf_input_tell                  (GsfInput *input);

`input` : |
Returns : | the current offset in the file.

### gsf_input_seek ()

    gboolean    gsf_input_seek                  (GsfInput *input,
                                                 gsf_off_t offset,
                                                 GSeekType whence);

`input` : |
`offset` : |
`whence` : |
Returns : | TRUE on error.

### gsf_input_error ()

    GQuark      gsf_input_error                 (void);

Returns : | : A utility quark to flag a GError as being an input problem.

### gsf_input_sibling ()

    GsfInput*   gsf_input_sibling               (GsfInput const *input,
                                                 char const *name,
                                                 GError **err);

`input` : |
`name` : |
`err` : |
Returns : |

### gsf_input_copy ()

    gboolean    gsf_input_copy                  (GsfInput *input,
                                                 GsfOutput *output);

Copy the contents from `input` to `output` from their respective current positions. So if you want to be sure to copy *everything*, make sure to call gsf_input_seek (input, 0, G_SEEK_SET) and gsf_output_seek (output, 0, G_SEEK_SET) first, if applicable.

`input` : | a non-null GsfInput
`output` : | a non-null GsfOutput
Returns : | : TRUE on Success

### gsf_input_uncompress ()

    GsfInput*   gsf_input_uncompress            (GsfInput *src);

`src` : | stream to be uncompressed.
Returns : | A stream equivalent to the source stream, but uncompressed if the source was compressed. This functions takes ownership of the incoming reference and yields a new one as its output.

### gsf_input_set_name ()

    gboolean    gsf_input_set_name              (GsfInput *input,
                                                 char const *name);

protected.

`input` : |
`name` : |
Returns : | : TRUE if the assignment was ok.

### gsf_input_set_container ()

    gboolean    gsf_input_set_container         (GsfInput *input,
                                                 GsfInfile *container);

`input` : |
`container` : |
Returns : | : TRUE if the assignment was ok.

### gsf_input_set_size ()

    gboolean    gsf_input_set_size              (GsfInput *input,
                                                 gsf_off_t size);

`input` : |
`size` : |
Returns : | : TRUE if the assignment was ok.

### gsf_input_seek_emulate ()

    gboolean    gsf_input_seek_emulate          (GsfInput *input,
                                                 gsf_off_t pos);

`input` : |
`pos` : |
Returns : | : TRUE if the emulation worked.

## Properties

### The "`eof`" property

      "eof"                  gpointer              : Read

End Of File.

### The "`name`" property

      "name"                 gpointer              : Read

The Input's Name.

### The "`position`" property

      "position"             gpointer              : Read

The Output's Current Position.

### The "`remaining`" property

      "remaining"            gpointer              : Read

Amount of Data Remaining.

### The "`size`" property

      "size"                 gpointer              : Read

The Input's Size.