2005-06-25 05:38:32 +02:00
|
|
|
/* GLIB - Library of useful routines for C programming
|
|
|
|
* gmappedfile.h: Simplified wrapper around the mmap function
|
|
|
|
*
|
|
|
|
* Copyright 2005 Matthias Clasen
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2017-01-05 12:47:07 +01:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2005-06-25 05:38:32 +02:00
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2014-01-23 12:58:29 +01:00
|
|
|
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
2005-06-25 05:38:32 +02:00
|
|
|
*/
|
2008-03-14 20:30:38 +01:00
|
|
|
|
2012-12-28 05:43:14 +01:00
|
|
|
#ifndef __G_MAPPED_FILE_H__
|
|
|
|
#define __G_MAPPED_FILE_H__
|
|
|
|
|
2011-10-12 06:24:46 +02:00
|
|
|
#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
|
2008-03-14 20:30:38 +01:00
|
|
|
#error "Only <glib.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2011-11-11 17:08:26 +01:00
|
|
|
#include <glib/gbytes.h>
|
2005-06-25 05:38:32 +02:00
|
|
|
#include <glib/gerror.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
typedef struct _GMappedFile GMappedFile;
|
|
|
|
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2005-06-25 05:38:32 +02:00
|
|
|
GMappedFile *g_mapped_file_new (const gchar *filename,
|
|
|
|
gboolean writable,
|
2018-08-22 12:15:08 +02:00
|
|
|
GError **error);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2011-09-21 19:59:03 +02:00
|
|
|
GMappedFile *g_mapped_file_new_from_fd (gint fd,
|
|
|
|
gboolean writable,
|
2018-08-22 12:15:08 +02:00
|
|
|
GError **error);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2005-06-25 05:38:32 +02:00
|
|
|
gsize g_mapped_file_get_length (GMappedFile *file);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2005-06-25 05:38:32 +02:00
|
|
|
gchar *g_mapped_file_get_contents (GMappedFile *file);
|
2012-05-30 00:54:58 +02:00
|
|
|
GLIB_AVAILABLE_IN_2_34
|
|
|
|
GBytes * g_mapped_file_get_bytes (GMappedFile *file);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2009-06-18 21:00:01 +02:00
|
|
|
GMappedFile *g_mapped_file_ref (GMappedFile *file);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2009-06-18 21:00:01 +02:00
|
|
|
void g_mapped_file_unref (GMappedFile *file);
|
|
|
|
|
2011-10-11 08:34:59 +02:00
|
|
|
GLIB_DEPRECATED_FOR(g_mapped_file_unref)
|
|
|
|
void g_mapped_file_free (GMappedFile *file);
|
2005-06-25 05:38:32 +02:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __G_MAPPED_FILE_H__ */
|