Changeset 1293:8e2deef687c3 in roaraudio


Ignore:
Timestamp:
03/12/09 03:41:44 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added a lot calls for vio -> stdio

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/vio.h

    r1291 r1293  
    110110 
    111111FILE *  roar_vio_to_stdio      (struct roar_vio_calls * calls, int flags); 
     112#if defined(ROAR_HAVE_FOPENCOOKIE) || defined(ROAR_HAVE_FUNOPEN) 
     113int 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); 
     118int roar_vio_to_stdio_lseek (void *__cookie, _IO_off64_t *__pos, int __w); 
     119#elif defined(ROAR_HAVE_FUNOPEN) 
     120int roar_vio_to_stdio_read(void *__cookie, char *__buf, int __nbytes); 
     121int roar_vio_to_stdio_write(void *__cookie, const char *__buf, int __n); 
     122fpos_t roar_vio_to_stdio_lseek(void *__cookie, fpos_t __pos, int __w); 
     123#endif 
    112124 
    113125 
  • libroar/vio.c

    r1291 r1293  
    249249 memset(&foc_funcs, 0, sizeof(cookie_io_functions_t)); 
    250250 
     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 
    251255 return fopencookie((void*) calls, "rw", foc_funcs); 
    252256#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); 
    254259#else 
    255260 return NULL; 
    256261#endif 
    257262} 
     263 
     264#if defined(ROAR_HAVE_FOPENCOOKIE) || defined(ROAR_HAVE_FUNOPEN) 
     265int 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) 
     273int 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) 
     281int 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) 
     287int roar_vio_to_stdio_lseek (void *__cookie, _IO_off64_t *__pos, int __w); 
     288#elif defined(ROAR_HAVE_FUNOPEN) 
     289fpos_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 
    258293 
    259294// VIOs: 
Note: See TracChangeset for help on using the changeset viewer.