Changeset 1293:8e2deef687c3 in roaraudio
- Timestamp:
- 03/12/09 03:41:44 (15 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/vio.h
r1291 r1293 110 110 111 111 FILE * roar_vio_to_stdio (struct roar_vio_calls * calls, int flags); 112 #if defined(ROAR_HAVE_FOPENCOOKIE) || defined(ROAR_HAVE_FUNOPEN) 113 int roar_vio_to_stdio_close (void *__cookie); 114 #endif 115 #if defined(ROAR_HAVE_FOPENCOOKIE) 116 __ssize_t roar_vio_to_stdio_read (void *__cookie, char *__buf, size_t __nbytes); 117 __ssize_t roar_vio_to_stdio_write (void *__cookie, __const char *__buf, size_t __n); 118 int roar_vio_to_stdio_lseek (void *__cookie, _IO_off64_t *__pos, int __w); 119 #elif defined(ROAR_HAVE_FUNOPEN) 120 int roar_vio_to_stdio_read(void *__cookie, char *__buf, int __nbytes); 121 int roar_vio_to_stdio_write(void *__cookie, const char *__buf, int __n); 122 fpos_t roar_vio_to_stdio_lseek(void *__cookie, fpos_t __pos, int __w); 123 #endif 112 124 113 125 -
libroar/vio.c
r1291 r1293 249 249 memset(&foc_funcs, 0, sizeof(cookie_io_functions_t)); 250 250 251 foc_funcs.close = roar_vio_to_stdio_close; 252 foc_funcs.read = roar_vio_to_stdio_read; 253 foc_funcs.write = roar_vio_to_stdio_write; 254 251 255 return fopencookie((void*) calls, "rw", foc_funcs); 252 256 #elif defined(ROAR_HAVE_FUNOPEN) 253 return funopen((void*) calls, NULL /* read */, NULL /* write */, NULL /* lseek */, NULL /* close */); 257 return funopen((void*) calls, roar_vio_to_stdio_read, roar_vio_to_stdio_write, 258 roar_vio_to_stdio_lseek, roar_vio_to_stdio_close); 254 259 #else 255 260 return NULL; 256 261 #endif 257 262 } 263 264 #if defined(ROAR_HAVE_FOPENCOOKIE) || defined(ROAR_HAVE_FUNOPEN) 265 int roar_vio_to_stdio_close (void *__cookie) { 266 return roar_vio_close((struct roar_vio_calls *) __cookie); 267 } 268 #endif 269 270 #if defined(ROAR_HAVE_FOPENCOOKIE) 271 __ssize_t roar_vio_to_stdio_read (void *__cookie, char *__buf, size_t __nbytes) { 272 #elif defined(ROAR_HAVE_FUNOPEN) 273 int roar_vio_to_stdio_read(void *__cookie, char *__buf, int __nbytes) { 274 #endif 275 return roar_vio_read((struct roar_vio_calls *) __cookie, __buf, __nbytes); 276 } 277 278 #if defined(ROAR_HAVE_FOPENCOOKIE) 279 __ssize_t roar_vio_to_stdio_write (void *__cookie, __const char *__buf, size_t __n) { 280 #elif defined(ROAR_HAVE_FUNOPEN) 281 int roar_vio_to_stdio_write(void *__cookie, const char *__buf, int __n) { 282 #endif 283 return roar_vio_write((struct roar_vio_calls *) __cookie, (char *) __buf, __n); 284 } 285 286 #if defined(ROAR_HAVE_FOPENCOOKIE) 287 int roar_vio_to_stdio_lseek (void *__cookie, _IO_off64_t *__pos, int __w); 288 #elif defined(ROAR_HAVE_FUNOPEN) 289 fpos_t roar_vio_to_stdio_lseek(void *__cookie, fpos_t __pos, int __w) { 290 return roar_vio_lseek((struct roar_vio_calls *) __cookie, __pos, __w); 291 } 292 #endif 258 293 259 294 // VIOs:
Note: See TracChangeset
for help on using the changeset viewer.