Changeset 5365:fa05e52423d9 in roaraudio for libroar


Ignore:
Timestamp:
12/19/11 19:00:15 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added roar_connect_none() and roar_connect_vio()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/basic.c

    r5360 r5365  
    293293} 
    294294 
    295 int roar_connect_fh (struct roar_connection * con, int fh) { 
    296  
    297  if ( con == NULL || fh == -1 ) { 
     295int roar_connect_none (struct roar_connection * con) { 
     296 if ( con == NULL ) { 
    298297  roar_err_set(ROAR_ERROR_INVAL); 
    299298  return -1; 
    300299 } 
    301  
    302  // specal hack to set an ilegal value used internaly in libroar: 
    303  if ( fh == -2 ) 
    304   fh = -1; 
    305300 
    306301 memset(con, 0, sizeof(struct roar_connection)); 
     
    317312 con->viocon = &(con->viocon_store); 
    318313 
     314// con->flags |= ROAR_CON_FLAGS_VIO; 
     315 
     316 roar_err_set(ROAR_ERROR_NONE); 
     317 return 0; 
     318} 
     319 
     320int roar_connect_vio (struct roar_connection * con, struct roar_vio_calls * vio) { 
     321 if ( con == NULL || vio == NULL ) { 
     322  roar_err_set(ROAR_ERROR_INVAL); 
     323  return -1; 
     324 } 
     325 
     326 if ( roar_connect_none(con) == -1 ) 
     327  return -1; 
     328 
     329 con->viocon = vio; 
     330 con->flags |= ROAR_CON_FLAGS_VIO; 
     331 
     332 return -1; 
     333} 
     334 
     335int roar_connect_fh (struct roar_connection * con, int fh) { 
     336 
     337 if ( con == NULL || fh == -1 ) { 
     338  roar_err_set(ROAR_ERROR_INVAL); 
     339  return -1; 
     340 } 
     341 
     342 if ( roar_connect_none(con) == -1 ) 
     343  return -1; 
     344 
     345 // specal hack to set an ilegal value used internaly in libroar: 
     346 if ( fh == -2 ) 
     347  fh = -1; 
     348 
    319349 if ( roar_vio_open_fh_socket(con->viocon, fh) != -1 ) { 
    320350  con->flags |= ROAR_CON_FLAGS_VIO; 
Note: See TracChangeset for help on using the changeset viewer.