memory: GSF Reference Manual

## memory memory |

## Functions

GsfInput * | gsf_input_mmap_new ()
GsfInput * | gsf_input_memory_new ()
GsfInput * | gsf_input_memory_new_clone ()
GsfInput * | gsf_input_memory_new_from_iochannel ()
const guint8 * | gsf_output_memory_get_bytes ()
GsfOutput * | gsf_output_memory_new ()

## Types and Values

| GsfInputMemory
| GsfOutputMemory

## Object Hierarchy

        GObject
        ├── GsfInput
        │   ╰── GsfInputMemory
        ├── GsfOutput
        │   ╰── GsfOutputMemory
        ╰── GsfSharedMemory

## Description

## Functions

### gsf_input_mmap_new ()

    GsfInput *
    gsf_input_mmap_new (char const *filename,
                        GError **err);

#### Parameters

filename | The file on disk that you want to mmap |
err | place to store a GError if anything goes wrong. | [out][optional][nullable]

#### Returns

A new GsfInputMemory

### gsf_input_memory_new ()

    GsfInput *
    gsf_input_memory_new (guint8 const *buf,
                          gsf_off_t length,
                          gboolean needs_free);

#### Parameters

buf | The input bytes. | [array length=length]
length | The length of `buf` |
needs_free | Whether you want this memory to be free'd at object destruction |

#### Returns

A new GsfInputMemory

### gsf_input_memory_new_clone ()

    GsfInput *
    gsf_input_memory_new_clone (guint8 const *buf,
                                gsf_off_t length);

#### Parameters

buf | The input bytes. | [array length=length]
length | The length of `buf` |

#### Returns

A new GsfInputMemory

### gsf_input_memory_new_from_iochannel ()

    GsfInput *
    gsf_input_memory_new_from_iochannel (GIOChannel *channel,
                                         GError **error);

#### Parameters

channel | a GIOChannel. |
error | place to store a GError if anything goes wrong. | [out][optional][nullable]

#### Returns

a new GsfInputMemory or `NULL`.

### gsf_output_memory_get_bytes ()

    const guint8 *
    gsf_output_memory_get_bytes (GsfOutputMemory *mem);

#### Parameters

mem | the output device. |

#### Returns

The data that has been written to `mem` .

[array][nullable][transfer none]

### gsf_output_memory_new ()

    GsfOutput *
    gsf_output_memory_new (void);

#### Returns

a new file.

[nullable]

## Types and Values

### GsfInputMemory

    typedef struct _GsfInputMemory GsfInputMemory;

### GsfOutputMemory

    typedef struct _GsfOutputMemory GsfOutputMemory;