Changeset 5260:03340eac5983 in roaraudio for libroar


Ignore:
Timestamp:
11/14/11 00:29:49 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added some const keywords ;)

Location:
libroar
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libroar/socket.c

    r5248 r5260  
    383383} 
    384384 
    385 int roar_socket_listen  (int type, char * host, int port) { 
     385int roar_socket_listen  (int type, const char * host, int port) { 
    386386 return roar_socket_open(MODE_LISTEN, type, host, port); 
    387387} 
    388388 
    389 int roar_socket_connect (char * host, int port) { 
     389int roar_socket_connect (const char * host, int port) { 
    390390 char * proxy_type = getenv("ROAR_PROXY"); 
    391391 
     
    476476} 
    477477 
    478 int roar_socket_open (int mode, int type, char * host, int port) { 
     478int roar_socket_open (int mode, int type, const char * host, int port) { 
    479479// int type = ROAR_SOCKET_TYPE_INET; 
    480480 int fh; 
     
    520520#ifdef ROAR_HAVE_LIBDNET 
    521521#define _NEED_OBJ 
     522 char * dnet_node_buf; 
    522523#endif 
    523524#ifdef _NEED_OBJ 
     
    601602   // There is nothing wrong in this case to use dnet_conn() so we do. 
    602603   ROAR_DBG("roar_socket_open(*): CALL dnet_conn('%s', '%s', SOCK_STREAM, 0 ,0 ,0 , 0)", host, obj); 
    603    fh = dnet_conn(host, obj, SOCK_STREAM, 0 ,0 ,0 , 0); 
     604   dnet_node_buf = roar_mm_strdup(host); 
     605   if ( dnet_node_buf == NULL ) { 
     606    *del = ':'; 
     607    return -1; 
     608   } 
     609   fh = dnet_conn(dnet_node_buf, obj, SOCK_STREAM, 0 ,0 ,0 , 0); 
     610   roar_mm_free(dnet_node_buf); 
    604611   ROAR_DBG("roar_socket_open(*): RET %i", fh); 
    605612   *del = ':'; 
     
    812819} 
    813820 
    814 int roar_socket_open_fork  (int mode, char * host, int port) { 
     821int roar_socket_open_fork  (int mode, const char * host, int port) { 
    815822#if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER) 
    816823 char * daemonimage; 
     
    865872} 
    866873 
    867 int roar_socket_open_file  (int mode, char * host, int port) { 
     874int roar_socket_open_file  (int mode, const char * host, int port) { 
    868875#ifdef ROAR_HAVE_IO_POSIX 
    869876 int fh; 
     
    893900 
    894901#ifdef ROAR_SUPPORT_PROXY 
    895 int roar_socket_open_proxy (int mode, int type, char * host, int port, char * proxy_type) { 
     902int roar_socket_open_proxy (int mode, int type, const char * host, int port, const char * proxy_type) { 
    896903 int    proxy_port = -1; 
    897904 char   proxy_host[ROAR_SOCKET_MAX_HOSTNAMELEN]; 
     
    904911 char   proxy_addr_buf[1024]; 
    905912 static struct passwd * passwd; 
    906  int (* code)(int mode, int fh, char * host, int port, char * user, char * pw, char * opts) = NULL; 
     913 int (* code)(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) = NULL; 
    907914 
    908915 if ( passwd == NULL ) { 
     
    10201027// protocoll dependet proxy code: 
    10211028 
    1022 int roar_socket_open_socks4 (int mode, int fh, char * host, int port, char * user, char * pw, char * opts) { 
     1029int roar_socket_open_socks4 (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 
    10231030#ifndef ROAR_TARGET_MICROCONTROLLER 
    10241031 struct hostent     * he; 
     
    10351042} 
    10361043 
    1037 int roar_socket_open_socks4a(int mode, int fh, char * host, int port, char * user, char * pw, char * opts) { 
     1044int roar_socket_open_socks4a(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 
    10381045 return roar_socket_open_socks4x(mode, fh, "\0\0\0\1", port, host, strlen(host)+1, user); 
    10391046} 
    10401047 
    1041 int roar_socket_open_socks4d(int mode, int fh, char * host, int port, char * user, char * pw, char * opts) { 
     1048int roar_socket_open_socks4d(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 
    10421049 size_t len = strlen(host)+1; 
    10431050 char * dp; 
     
    10551062} 
    10561063 
    1057 int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, char * app, size_t app_len, char * user) { 
     1064int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, const char * app, size_t app_len, const char * user) { 
    10581065 char buf[9]; 
    10591066 int len; 
     
    10931100} 
    10941101 
    1095 int roar_socket_open_http   (int mode, int fh, char * host, int port, char * user, char * pw, char * opts) { 
     1102int roar_socket_open_http   (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 
    10961103 char buf[1024]; 
    10971104 int len; 
     
    11261133 
    11271134#ifdef ROAR_HAVE_BIN_SSH 
    1128 int roar_socket_open_ssh    (int mode, int fh, char * host, int port, char * user, char * pw, char * opts) { 
     1135int roar_socket_open_ssh    (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 
    11291136 char * proxy_addr = getenv("ssh_proxy"); 
    11301137 char * sep; 
  • libroar/vio.c

    r5253 r5260  
    357357} 
    358358 
    359 int     roar_vio_open_socket   (struct roar_vio_calls * calls, char * host, int port) { 
     359int     roar_vio_open_socket   (struct roar_vio_calls * calls, const char * host, int port) { 
    360360 int fh; 
    361361 
     
    371371} 
    372372 
    373 int     roar_vio_open_socket_listen(struct roar_vio_calls * calls, int type, char * host, int port) { 
     373int     roar_vio_open_socket_listen(struct roar_vio_calls * calls, int type, const char * host, int port) { 
    374374 int fh; 
    375375 
Note: See TracChangeset for help on using the changeset viewer.