Changeset 3737:e79803f4911d in roaraudio for roard/clients.c


Ignore:
Timestamp:
04/26/10 13:55:19 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added clients_new_from_fh(), converted some code to use the function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/clients.c

    r3713 r3737  
    9191} 
    9292 
     93int clients_new_from_fh(int fh, int proto, int byteorder, int update_nnode) { 
     94 struct roar_client * c; 
     95 int client; 
     96 
     97 if ( fh == -1 ) 
     98  return -1; 
     99 
     100 if ( proto != ROAR_PROTO_ROARAUDIO || byteorder != ROAR_BYTEORDER_NETWORK ) 
     101  return -1; 
     102 
     103 if ( (client = clients_new()) == -1 ) 
     104  return -1; 
     105 
     106 if ( clients_set_fh(client, fh) == -1 ) { 
     107  clients_delete(client); 
     108  return -1; 
     109 } 
     110 
     111 if ( update_nnode ) { 
     112  if ( clients_get(client, &c) != -1 ) { 
     113   if ( roar_nnode_free(&(c->nnode)) != -1 ) { 
     114    roar_nnode_new_from_fh(&(c->nnode), fh, 1); 
     115   } 
     116  } 
     117 } 
     118 
     119 return 0; 
     120} 
     121 
    93122int clients_delete (int id) { 
    94123 int i; 
Note: See TracChangeset for help on using the changeset viewer.