epoc32/include/stdapis/glib-2.0/glib/gstdio.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 0 061f57f2323e
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
     1 /* gstdio.h - GFilename wrappers for C library functions
     2  *
     3  * Copyright 2004 Tor Lillqvist
     4  * Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
     5  *
     6  * GLib is free software; you can redistribute it and/or modify it
     7  * under the terms of the GNU Lesser General Public License as
     8  * published by the Free Software Foundation; either version 2 of the
     9  * License, or (at your option) any later version.
    10  *
    11  * GLib is distributed in the hope that it will be useful,
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    14  * Lesser General Public License for more details.
    15  *
    16  * You should have received a copy of the GNU Lesser General Public
    17  * License along with GLib; see the file COPYING.LIB.  If not,
    18  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    19  * Boston, MA 02111-1307, USA.
    20  */
    21 
    22 #ifndef __G_STDIO_H__
    23 #define __G_STDIO_H__
    24 
    25 #include <_ansi.h>
    26 #include <glib/gprintf.h>
    27 
    28 #include <sys/stat.h>
    29 
    30 G_BEGIN_DECLS
    31 
    32 #if defined(G_OS_UNIX) && !defined(G_STDIO_NO_WRAP_ON_UNIX) && !defined(__SYMBIAN32__)
    33 
    34 /* Just pass on to the system functions, so there's no potential for data
    35  * format mismatches, especially with large file interfaces. 
    36  * A few functions can't be handled in this way, since they are not defined
    37  * in a portable system header that we could include here.
    38  */
    39 
    40 #define g_chmod   chmod
    41 #define g_open    open
    42 #define g_creat   creat
    43 #define g_rename  rename
    44 #define g_mkdir   mkdir
    45 #define g_stat    stat
    46 #define g_lstat   lstat
    47 #define g_remove  remove
    48 #define g_fopen   fopen
    49 #define g_freopen freopen
    50 
    51 IMPORT_C int g_access (const gchar *filename,
    52 	      int          mode);
    53 
    54 IMPORT_C int g_chdir  (const gchar *path);
    55 
    56 IMPORT_C int g_unlink (const gchar *filename);
    57 
    58 IMPORT_C int g_rmdir  (const gchar *filename);
    59 
    60 #else /* ! G_OS_UNIX */
    61 
    62 /* Wrappers for C library functions that take pathname arguments. On
    63  * Unix, the pathname is a file name as it literally is in the file
    64  * system. On well-maintained systems with consistent users who know
    65  * what they are doing and no exchange of files with others this would
    66  * be a well-defined encoding, preferrably UTF-8. On Windows, the
    67  * pathname is always in UTF-8, even if that is not the on-disk
    68  * encoding, and not the encoding accepted by the C library or Win32
    69  * API.
    70  */
    71 
    72 IMPORT_C int g_access    (const gchar *filename,
    73 		 int          mode);
    74 
    75 IMPORT_C int g_chmod     (const gchar *filename,
    76 		 int          mode);
    77 
    78 IMPORT_C int g_open      (const gchar *filename,
    79                  int          flags,
    80                  int          mode);
    81 
    82 IMPORT_C int g_creat     (const gchar *filename,
    83                  int          mode);
    84 
    85 IMPORT_C int g_rename    (const gchar *oldfilename,
    86                  const gchar *newfilename);
    87 
    88 IMPORT_C int g_mkdir     (const gchar *filename,
    89                  int          mode);
    90 
    91 IMPORT_C int g_chdir     (const gchar *path);
    92 
    93 IMPORT_C int g_stat      (const gchar *filename,
    94                  struct stat *buf);
    95 
    96 IMPORT_C int g_lstat     (const gchar *filename,
    97                  struct stat *buf);
    98 
    99 IMPORT_C int g_unlink    (const gchar *filename);
   100 
   101 IMPORT_C int g_remove    (const gchar *filename);
   102 
   103 IMPORT_C int g_rmdir (const gchar *filename);
   104 
   105 IMPORT_C FILE *g_fopen   (const gchar *filename,
   106                  const gchar *mode);
   107 
   108 IMPORT_C FILE *g_freopen (const gchar *filename,
   109                  const gchar *mode,
   110                  FILE        *stream);
   111 
   112 #endif /* G_OS_UNIX */
   113 
   114 G_END_DECLS
   115 
   116 #endif /* __G_STDIO_H__ */