Changeset 5312:27ec111dc8c5 in roaraudio for roard/clients.c


Ignore:
Timestamp:
11/30/11 01:05:41 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added support for seperate contextes for roardl/plugins. Currently incudes error state and a global per handle data segment. This does not work for statically linked librarys (yet). support for per-context notify core needs to be added/completed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/clients.c

    r5304 r5312  
    3838#ifndef ROAR_WITHOUT_DCOMP_EMUL_ESD 
    3939#ifdef ROAR_HAVE_H_ESD 
    40  {ROAR_PROTO_ESOUND, ROAR_SUBSYS_WAVEFORM, "EsounD emulation", NULL, emul_esd_check_client, NULL, NULL}, 
     40 {ROAR_PROTO_ESOUND, ROAR_SUBSYS_WAVEFORM, "EsounD emulation", NULL, NULL, emul_esd_check_client, NULL, NULL}, 
    4141#endif 
    4242#endif 
    4343#ifndef ROAR_WITHOUT_DCOMP_EMUL_RPLAY 
    44  {ROAR_PROTO_RPLAY, ROAR_SUBSYS_WAVEFORM, "RPlay emulation", NULL, emul_rplay_check_client, NULL, NULL}, 
     44 {ROAR_PROTO_RPLAY, ROAR_SUBSYS_WAVEFORM, "RPlay emulation", NULL, NULL, emul_rplay_check_client, NULL, NULL}, 
    4545#endif 
    4646#ifndef ROAR_WITHOUT_DCOMP_EMUL_GOPHER 
    47  {ROAR_PROTO_GOPHER, ROAR_SUBSYS_WAVEFORM, "The Internet Gopher Protocol", NULL, emul_gopher_check_client, NULL, emul_gopher_flushed_client}, 
    48 #endif 
    49  {-1, 0, NULL, NULL, NULL, NULL, NULL} 
     47 {ROAR_PROTO_GOPHER, ROAR_SUBSYS_WAVEFORM, "The Internet Gopher Protocol", NULL, NULL, emul_gopher_check_client, NULL, emul_gopher_flushed_client}, 
     48#endif 
     49 {-1, 0, NULL, NULL, NULL, NULL, NULL, NULL} 
    5050}; 
    5151 
     
    647647     if ( g_proto[i].proto == c->proto ) { 
    648648      roar_vio_open_fh_socket(&vio, clients_get_fh(id)); 
     649      if ( g_proto[i].lhandle != NULL ) 
     650       roar_dl_context_restore(g_proto[i].lhandle); 
    649651      rv = g_proto[i].check_client(id, &vio); 
     652      if ( g_proto[i].lhandle != NULL ) 
     653       roar_dl_context_store(g_proto[i].lhandle); 
    650654     } 
    651655    } 
     
    686690 
    687691 if ( p->flush_client != NULL ) { 
     692  if ( p->lhandle != NULL ) 
     693   roar_dl_context_restore(p->lhandle); 
    688694  return p->flush_client(id, &vio); 
     695  if ( p->lhandle != NULL ) 
     696   roar_dl_context_store(p->lhandle); 
    689697 } 
    690698 
     
    716724 if ( cs->outbuf == NULL ) { 
    717725  if ( p->flushed_client != NULL ) { 
     726   if ( p->lhandle != NULL ) 
     727    roar_dl_context_restore(p->lhandle); 
    718728   return p->flushed_client(id, &vio); 
     729   if ( p->lhandle != NULL ) 
     730    roar_dl_context_store(p->lhandle); 
    719731  } 
    720732 } 
     
    813825 
    814826// proto support 
    815 int clients_register_proto(struct roard_proto * proto) { 
     827int clients_register_proto(struct roard_proto * proto, struct roar_dl_lhandle * lhandle) { 
    816828 const size_t len = sizeof(g_proto)/sizeof(*g_proto); 
    817829 size_t i; 
     
    829841 
    830842 memcpy(&(g_proto[i]), proto, sizeof(*g_proto)); 
     843 
     844 g_proto[i].lhandle = lhandle; 
    831845 
    832846 return 0; 
Note: See TracChangeset for help on using the changeset viewer.