gwenhywfar  4.10.0beta
syncio.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_H
27 #define GWENHYWFAR_SYNCIO_H
28 
30 #include <gwenhywfar/inherit.h>
31 #include <gwenhywfar/list1.h>
32 #include <gwenhywfar/stringlist.h>
33 
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 
40 
41 typedef struct GWEN_SYNCIO GWEN_SYNCIO;
44 
45 
46 typedef enum {
53 
54 
55 
56 #define GWEN_SYNCIO_FLAGS_TRANSPARENT 0x80000000
57 #define GWEN_SYNCIO_FLAGS_DONTCLOSE 0x40000000
58 #define GWEN_SYNCIO_FLAGS_PASSIVE 0x20000000
59 #define GWEN_SYNCIO_FLAGS_PACKET_END 0x10000000
60 #define GWEN_SYNCIO_FLAGS_DOSMODE 0x08000000
61 
62 
63 
64 
65 
67 GWEN_SYNCIO *GWEN_SyncIo_new(const char *typeName, GWEN_SYNCIO *baseIo);
68 
71 
73 void GWEN_SyncIo_free(GWEN_SYNCIO *sio);
74 
75 
78 
81 
84 
85 
88  uint8_t *buffer,
89  uint32_t size);
90 
91 
92 
95  const uint8_t *buffer,
96  uint32_t size);
97 
99 uint32_t GWEN_SyncIo_GetFlags(const GWEN_SYNCIO *sio);
100 
102 void GWEN_SyncIo_SetFlags(GWEN_SYNCIO *sio, uint32_t fl);
103 
105 void GWEN_SyncIo_AddFlags(GWEN_SYNCIO *sio, uint32_t fl);
106 
108 void GWEN_SyncIo_SubFlags(GWEN_SYNCIO *sio, uint32_t fl);
109 
110 
113 
116 
117 
119 const char *GWEN_SyncIo_GetTypeName(const GWEN_SYNCIO *sio);
120 
121 
124 
126 GWEN_SYNCIO *GWEN_SyncIo_GetBaseIoByTypeName(const GWEN_SYNCIO *sio, const char *typeName);
127 
128 
129 
132  const uint8_t *buffer,
133  uint32_t size);
134 
135 
138  uint8_t *buffer,
139  uint32_t size);
140 
141 
142 
148 int GWEN_SyncIo_WriteString(GWEN_SYNCIO *sio, const char *s);
149 
151 int GWEN_SyncIo_WriteLine(GWEN_SYNCIO *sio, const char *s);
152 
154 int GWEN_SyncIo_WriteChar(GWEN_SYNCIO *sio, char s);
155 
156 
158 int GWEN_SyncIo_Helper_ReadFileToStringList(const char *fname,
159  int maxLines,
160  GWEN_STRINGLIST *sl);
161 
162 
163 
164 
172 
173 
175  uint8_t *buffer,
176  uint32_t size);
177 
178 
179 
181  const uint8_t *buffer,
182  uint32_t size);
193 
196 
199 
202 
208 #ifdef __cplusplus
209 }
210 #endif
211 
212 
213 
214 #endif
215 
216