00001 /* GLIB - Library of useful routines for C programming 00002 * gmappedfile.h: Simplified wrapper around the mmap function 00003 * 00004 * Copyright 2005 Matthias Clasen 00005 * Portions copyright (c) 2006 Nokia Corporation. All rights reserved. 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the 00019 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00020 * Boston, MA 02111-1307, USA. 00021 */ 00022 #ifndef __G_MAPPED_FILE_H__ 00023 #define __G_MAPPED_FILE_H__ 00024 00025 #include <_ansi.h> 00026 #include <glib/gerror.h> 00027 00028 G_BEGIN_DECLS 00029 00030 typedef struct _GMappedFile GMappedFile; 00031 00032 IMPORT_C GMappedFile *g_mapped_file_new (const gchar *filename, 00033 gboolean writable, 00034 GError **error) G_GNUC_MALLOC; 00035 IMPORT_C gsize g_mapped_file_get_length (GMappedFile *file); 00036 IMPORT_C gchar *g_mapped_file_get_contents (GMappedFile *file); 00037 IMPORT_C void g_mapped_file_free (GMappedFile *file); 00038 00039 G_END_DECLS 00040 00041 #endif /* __G_MAPPED_FILE_H__ */