Changeset 5253:a9d4cba9e8dc in roaraudio for libroar/vio_socket.c


Ignore:
Timestamp:
11/13/11 17:01:45 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

improved situation on opening files with DSTR/old roar_vio_open_file()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/vio_socket.c

    r5248 r5253  
    493493 
    494494// AF_UNIX: 
    495 int     roar_vio_socket_init_unix_def     (struct roar_vio_defaults * def, char * path) { 
     495int     roar_vio_socket_init_unix_def     (struct roar_vio_defaults * def, const char * path) { 
    496496#if defined(ROAR_HAVE_UNIX) && defined(_CAN_OPERATE) 
    497497 if ( def == NULL || path == NULL ) 
     
    519519  return -1; 
    520520 
    521  if ( (node = def->d.socket.host) == NULL ) 
     521 if ( def->d.socket.host == NULL ) 
     522  return -1; 
     523 
     524 if ( (node = roar_mm_strdup(def->d.socket.host)) == NULL ) 
    522525  return -1; 
    523526 
     
    525528  *ed = 0; 
    526529 
    527  if ( (ne = getnodebyname(node)) == NULL ) { 
     530 ne = getnodebyname(node); 
     531 
     532 roar_mm_free(ed); 
     533 
     534 if ( ne == NULL ) { 
    528535  ROAR_ERR("roar_vio_socket_init_decnetnode_def(*): Can\'t resolve node name '%s'", node); 
    529   if ( ed != NULL ) *ed = '/'; 
    530536  return -1; 
    531537 } 
     
    533539 memcpy(&(def->d.socket.sa.dn.sdn_add.a_addr), ne->n_addr, 2); 
    534540 
    535  if ( ed != NULL ) *ed = '/'; 
    536  
    537  
    538  return 0; 
    539 #else 
    540  return -1; 
    541 #endif 
    542 } 
    543  
    544 int     roar_vio_socket_init_decnet_def   (struct roar_vio_defaults * def, char * node, int object, char * objname) { 
     541 return 0; 
     542#else 
     543 return -1; 
     544#endif 
     545} 
     546 
     547int     roar_vio_socket_init_decnet_def   (struct roar_vio_defaults * def, const char * node, int object, char * objname) { 
    545548#if defined(ROAR_HAVE_LIBDNET) && defined(_CAN_OPERATE) 
    546549 struct sockaddr_dn * dn; 
     
    626629} 
    627630 
    628 int     roar_vio_socket_init_inet4_def    (struct roar_vio_defaults * def, char * host, int port, int type) { 
     631int     roar_vio_socket_init_inet4_def    (struct roar_vio_defaults * def, const char * host, int port, int type) { 
    629632#if defined(ROAR_HAVE_IPV4) && defined(_CAN_OPERATE) 
    630633 if ( roar_vio_socket_init_socket_def(def, AF_INET, type) == -1 ) 
     
    641644} 
    642645 
    643 int     roar_vio_socket_init_tcp4_def     (struct roar_vio_defaults * def, char * host, int port) { 
     646int     roar_vio_socket_init_tcp4_def     (struct roar_vio_defaults * def, const char * host, int port) { 
    644647 return roar_vio_socket_init_inet4_def(def, host, port, SOCK_STREAM); 
    645648} 
    646649 
    647 int     roar_vio_socket_init_udp4_def     (struct roar_vio_defaults * def, char * host, int port) { 
     650int     roar_vio_socket_init_udp4_def     (struct roar_vio_defaults * def, const char * host, int port) { 
    648651 return roar_vio_socket_init_inet4_def(def, host, port, SOCK_DGRAM); 
    649652} 
     
    652655// AF_INET6: 
    653656int     roar_vio_socket_init_inet6host_def(struct roar_vio_defaults * def); 
    654 int     roar_vio_socket_init_inet6_def    (struct roar_vio_defaults * def, char * host, int port, int type) { 
    655  return -1; 
    656 } 
    657  
    658 int     roar_vio_socket_init_tcp6_def     (struct roar_vio_defaults * def, char * host, int port) { 
     657int     roar_vio_socket_init_inet6_def    (struct roar_vio_defaults * def, const char * host, int port, int type) { 
     658 return -1; 
     659} 
     660 
     661int     roar_vio_socket_init_tcp6_def     (struct roar_vio_defaults * def, const char * host, int port) { 
    659662 return roar_vio_socket_init_inet6_def(def, host, port, SOCK_STREAM); 
    660663} 
    661664 
    662 int     roar_vio_socket_init_udp6_def     (struct roar_vio_defaults * def, char * host, int port) { 
     665int     roar_vio_socket_init_udp6_def     (struct roar_vio_defaults * def, const char * host, int port) { 
    663666 return roar_vio_socket_init_inet6_def(def, host, port, SOCK_DGRAM); 
    664667} 
Note: See TracChangeset for help on using the changeset viewer.