Changeset 4078:19d24e1dc238 in roaraudio
- Timestamp:
- 07/23/10 18:01:42 (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroaross/libroaross.c
r4077 r4078 364 364 int p[2]; 365 365 366 ROAR_DBG("_open_dummy(void) = ?"); 367 366 368 if ( pipe(p) == -1 ) 367 369 return -1; … … 369 371 close(p[1]); 370 372 373 ROAR_DBG("_open_dummy(void) = %i", p[0]); 371 374 return p[0]; 372 375 } … … 490 493 } 491 494 492 static struct pointer * _get_pointer_by_fh (int fh) {495 static struct pointer * _get_pointer_by_fh_or_new (int fh) { 493 496 int i; 494 495 if ( fh == -1 )496 return NULL;497 497 498 498 for (i = 0; i < _MAX_POINTER; i++) { … … 504 504 } 505 505 506 static struct pointer * _get_pointer_by_fh (int fh) { 507 int i; 508 509 if ( fh == -1 ) 510 return NULL; 511 512 return _get_pointer_by_fh_or_new(fh); 513 } 514 506 515 static struct pointer * _open_pointer(struct handle * handle) { 507 struct pointer * ret = _get_pointer_by_fh(-1); 508 509 if ( ret == NULL ) 516 struct pointer * ret = _get_pointer_by_fh_or_new(-1); 517 518 ROAR_DBG("_open_pointer(handle=%p) = ?", handle); 519 520 if ( ret == NULL ) { 521 ROAR_DBG("_open_pointer(handle=%p) = NULL", handle); 510 522 return NULL; 511 512 if ( (ret->fh = _open_dummy()) == -1 ) 523 } 524 525 if ( (ret->fh = _open_dummy()) == -1 ) { 526 ROAR_DBG("_open_pointer(handle=%p) = NULL", handle); 513 527 return NULL; 528 } 514 529 515 530 ret->handle = handle; 516 531 532 ROAR_DBG("_open_pointer(handle=%p) = %p", handle, ret); 533 517 534 return ret; 518 535 } 519 536 520 537 static struct pointer * _attach_pointer(struct handle * handle, int fh) { 521 struct pointer * ret = _get_pointer_by_fh (-1);538 struct pointer * ret = _get_pointer_by_fh_or_new(-1); 522 539 523 540 if ( ret == NULL ) … … 724 741 break; 725 742 } 743 744 ROAR_DBG("_open_file(pathname='%s', flags=0x%x) = ?", pathname, flags); 726 745 727 746 if ( (pointer = _open_pointer(handle)) == NULL ) {
Note: See TracChangeset
for help on using the changeset viewer.