Changeset 5467:30f989510eb4 in roaraudio for libroar/basic.c


Ignore:
Timestamp:
03/31/12 04:19:09 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

make use of seq-numbers in v2 messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/basic.c

    r5465 r5467  
    460460 memset(con, 0, sizeof(struct roar_connection)); 
    461461 con->refc        = 1; 
    462  con->flags       = ROAR_CON_FLAGS_NONE; 
     462 con->flags       = ROAR_CON_FLAGS_ISCLIENT; 
    463463 con->version     = _ROAR_MESSAGE_VERSION; 
    464464 con->cb_userdata = NULL; 
     
    655655} 
    656656 
     657int16_t roar_message_genseq(struct roar_connection * con, int is_client) { 
     658 static int16_t store = 0; 
     659 int16_t ret = 0; 
     660 
     661 ret = store++; 
     662 
     663 if ( is_client == -1 ) { 
     664  if ( con != NULL ) { 
     665   is_client = con->flags & ROAR_CON_FLAGS_ISCLIENT ? 1 : 0; 
     666  } 
     667 } 
     668 
     669 if ( is_client == -1 ) 
     670  is_client = 1; 
     671 
     672 ret |= 0x8000U; 
     673 if ( !is_client ) 
     674  ret -= 0x8000U; 
     675 
     676 return ret; 
     677} 
     678 
    657679int roar_sync         (struct roar_connection * con) { 
    658680 // wait for any non-client reqs 
Note: See TracChangeset for help on using the changeset viewer.