gwenhywfar
5.2.0
gwenhywfar5
gwenhywfar
syncio_file.h
Go to the documentation of this file.
1
/***************************************************************************
2
begin : Tue Apr 27 2010
3
copyright : (C) 2010 by Martin Preuss
4
email : martin@libchipcard.de
5
6
***************************************************************************
7
* *
8
* This library is free software; you can redistribute it and/or *
9
* modify it under the terms of the GNU Lesser General Public *
10
* License as published by the Free Software Foundation; either *
11
* version 2.1 of the License, or (at your option) any later version. *
12
* *
13
* This library is distributed in the hope that it will be useful, *
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16
* Lesser General Public License for more details. *
17
* *
18
* You should have received a copy of the GNU Lesser General Public *
19
* License along with this library; if not, write to the Free Software *
20
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21
* MA 02111-1307 USA *
22
* *
23
***************************************************************************/
24
25
26
#ifndef GWENHYWFAR_SYNCIO_FILE_H
27
#define GWENHYWFAR_SYNCIO_FILE_H
28
29
#include <
gwenhywfar/syncio.h
>
30
31
32
#define GWEN_SYNCIO_FILE_TYPE "file"
33
34
35
36
typedef
enum
{
37
GWEN_SyncIo_File_CreationMode_Unknown
=-1,
38
GWEN_SyncIo_File_CreationMode_OpenExisting
=0,
39
GWEN_SyncIo_File_CreationMode_CreateNew
,
40
GWEN_SyncIo_File_CreationMode_CreateAlways
,
41
GWEN_SyncIo_File_CreationMode_OpenAlways
,
42
GWEN_SyncIo_File_CreationMode_TruncateExisting
43
}
GWEN_SYNCIO_FILE_CREATIONMODE
;
44
45
46
typedef
enum
{
47
GWEN_SyncIo_File_Whence_Set
=0,
48
GWEN_SyncIo_File_Whence_Current
,
49
GWEN_SyncIo_File_Whence_End
50
}
GWEN_SYNCIO_FILE_WHENCE
;
51
52
53
#define GWEN_SYNCIO_FILE_FLAGS_READ 0x00000001
54
#define GWEN_SYNCIO_FILE_FLAGS_WRITE 0x00000002
55
#define GWEN_SYNCIO_FILE_FLAGS_APPEND 0x00000008
56
#define GWEN_SYNCIO_FILE_FLAGS_RANDOM 0x00000010
57
58
#define GWEN_SYNCIO_FILE_FLAGS_UREAD 0x00000100
59
#define GWEN_SYNCIO_FILE_FLAGS_UWRITE 0x00000200
60
#define GWEN_SYNCIO_FILE_FLAGS_UEXEC 0x00000400
61
62
#define GWEN_SYNCIO_FILE_FLAGS_GREAD 0x00001000
63
#define GWEN_SYNCIO_FILE_FLAGS_GWRITE 0x00002000
64
#define GWEN_SYNCIO_FILE_FLAGS_GEXEC 0x00004000
65
66
#define GWEN_SYNCIO_FILE_FLAGS_OREAD 0x00010000
67
#define GWEN_SYNCIO_FILE_FLAGS_OWRITE 0x00020000
68
#define GWEN_SYNCIO_FILE_FLAGS_OEXEC 0x00040000
69
70
71
72
#ifdef __cplusplus
73
extern
"C"
{
74
#endif
75
76
77
78
GWENHYWFAR_API
79
GWEN_SYNCIO
*
GWEN_SyncIo_File_new
(
const
char
*path,
GWEN_SYNCIO_FILE_CREATIONMODE
cm);
80
81
82
GWENHYWFAR_API
83
GWEN_SYNCIO
*
GWEN_SyncIo_File_fromStdin
(
void
);
84
85
GWENHYWFAR_API
86
GWEN_SYNCIO
*
GWEN_SyncIo_File_fromStdout
(
void
);
87
88
GWENHYWFAR_API
89
GWEN_SYNCIO
*
GWEN_SyncIo_File_fromStderr
(
void
);
90
91
GWENHYWFAR_API
92
const
char
*
GWEN_SyncIo_File_GetPath
(
const
GWEN_SYNCIO
*sio);
93
94
GWENHYWFAR_API
95
int64_t
GWEN_SyncIo_File_Seek
(
GWEN_SYNCIO
*sio, int64_t pos,
GWEN_SYNCIO_FILE_WHENCE
whence);
96
97
98
#ifdef __cplusplus
99
}
100
#endif
101
102
103
#endif
104
105
GWEN_SYNCIO_FILE_WHENCE
GWEN_SYNCIO_FILE_WHENCE
Definition:
syncio_file.h:45
GWEN_SYNCIO
struct GWEN_SYNCIO GWEN_SYNCIO
Definition:
syncio.h:39
GWEN_SyncIo_File_GetPath
const GWENHYWFAR_API char * GWEN_SyncIo_File_GetPath(const GWEN_SYNCIO *sio)
GWEN_SyncIo_File_Whence_Current
Definition:
syncio_file.h:47
GWEN_SyncIo_File_fromStdout
GWENHYWFAR_API GWEN_SYNCIO * GWEN_SyncIo_File_fromStdout(void)
syncio.h
GWEN_SyncIo_File_Whence_Set
Definition:
syncio_file.h:46
GWEN_SYNCIO_FILE_CREATIONMODE
GWEN_SYNCIO_FILE_CREATIONMODE
Definition:
syncio_file.h:35
GWEN_SyncIo_File_CreationMode_Unknown
Definition:
syncio_file.h:36
GWEN_SyncIo_File_CreationMode_CreateNew
Definition:
syncio_file.h:38
GWEN_SyncIo_File_CreationMode_TruncateExisting
Definition:
syncio_file.h:41
GWEN_SyncIo_File_fromStdin
GWENHYWFAR_API GWEN_SYNCIO * GWEN_SyncIo_File_fromStdin(void)
GWEN_SyncIo_File_CreationMode_OpenExisting
Definition:
syncio_file.h:37
GWEN_SyncIo_File_fromStderr
GWENHYWFAR_API GWEN_SYNCIO * GWEN_SyncIo_File_fromStderr(void)
GWEN_SyncIo_File_Whence_End
Definition:
syncio_file.h:48
GWEN_SyncIo_File_new
GWENHYWFAR_API GWEN_SYNCIO * GWEN_SyncIo_File_new(const char *path, GWEN_SYNCIO_FILE_CREATIONMODE cm)
GWENHYWFAR_API
#define GWENHYWFAR_API
Definition:
gwenhywfarapi.h:66
GWEN_SyncIo_File_CreationMode_OpenAlways
Definition:
syncio_file.h:40
GWEN_SyncIo_File_Seek
GWENHYWFAR_API int64_t GWEN_SyncIo_File_Seek(GWEN_SYNCIO *sio, int64_t pos, GWEN_SYNCIO_FILE_WHENCE whence)
GWEN_SyncIo_File_CreationMode_CreateAlways
Definition:
syncio_file.h:39
Generated by
1.8.16