Changeset 3769:14c294155cad in roaraudio
- Timestamp:
- 05/05/10 10:55:36 (14 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/vio.h
r3517 r3769 74 74 int roar_vio_close (struct roar_vio_calls * vio); 75 75 76 // specal commands: 77 int roar_vio_accept (struct roar_vio_calls * calls, struct roar_vio_calls * dst); 78 76 79 // converters: 77 80 int roar_vio_open_file (struct roar_vio_calls * calls, char * filename, int flags, mode_t mode); -
include/libroar/vio_ctl.h
r3517 r3769 76 76 #define ROAR_VIO_CTL_SET_NOSYNC (ROAR_VIO_CTL_GENERIC|0x0150) /* delete call of vio sync() from object */ 77 77 #define ROAR_VIO_CTL_GET_NAME (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_GET|0x0160) /* get name of VIO */ 78 #define ROAR_VIO_CTL_ACCEPT (ROAR_VIO_CTL_GENERIC|0x0170) /* accept(), vio* */ 78 79 79 80 // get or set data format used for read and write calls, see below -
libroar/vio.c
r3517 r3769 174 174 } 175 175 176 // specal commands: 177 int roar_vio_accept (struct roar_vio_calls * calls, struct roar_vio_calls * dst) { 178 if (dst == NULL || calls == NULL) 179 return -1; 180 181 return roar_vio_ctl(dst, ROAR_VIO_CTL_ACCEPT, calls); 182 } 183 176 184 // converters: 177 185 int roar_vio_open_file (struct roar_vio_calls * calls, char * filename, int flags, mode_t mode) { … … 331 339 332 340 int roar_vio_basic_ctl (struct roar_vio_calls * vio, int cmd, void * data) { 341 int fh; 333 342 334 343 if ( vio == NULL || cmd == -1 ) … … 352 361 return 0; 353 362 break; 363 case ROAR_VIO_CTL_ACCEPT: 364 fh = accept(roar_vio_get_fh(vio), NULL, 0); 365 if ( fh == -1 ) 366 return -1; 367 368 // most proably a socket. 369 if ( roar_vio_open_fh_socket(data, fh) == -1 ) { 370 #ifdef ROAR_TARGET_WIN32 371 closesocket(fh); 372 #else 373 close(fh); 374 #endif 375 return -1; 376 } 377 378 return 0; 379 break; 354 380 } 355 381
Note: See TracChangeset
for help on using the changeset viewer.