fu-archive: fwupd Reference Manual

## fu-archive fu-archive |

## Functions

gboolean | (*FuArchiveIterateFunc) ()
FuArchive * | fu_archive_new ()
GBytes * | fu_archive_lookup_by_fn ()
gboolean | fu_archive_iterate ()

## Types and Values

#define | FU_TYPE_ARCHIVE
enum | FuArchiveFlags
| FuArchive

## Description

## Functions

### FuArchiveIterateFunc ()

    gboolean
    (*FuArchiveIterateFunc) (FuArchive *self,
                             const gchar *filename,
                             GBytes *bytes,
                             gpointer user_data,
                             GError **error);

The archive iteration callback.

#### Parameters

self | a FuArchive |
filename | a filename |
bytes | the blob referenced by `filename` |
user_data | user data |
error | a GError or NULL |

### fu_archive_new ()

    FuArchive *
    fu_archive_new (GBytes *data,
                    FuArchiveFlags flags,
                    GError **error);

Parses `data` as an archive and decompresses all files to memory blobs.

#### Parameters

data | archive contents |
flags | archive flags, e.g. `FU_ARCHIVE_FLAG_NONE` |
error | optional return location for an error. | [nullable]

#### Returns

a FuArchive, or `NULL` if the archive was invalid in any way.

Since: 1.2.2

### fu_archive_lookup_by_fn ()

    GBytes *
    fu_archive_lookup_by_fn (FuArchive *self,
                             const gchar *fn,
                             GError **error);

Finds the blob referenced by filename

#### Parameters

self | a FuArchive |
fn | a filename |
error | optional return location for an error. | [nullable]

#### Returns

a GBytes, or `NULL` if the filename was not found.

[transfer none]

Since: 1.2.2

### fu_archive_iterate ()

    gboolean
    fu_archive_iterate (FuArchive *self,
                        FuArchiveIterateFunc callback,
                        gpointer user_data,
                        GError **error);

Iterates over the archive contents, calling the given function for each of the files found. If any `callback` returns `FALSE` scanning is aborted.

#### Parameters

self | a FuArchive |
callback | a FuArchiveIterateFunc. | [scope call]
user_data | user data |
error | optional return location for an error. | [nullable]

#### Returns

True if no `callback` returned FALSE

Since: 1.3.4

## Types and Values

### FU_TYPE_ARCHIVE

    #define FU_TYPE_ARCHIVE (fu_archive_get_type())

### enum FuArchiveFlags

The flags to use when loading the archive.

#### Members

FU_ARCHIVE_FLAG_NONE | No flags set |
FU_ARCHIVE_FLAG_IGNORE_PATH | Ignore any path component |

### FuArchive

    typedef struct _FuArchive FuArchive;

An in-memory archive decompressor