Changeset 2005:e21f45f461db in roaraudio


Ignore:
Timestamp:
06/15/09 18:24:30 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added data for the callback

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/slp.c

    r2004 r2005  
    3939                                 unsigned short   lifetime, 
    4040                                 SLPError         errcode, 
    41                                  void           * cookie); 
     41                                 void           * cookie) { 
     42 struct roar_slp_cookie * self = cookie; 
     43 
     44 if (errcode == SLP_OK || errcode == SLP_LAST_CALL) { 
     45  *(SLPError*)cookie = SLP_OK; 
     46 
     47  if ( self->matchcount == ROAR_SLP_MAX_MATCHES ) 
     48   return SLP_FALSE; 
     49 
     50  strncpy(self->match[self->matchcount++].url, srvurl, ROAR_SLP_MAX_URL_LEN); 
     51 
     52  self->match[self->matchcount].url[ROAR_SLP_MAX_URL_LEN-1] = 0; 
     53 } else { 
     54  *(SLPError*)cookie = errcode; 
     55 } 
     56 
     57 /* return SLP_TRUE because we want to be called again */ 
     58 /* if more services were found                        */ 
     59 
     60 return SLP_TRUE; 
     61} 
    4262 
    4363int roar_slp_search          (struct roar_slp_cookie * cookie, char * type) { 
Note: See TracChangeset for help on using the changeset viewer.