29 #define DISABLE_DEBUGLOG
36 #include <gwenhywfar/misc.h>
37 #include <gwenhywfar/debug.h>
60 sio->typeName=strdup(typeName);
70 assert(sio->refCount);
78 assert(sio->refCount);
79 if (sio->refCount==1) {
96 assert(sio->refCount);
98 return sio->connectFn(sio);
107 assert(sio->refCount);
108 if (sio->disconnectFn)
109 return sio->disconnectFn(sio);
118 assert(sio->refCount);
120 return sio->flushFn(sio);
131 assert(sio->refCount);
133 return sio->readFn(sio, buffer, size);
141 const uint8_t *buffer,
144 assert(sio->refCount);
146 return sio->writeFn(sio, buffer, size);
155 assert(sio->refCount);
163 assert(sio->refCount);
171 assert(sio->refCount);
179 assert(sio->refCount);
187 assert(sio->refCount);
195 assert(sio->refCount);
203 assert(sio->refCount);
204 return sio->typeName;
211 assert(sio->refCount);
221 assert(sio->refCount);
225 if (baseIo->typeName && strcasecmp(baseIo->typeName, typeName)==0)
227 baseIo=baseIo->baseIo;
239 assert(sio->refCount);
251 assert(sio->refCount);
252 of=sio->disconnectFn;
253 sio->disconnectFn=fn;
263 assert(sio->refCount);
275 assert(sio->refCount);
287 assert(sio->refCount);
296 const uint8_t *buffer,