Changeset 1563:824d1c4a4765 in roaraudio
- Timestamp:
- 04/13/09 01:02:59 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroarsndio/stream.c
r1559 r1563 1 // libroarsndio.c:1 //stream.c: 2 2 3 3 /* … … 33 33 #include "libroarsndio.h" 34 34 35 int sio_start (struct sio_hdl * hdl) { 36 return 0; 37 } 38 39 int sio_stop (struct sio_hdl * hdl) { 40 41 if ( hdl == NULL ) 42 return 0; 43 44 if ( hdl->fh == -1 ) 45 return 0; 46 47 close(hdl->fh); 48 49 hdl->fh = -1; 50 51 return 1; 52 } 53 54 size_t sio_read (struct sio_hdl * hdl, void * addr, size_t nbytes) { 55 ssize_t ret; 56 57 if ( hdl == NULL ) 58 return 0; 59 60 if ( hdl->fh == -1 ) 61 return 0; 62 63 if ( (ret = read(hdl->fh, addr, nbytes)) < 0 ) 64 return 0; 65 66 return ret; 67 } 68 size_t sio_write (struct sio_hdl * hdl, void * addr, size_t nbytes) { 69 ssize_t ret; 70 71 if ( hdl == NULL ) 72 return 0; 73 74 if ( hdl->fh == -1 ) 75 return 0; 76 77 if ( (ret = write(hdl->fh, addr, nbytes)) < 0 ) 78 return 0; 79 80 return ret; 81 } 82 35 83 //ll
Note: See TracChangeset
for help on using the changeset viewer.