gwenhywfar 4.0.3

syncio_file.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  begin       : Tue Apr 27 2010
00003  copyright   : (C) 2010 by Martin Preuss
00004  email       : martin@libchipcard.de
00005 
00006  ***************************************************************************
00007  *                                                                         *
00008  *   This library is free software; you can redistribute it and/or         *
00009  *   modify it under the terms of the GNU Lesser General Public            *
00010  *   License as published by the Free Software Foundation; either          *
00011  *   version 2.1 of the License, or (at your option) any later version.    *
00012  *                                                                         *
00013  *   This library is distributed in the hope that it will be useful,       *
00014  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00015  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00016  *   Lesser General Public License for more details.                       *
00017  *                                                                         *
00018  *   You should have received a copy of the GNU Lesser General Public      *
00019  *   License along with this library; if not, write to the Free Software   *
00020  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00021  *   MA  02111-1307  USA                                                   *
00022  *                                                                         *
00023  ***************************************************************************/
00024 
00025 
00026 #ifndef GWENHYWFAR_SYNCIO_FILE_H
00027 #define GWENHYWFAR_SYNCIO_FILE_H
00028 
00029 #include <gwenhywfar/syncio.h>
00030 
00031 
00032 #define GWEN_SYNCIO_FILE_TYPE "file"
00033 
00034 
00035 
00036 typedef enum {
00037   GWEN_SyncIo_File_CreationMode_Unknown=-1,
00038   GWEN_SyncIo_File_CreationMode_OpenExisting=0,
00039   GWEN_SyncIo_File_CreationMode_CreateNew,
00040   GWEN_SyncIo_File_CreationMode_CreateAlways,
00041   GWEN_SyncIo_File_CreationMode_OpenAlways,
00042   GWEN_SyncIo_File_CreationMode_TruncateExisting
00043 } GWEN_SYNCIO_FILE_CREATIONMODE;
00044 
00045 
00046 typedef enum {
00047   GWEN_SyncIo_File_Whence_Set=0,
00048   GWEN_SyncIo_File_Whence_Current,
00049   GWEN_SyncIo_File_Whence_End
00050 } GWEN_SYNCIO_FILE_WHENCE;
00051 
00052 
00053 #define GWEN_SYNCIO_FILE_FLAGS_READ   0x00000001
00054 #define GWEN_SYNCIO_FILE_FLAGS_WRITE  0x00000002
00055 #define GWEN_SYNCIO_FILE_FLAGS_APPEND 0x00000008
00056 #define GWEN_SYNCIO_FILE_FLAGS_RANDOM 0x00000010
00057 
00058 #define GWEN_SYNCIO_FILE_FLAGS_UREAD  0x00000100
00059 #define GWEN_SYNCIO_FILE_FLAGS_UWRITE 0x00000200
00060 #define GWEN_SYNCIO_FILE_FLAGS_UEXEC  0x00000400
00061 
00062 #define GWEN_SYNCIO_FILE_FLAGS_GREAD  0x00001000
00063 #define GWEN_SYNCIO_FILE_FLAGS_GWRITE 0x00002000
00064 #define GWEN_SYNCIO_FILE_FLAGS_GEXEC  0x00004000
00065 
00066 #define GWEN_SYNCIO_FILE_FLAGS_OREAD  0x00010000
00067 #define GWEN_SYNCIO_FILE_FLAGS_OWRITE 0x00020000
00068 #define GWEN_SYNCIO_FILE_FLAGS_OEXEC  0x00040000
00069 
00070 
00071 
00072 #ifdef __cplusplus
00073 extern "C" {
00074 #endif
00075 
00076 
00077 
00078 GWENHYWFAR_API
00079 GWEN_SYNCIO *GWEN_SyncIo_File_new(const char *path, GWEN_SYNCIO_FILE_CREATIONMODE cm);
00080 
00081 
00082 GWENHYWFAR_API
00083 GWEN_SYNCIO *GWEN_SyncIo_File_fromStdin();
00084 
00085 GWENHYWFAR_API
00086 GWEN_SYNCIO *GWEN_SyncIo_File_fromStdout();
00087 
00088 GWENHYWFAR_API
00089 GWEN_SYNCIO *GWEN_SyncIo_File_fromStderr();
00090 
00091 GWENHYWFAR_API
00092 const char *GWEN_SyncIo_File_GetPath(const GWEN_SYNCIO *sio);
00093 
00094 GWENHYWFAR_API
00095 int64_t GWEN_SyncIo_File_Seek(GWEN_SYNCIO *sio, int64_t pos, GWEN_SYNCIO_FILE_WHENCE whence);
00096 
00097 
00098 #ifdef __cplusplus
00099 }
00100 #endif
00101 
00102 
00103 #endif
00104 
00105