Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:59

0001 /* GIO - GLib Input, Output and Streaming Library
0002  *
0003  * Copyright (C) 2006-2007 Red Hat, Inc.
0004  *
0005  * SPDX-License-Identifier: LGPL-2.1-or-later
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General
0018  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0019  *
0020  * Author: Alexander Larsson <alexl@redhat.com>
0021  */
0022 
0023 #ifndef __G_RESOURCE_H__
0024 #define __G_RESOURCE_H__
0025 
0026 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0027 #error "Only <gio/gio.h> can be included directly."
0028 #endif
0029 
0030 #include <gio/giotypes.h>
0031 
0032 G_BEGIN_DECLS
0033 
0034 /**
0035  * G_TYPE_RESOURCE:
0036  *
0037  * The #GType for #GResource.
0038  */
0039 #define G_TYPE_RESOURCE (g_resource_get_type ())
0040 
0041 
0042 /**
0043  * G_RESOURCE_ERROR:
0044  *
0045  * Error domain for #GResource. Errors in this domain will be from the
0046  * #GResourceError enumeration. See #GError for more information on
0047  * error domains.
0048  */
0049 #define G_RESOURCE_ERROR (g_resource_error_quark ())
0050 GIO_AVAILABLE_IN_2_32
0051 GQuark g_resource_error_quark (void);
0052 
0053 typedef struct _GStaticResource GStaticResource;
0054 
0055 struct _GStaticResource {
0056   /*< private >*/
0057   const guint8 *data;
0058   gsize data_len;
0059   GResource *resource;
0060   GStaticResource *next;
0061   gpointer padding;
0062 };
0063 
0064 GIO_AVAILABLE_IN_2_32
0065 GType         g_resource_get_type            (void) G_GNUC_CONST;
0066 GIO_AVAILABLE_IN_2_32
0067 GResource *   g_resource_new_from_data       (GBytes                *data,
0068                           GError               **error);
0069 GIO_AVAILABLE_IN_2_32
0070 GResource *   g_resource_ref                 (GResource             *resource);
0071 GIO_AVAILABLE_IN_2_32
0072 void          g_resource_unref               (GResource             *resource);
0073 GIO_AVAILABLE_IN_2_32
0074 GResource *   g_resource_load                (const gchar           *filename,
0075                           GError               **error);
0076 GIO_AVAILABLE_IN_2_32
0077 GInputStream *g_resource_open_stream         (GResource             *resource,
0078                           const char            *path,
0079                           GResourceLookupFlags   lookup_flags,
0080                           GError               **error);
0081 GIO_AVAILABLE_IN_2_32
0082 GBytes *      g_resource_lookup_data         (GResource             *resource,
0083                           const char            *path,
0084                           GResourceLookupFlags   lookup_flags,
0085                           GError               **error);
0086 GIO_AVAILABLE_IN_2_32
0087 char **       g_resource_enumerate_children  (GResource             *resource,
0088                           const char            *path,
0089                           GResourceLookupFlags   lookup_flags,
0090                           GError               **error);
0091 GIO_AVAILABLE_IN_2_32
0092 gboolean      g_resource_get_info            (GResource             *resource,
0093                           const char            *path,
0094                           GResourceLookupFlags   lookup_flags,
0095                           gsize                 *size,
0096                           guint32               *flags,
0097                           GError               **error);
0098 
0099 GIO_AVAILABLE_IN_2_32
0100 void          g_resources_register           (GResource             *resource);
0101 GIO_AVAILABLE_IN_2_32
0102 void          g_resources_unregister         (GResource             *resource);
0103 GIO_AVAILABLE_IN_2_32
0104 GInputStream *g_resources_open_stream        (const char            *path,
0105                           GResourceLookupFlags   lookup_flags,
0106                           GError               **error);
0107 GIO_AVAILABLE_IN_2_32
0108 GBytes *      g_resources_lookup_data        (const char            *path,
0109                           GResourceLookupFlags   lookup_flags,
0110                           GError               **error);
0111 GIO_AVAILABLE_IN_2_32
0112 char **       g_resources_enumerate_children (const char            *path,
0113                           GResourceLookupFlags   lookup_flags,
0114                           GError               **error);
0115 GIO_AVAILABLE_IN_2_32
0116 gboolean      g_resources_get_info           (const char            *path,
0117                           GResourceLookupFlags   lookup_flags,
0118                           gsize                 *size,
0119                           guint32               *flags,
0120                           GError               **error);
0121 
0122 
0123 GIO_AVAILABLE_IN_2_32
0124 void          g_static_resource_init          (GStaticResource *static_resource);
0125 GIO_AVAILABLE_IN_2_32
0126 void          g_static_resource_fini          (GStaticResource *static_resource);
0127 GIO_AVAILABLE_IN_2_32
0128 GResource    *g_static_resource_get_resource  (GStaticResource *static_resource);
0129 
0130 G_END_DECLS
0131 
0132 #endif /* __G_RESOURCE_H__ */