Changeset 5231:8b30ddb689b8 in roaraudio for libroar


Ignore:
Timestamp:
11/12/11 14:31:25 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

first updates to connection object

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/basic.c

    r5228 r5231  
    286286 memset(con, 0, sizeof(struct roar_connection)); 
    287287 
    288  con->flags = ROAR_CON_FLAGS_FH; 
    289  con->__fh  = fh; 
    290  
    291  if ( roar_vio_open_fh_socket(&(con->viocon), fh) != -1 ) 
     288 if ( roar_vio_open_fh_socket(&(con->viocon), fh) != -1 ) { 
    292289  con->flags |= ROAR_CON_FLAGS_VIO; 
     290 } 
    293291 
    294292 roar_err_set(ROAR_ERROR_NONE); 
     
    297295 
    298296int roar_get_connection_fh (struct roar_connection * con) { 
     297 int fh; 
     298 
     299 ROAR_DBG("roar_get_connection_fh(con=%p) = ?", con); 
     300 
    299301 roar_debug_warn_sysio("roar_get_connection_fh", "roar_get_connection_vio2", NULL); 
    300302 
     
    302304  return -1; 
    303305 
    304  if ( !(con->flags & ROAR_CON_FLAGS_FH) ) 
    305   return -1; 
    306  
    307  return con->__fh; 
    308 } 
    309  
    310 int roar_get_connection_vio (struct roar_connection * con, struct roar_vio_calls * vio) { 
    311  roar_debug_warn_obsolete("roar_get_connection_vio", "roar_get_connection_vio2", NULL); 
    312  
    313  if ( con == NULL || vio == NULL ) 
    314   return -1; 
    315  
    316  if ( !(con->flags & ROAR_CON_FLAGS_FH) ) 
    317   return -1; 
    318  
    319  return roar_vio_open_fh_socket(vio, con->__fh); 
     306 ROAR_DBG("roar_get_connection_fh(con=%p) = ?", con); 
     307 
     308 if ( roar_vio_ctl(&(con->viocon), ROAR_VIO_CTL_GET_FH, &fh) == -1 ) 
     309  return -1; 
     310 
     311 ROAR_DBG("roar_get_connection_fh(con=%p) = %i", con, fh); 
     312 
     313 return fh; 
    320314} 
    321315 
     
    359353                                 void (*cb)(struct roar_connection * con, 
    360354                                            struct roar_message    * mes, 
     355                                            void                   * data, 
    361356                                            void                   * userdata), 
    362357                                 void * userdata) { 
     
    365360 
    366361 con->cb       = cb; 
    367  con->userdata = userdata; 
     362 con->cb_userdata = userdata; 
    368363 
    369364 return 0; 
Note: See TracChangeset for help on using the changeset viewer.