Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-06 08:41:18

0001 /* GLIB - Library of useful routines for C programming
0002  * gmappedfile.h: Simplified wrapper around the mmap function
0003  *
0004  * Copyright 2005 Matthias Clasen
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-or-later
0007  *
0008  * This library is free software; you can redistribute it and/or
0009  * modify it under the terms of the GNU Lesser General Public
0010  * License as published by the Free Software Foundation; either
0011  * version 2.1 of the License, or (at your option) any later version.
0012  *
0013  * This library is distributed in the hope that it will be useful,
0014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016  * Lesser General Public License for more details.
0017  *
0018  * You should have received a copy of the GNU Lesser General Public
0019  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
0020  */
0021 
0022 #ifndef __G_MAPPED_FILE_H__
0023 #define __G_MAPPED_FILE_H__
0024 
0025 #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
0026 #error "Only <glib.h> can be included directly."
0027 #endif
0028 
0029 #include <glib/gbytes.h>
0030 #include <glib/gerror.h>
0031 
0032 G_BEGIN_DECLS
0033 
0034 typedef struct _GMappedFile GMappedFile;
0035 
0036 GLIB_AVAILABLE_IN_ALL
0037 GMappedFile *g_mapped_file_new          (const gchar  *filename,
0038                          gboolean      writable,
0039                          GError      **error);
0040 GLIB_AVAILABLE_IN_ALL
0041 GMappedFile *g_mapped_file_new_from_fd  (gint          fd,
0042                      gboolean      writable,
0043                      GError      **error);
0044 GLIB_AVAILABLE_IN_ALL
0045 gsize        g_mapped_file_get_length   (GMappedFile  *file);
0046 GLIB_AVAILABLE_IN_ALL
0047 gchar       *g_mapped_file_get_contents (GMappedFile  *file);
0048 GLIB_AVAILABLE_IN_2_34
0049 GBytes *     g_mapped_file_get_bytes    (GMappedFile  *file);
0050 GLIB_AVAILABLE_IN_ALL
0051 GMappedFile *g_mapped_file_ref          (GMappedFile  *file);
0052 GLIB_AVAILABLE_IN_ALL
0053 void         g_mapped_file_unref        (GMappedFile  *file);
0054 
0055 GLIB_DEPRECATED_FOR(g_mapped_file_unref)
0056 void         g_mapped_file_free         (GMappedFile  *file);
0057 
0058 G_END_DECLS
0059 
0060 #endif /* __G_MAPPED_FILE_H__ */