Changeset 1351:f6b4d7e85459 in roaraudio


Ignore:
Timestamp:
03/23/09 18:31:45 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added roar_vio_printf()

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/libroar.h

    r1347 r1351  
    4141 
    4242#include <stdint.h> 
     43 
     44#include <stdarg.h> 
    4345 
    4446#include <sys/wait.h> 
  • include/libroar/vio.h

    r1314 r1351  
    102102int     roar_vio_getc    (struct roar_vio_calls * vio); 
    103103 
     104int     roar_vio_printf  (struct roar_vio_calls * vio, const char *format, ...); 
     105 
    104106// converters: 
    105107int     roar_vio_open_file     (struct roar_vio_calls * calls, char * filename, int flags, mode_t mode); 
  • libroar/vio.c

    r1336 r1351  
    163163} 
    164164 
     165int     roar_vio_printf(struct roar_vio_calls * vio, const char *format, ...) { 
     166 va_list ap; 
     167 int ret; 
     168 char buf[8192]; 
     169 
     170 va_start(ap, format); 
     171 ret = vsnprintf(buf, 8192, format, ap); 
     172 va_end(ap); 
     173 
     174 return roar_vio_write(vio, buf, ret); 
     175} 
     176 
    165177// converters: 
    166178int     roar_vio_open_file     (struct roar_vio_calls * calls, char * filename, int flags, mode_t mode) { 
Note: See TracChangeset for help on using the changeset viewer.