Blame libgcab/gcab-cabinet.h

Packit 8ef017
/*
Packit 8ef017
 * LibGCab
Packit 8ef017
 * Copyright (c) 2012, Marc-André Lureau <marcandre.lureau@gmail.com>
Packit 8ef017
 *
Packit 8ef017
 * This library is free software; you can redistribute it and/or
Packit 8ef017
 * modify it under the terms of the GNU Lesser General Public
Packit 8ef017
 * License as published by the Free Software Foundation; either
Packit 8ef017
 * version 2.1 of the License, or (at your option) any later version.
Packit 8ef017
 *
Packit 8ef017
 * This library is distributed in the hope that it will be useful,
Packit 8ef017
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 8ef017
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Packit 8ef017
 * Lesser General Public License for more details.
Packit 8ef017
 *
Packit 8ef017
 * You should have received a copy of the GNU Lesser General Public
Packit 8ef017
 * License along with this library; if not, write to the Free Software
Packit 8ef017
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
Packit 8ef017
 * MA 02110-1301 USA
Packit 8ef017
 */
Packit 8ef017
Packit 8ef017
#ifndef _GCAB_CABINET_H_
Packit 8ef017
#define _GCAB_CABINET_H_
Packit 8ef017
Packit 8ef017
#include <gio/gio.h>
Packit 8ef017
#include <glib-object.h>
Packit 8ef017
Packit 8ef017
#include "gcab-folder.h"
Packit 8ef017
#include "gcab-file.h"
Packit 8ef017
Packit 8ef017
G_BEGIN_DECLS
Packit 8ef017
Packit 8ef017
/**
Packit 8ef017
 * GCabCabinet:
Packit 8ef017
 *
Packit 8ef017
 * An opaque object holding a Cabinet file reference.
Packit 8ef017
 **/
Packit 8ef017
#define GCAB_TYPE_CABINET                (gcab_cabinet_get_type ())
Packit 8ef017
G_DECLARE_FINAL_TYPE(GCabCabinet, gcab_cabinet, GCAB, CABINET, GObject)
Packit 8ef017
Packit 8ef017
/**
Packit 8ef017
 * GCAB_ERROR:
Packit 8ef017
 *
Packit 8ef017
 * Error domain for the GCab library. See #GError for more information
Packit 8ef017
 * on error domains.
Packit 8ef017
 */
Packit 8ef017
#define GCAB_ERROR gcab_error_quark ()
Packit 8ef017
GQuark gcab_error_quark (void);
Packit 8ef017
Packit 8ef017
/**
Packit 8ef017
 * GCabError:
Packit 8ef017
 * @GCAB_ERROR_FORMAT:          The given file is not of Cabinet format.
Packit 8ef017
 * @GCAB_ERROR_FAILED:          General function failure.
Packit 8ef017
 * @GCAB_ERROR_NOT_SUPPORTED:   Action or format is not supported
Packit 8ef017
 * @GCAB_ERROR_INVALID_DATA:    Data stream was invalid
Packit 8ef017
 *
Packit 8ef017
 * The various errors triggered by the GCab functions.
Packit 8ef017
 **/
Packit 8ef017
typedef enum GCabError
Packit 8ef017
{
Packit 8ef017
    GCAB_ERROR_FORMAT,
Packit 8ef017
    GCAB_ERROR_FAILED,
Packit 8ef017
    GCAB_ERROR_NOT_SUPPORTED,   /* Since: 1.0 */
Packit 8ef017
    GCAB_ERROR_INVALID_DATA,    /* Since: 1.0 */
Packit 8ef017
} GCabError;
Packit 8ef017
Packit 8ef017
GCabCabinet *      gcab_cabinet_new           (void);
Packit 8ef017
gboolean           gcab_cabinet_load          (GCabCabinet *cabinet,
Packit 8ef017
                                               GInputStream *stream,
Packit 8ef017
                                               GCancellable *cancellable,
Packit 8ef017
                                               GError **error);
Packit 8ef017
Packit 8ef017
GPtrArray *        gcab_cabinet_get_folders   (GCabCabinet *cabinet);
Packit 8ef017
guint32            gcab_cabinet_get_size      (GCabCabinet *cabinet);
Packit 8ef017
Packit 8ef017
gboolean           gcab_cabinet_add_folder    (GCabCabinet *cabinet,
Packit 8ef017
                                               GCabFolder *folder,
Packit 8ef017
                                               GError **error);
Packit 8ef017
gboolean           gcab_cabinet_write         (GCabCabinet *cabinet,
Packit 8ef017
                                               GOutputStream *stream,
Packit 8ef017
                                               GCabFileCallback file_callback,
Packit 8ef017
                                               GFileProgressCallback progress_callback,
Packit 8ef017
                                               gpointer user_data,
Packit 8ef017
                                               GCancellable *cancellable,
Packit 8ef017
                                               GError **error);
Packit 8ef017
gboolean           gcab_cabinet_write_simple  (GCabCabinet *cabinet,
Packit 8ef017
                                               GOutputStream *stream,
Packit 8ef017
                                               GCabFileCallback file_callback,
Packit 8ef017
                                               gpointer user_data,
Packit 8ef017
                                               GCancellable *cancellable,
Packit 8ef017
                                               GError **error);
Packit 8ef017
gboolean           gcab_cabinet_extract       (GCabCabinet *cabinet,
Packit 8ef017
                                               GFile *path,
Packit 8ef017
                                               GCabFileCallback file_callback,
Packit 8ef017
                                               GFileProgressCallback progress_callback,
Packit 8ef017
                                               gpointer user_data,
Packit 8ef017
                                               GCancellable *cancellable,
Packit 8ef017
                                               GError **error);
Packit 8ef017
gboolean           gcab_cabinet_extract_simple(GCabCabinet *cabinet,
Packit 8ef017
                                               GFile *path,
Packit 8ef017
                                               GCabFileCallback file_callback,
Packit 8ef017
                                               gpointer user_data,
Packit 8ef017
                                               GCancellable *cancellable,
Packit 8ef017
                                               GError **error);
Packit 8ef017
const GByteArray * gcab_cabinet_get_signature (GCabCabinet *cabinet,
Packit 8ef017
                                               GCancellable *cancellable,
Packit 8ef017
                                               GError **error);
Packit 8ef017
Packit 8ef017
G_END_DECLS
Packit 8ef017
Packit 8ef017
#endif /* _GCAB_CABINET_H_ */