Changeset 5739:2a1671d592b9 in roaraudio for roard/clients.c


Ignore:
Timestamp:
11/09/12 01:09:22 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

commit 0: make protocol emulations for esd, gopher and rplay more independed so they can be moved into plugins easily (See: #311)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/clients.c

    r5654 r5739  
    3333struct roar_client_server * g_clients[ROAR_CLIENTS_MAX]; 
    3434 
    35 static struct roar_dl_proto 
    36 #if !defined(ROAR_WITHOUT_DCOMP_EMUL_ESD) && defined(ROAR_HAVE_H_ESD) 
    37 __proto_common_esd = { 
    38  .proto = ROAR_PROTO_ESOUND, 
    39  .description = "EsounD emulation", 
    40  .flags = ROAR_DL_PROTO_FLAGS_NONE, 
    41  .handle = emul_esd_check_client 
    42 }, 
    43 #endif 
    44 #ifndef ROAR_WITHOUT_DCOMP_EMUL_RPLAY 
    45 __proto_common_rplay = { 
    46  .proto = ROAR_PROTO_RPLAY, 
    47  .description = "RPlay emulation", 
    48  .flags = ROAR_DL_PROTO_FLAGS_NONE, 
    49  .handle = emul_rplay_check_client 
    50 }, 
    51 #endif 
    52 #ifndef ROAR_WITHOUT_DCOMP_EMUL_GOPHER 
    53 __proto_common_gopher = { 
    54  .proto = ROAR_PROTO_GOPHER, 
    55  .description = "The Internet Gopher Protocol", 
    56  .flags = ROAR_DL_PROTO_FLAGS_NONE, 
    57  .handle = emul_gopher_check_client, 
    58  .flushed = emul_gopher_flushed_client 
    59 } 
    60 #endif 
    61 ; 
     35extern struct roar_dl_proto __proto_common_rplay; 
     36extern struct roar_dl_proto __proto_common_gopher; 
     37extern struct roar_dl_proto __proto_common_esd; 
    6238 
    6339static struct roard_proto_handle __protos[MAX_PROTOS] = { 
     
    252228    // nothing needed to be done here 
    253229   break; 
    254 #ifndef ROAR_WITHOUT_DCOMP_EMUL_ESD 
    255 #ifdef ROAR_HAVE_H_ESD 
    256   case ROAR_PROTO_ESOUND: 
    257     ROAR_DBG("net_get_new_client(*): execing ESD CONNECT command"); 
    258  
    259     if ( roar_vio_open_fh_socket(&vio, fh) == -1 ) 
    260      return -1; 
    261  
    262     ROAR_DBG("net_get_new_client(*): creating VIO OK"); 
    263  
    264     if ( emul_esd_exec_command(client, ESD_PROTO_CONNECT, &vio) == -1 ) 
    265      return -1; 
    266  
    267     ROAR_DBG("net_get_new_client(*): CONNECT execed sucessfully"); 
    268    break; 
    269 #endif 
    270 #endif 
    271230#ifndef ROAR_WITHOUT_DCOMP_EMUL_SIMPLE 
    272231  case ROAR_PROTO_SIMPLE: 
     
    277236#ifndef ROAR_WITHOUT_DCOMP_EMUL_RSOUND 
    278237  case ROAR_PROTO_RSOUND: // nothing to do here. 
    279    break; 
    280 #endif 
    281 #ifndef ROAR_WITHOUT_DCOMP_EMUL_RPLAY 
    282   case ROAR_PROTO_RPLAY: 
    283     if ( roar_vio_open_fh_socket(&vio, fh) == -1 ) 
    284      return -1; 
    285  
    286     if ( emul_rplay_on_status(client, NULL, &vio, NULL, 0) == -1 ) 
    287      return -1; 
    288238   break; 
    289239#endif 
Note: See TracChangeset for help on using the changeset viewer.