Changeset 5253:a9d4cba9e8dc in roaraudio for libroar/vio_socket.c
- Timestamp:
- 11/13/11 17:01:45 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/vio_socket.c
r5248 r5253 493 493 494 494 // AF_UNIX: 495 int roar_vio_socket_init_unix_def (struct roar_vio_defaults * def, c har * path) {495 int roar_vio_socket_init_unix_def (struct roar_vio_defaults * def, const char * path) { 496 496 #if defined(ROAR_HAVE_UNIX) && defined(_CAN_OPERATE) 497 497 if ( def == NULL || path == NULL ) … … 519 519 return -1; 520 520 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 ) 522 525 return -1; 523 526 … … 525 528 *ed = 0; 526 529 527 if ( (ne = getnodebyname(node)) == NULL ) { 530 ne = getnodebyname(node); 531 532 roar_mm_free(ed); 533 534 if ( ne == NULL ) { 528 535 ROAR_ERR("roar_vio_socket_init_decnetnode_def(*): Can\'t resolve node name '%s'", node); 529 if ( ed != NULL ) *ed = '/';530 536 return -1; 531 537 } … … 533 539 memcpy(&(def->d.socket.sa.dn.sdn_add.a_addr), ne->n_addr, 2); 534 540 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 547 int roar_vio_socket_init_decnet_def (struct roar_vio_defaults * def, const char * node, int object, char * objname) { 545 548 #if defined(ROAR_HAVE_LIBDNET) && defined(_CAN_OPERATE) 546 549 struct sockaddr_dn * dn; … … 626 629 } 627 630 628 int roar_vio_socket_init_inet4_def (struct roar_vio_defaults * def, c har * host, int port, int type) {631 int roar_vio_socket_init_inet4_def (struct roar_vio_defaults * def, const char * host, int port, int type) { 629 632 #if defined(ROAR_HAVE_IPV4) && defined(_CAN_OPERATE) 630 633 if ( roar_vio_socket_init_socket_def(def, AF_INET, type) == -1 ) … … 641 644 } 642 645 643 int roar_vio_socket_init_tcp4_def (struct roar_vio_defaults * def, c har * host, int port) {646 int roar_vio_socket_init_tcp4_def (struct roar_vio_defaults * def, const char * host, int port) { 644 647 return roar_vio_socket_init_inet4_def(def, host, port, SOCK_STREAM); 645 648 } 646 649 647 int roar_vio_socket_init_udp4_def (struct roar_vio_defaults * def, c har * host, int port) {650 int roar_vio_socket_init_udp4_def (struct roar_vio_defaults * def, const char * host, int port) { 648 651 return roar_vio_socket_init_inet4_def(def, host, port, SOCK_DGRAM); 649 652 } … … 652 655 // AF_INET6: 653 656 int roar_vio_socket_init_inet6host_def(struct roar_vio_defaults * def); 654 int roar_vio_socket_init_inet6_def (struct roar_vio_defaults * def, c har * host, int port, int type) {655 return -1; 656 } 657 658 int roar_vio_socket_init_tcp6_def (struct roar_vio_defaults * def, c har * host, int port) {657 int roar_vio_socket_init_inet6_def (struct roar_vio_defaults * def, const char * host, int port, int type) { 658 return -1; 659 } 660 661 int roar_vio_socket_init_tcp6_def (struct roar_vio_defaults * def, const char * host, int port) { 659 662 return roar_vio_socket_init_inet6_def(def, host, port, SOCK_STREAM); 660 663 } 661 664 662 int roar_vio_socket_init_udp6_def (struct roar_vio_defaults * def, c har * host, int port) {665 int roar_vio_socket_init_udp6_def (struct roar_vio_defaults * def, const char * host, int port) { 663 666 return roar_vio_socket_init_inet6_def(def, host, port, SOCK_DGRAM); 664 667 }
Note: See TracChangeset
for help on using the changeset viewer.