Changeset 2859:277d77b307d5 in roaraudio
- Timestamp:
- 10/05/09 12:14:54 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroarsndio/events.c
r1571 r2859 34 34 #include "libroarsndio.h" 35 35 36 #define _CHECK() if ( hdl == NULL ) return 0 37 36 38 int sio_nfds (struct sio_hdl * hdl) { 37 return 0; 39 int fh = -1; 40 41 _CHECK(); 42 43 if ( hdl->stream_opened != 1 ) 44 return 0; 45 46 if ( roar_vio_ctl(&(hdl->svio), ROAR_VIO_CTL_GET_FH, &fh) == -1 ) 47 return 0; 48 49 if ( fh == -1 ) 50 return 0; 51 52 return 1; 38 53 } 39 54 40 55 int sio_pollfd (struct sio_hdl * hdl, struct pollfd * pfd, int events) { 41 return 0; 56 int num; 57 int fh; 58 59 _CHECK(); 60 61 if ( (num = sio_nfds(hdl)) == 0 ) 62 return 0; 63 64 // not supportet currently: 65 if ( num > 1 ) 66 return 0; 67 68 memset(pfd, 0, num*sizeof(struct pollfd)); 69 70 // if stream is ok is tested by sio_nfds() 71 72 if ( roar_vio_ctl(&(hdl->svio), ROAR_VIO_CTL_GET_FH, &fh) == -1 ) 73 return 0; 74 75 if ( fh == -1 ) 76 return 0; 77 78 pfd->fd = fh; 79 pfd->events = events; 80 pfd->revents = 0; 81 82 return num; 42 83 } 43 84 44 85 int sio_revents(struct sio_hdl * hdl, struct pollfd * pfd) { 45 return 0; 86 short revents = 0; 87 int num; 88 int i; 89 90 _CHECK(); 91 92 if ( (num = sio_nfds(hdl)) == 0 ) 93 return 0; 94 95 for (i = 0; i < num; i++) 96 revents |= pfd[i].revents; 97 98 return revents; 46 99 } 47 100
Note: See TracChangeset
for help on using the changeset viewer.