Changeset 5375:2b4d1e027b2d in roaraudio for libroar/socket.c


Ignore:
Timestamp:
12/22/11 21:16:34 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

made some _LIBROAR_ATTR_TO_STATIC functions static

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/socket.c

    r5373 r5375  
    4040#define MODE_CONNECT ROAR_SOCKET_MODE_CONNECT 
    4141 
     42static int roar_socket_open_file  (int mode, const char * host, int port); 
     43static int roar_socket_open_proxy (int mode, int type, const char * host, int port, const char * proxy_type); 
     44 
     45static int roar_socket_open_socks4 (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts); 
     46static int roar_socket_open_socks4a(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts); 
     47static int roar_socket_open_socks4d(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts); 
     48static int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, const char * app, size_t app_len, const char * user); 
     49 
     50static int roar_socket_open_http   (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts); 
     51 
     52static int roar_socket_open_ssh    (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts); 
     53 
     54 
    4255#ifdef ROAR_TARGET_WIN32 
    4356void roar_socket_win32_init (void) { 
     
    5467#endif 
    5568 
    56 int roar_socket_decnet_set_timeout (int fh, time_t sec, int usec) { 
     69int roar_socket_decnet_set_timeout (int fh, time_t sec, int_least32_t usec) { 
    5770#ifdef ROAR_HAVE_LIBDNET 
    5871 struct timeval timeout = {sec, usec}; 
     
    6477} 
    6578 
    66 int roar_socket_recvbuf(int fh, int len) { 
    67 #ifdef ROAR_HAVE_BSDSOCKETS 
    68  if ( len < 256 ) len = 256; 
    69  
    70  return setsockopt(fh, SOL_SOCKET, SO_RCVBUF, (void *)&len, sizeof(len)); 
    71 #else 
    72  return -1; 
    73 #endif 
    74 } 
    75  
    76 int roar_socket_set_tos(int fh) { 
     79static int roar_socket_set_tos(int fh) { 
    7780#if defined(ROAR_HAVE_BSDSOCKETS) && !defined(ROAR_TARGET_WIN32) 
    7881 int opt = IPTOS_LOWDELAY; 
     
    8689 return ret; 
    8790#else 
     91 roar_err_set(ROAR_ERROR_NOSYS); 
    8892 return -1; 
    8993#endif 
     
    387391} 
    388392 
    389 int roar_socket_connect (const char * host, int port) { 
     393int roar_socket_connect (int type, const char * host, int port) { 
    390394 char * proxy_type = getenv("ROAR_PROXY"); 
    391395 
     
    393397 
    394398 if ( proxy_type == NULL || strcmp(proxy_type, "") == 0 ) { 
    395   return roar_socket_open(MODE_CONNECT, ROAR_SOCKET_TYPE_UNKNOWN, host, port); 
     399  return roar_socket_open(MODE_CONNECT, type, host, port); 
    396400 } else { 
    397401#ifdef ROAR_SUPPORT_PROXY 
    398   return roar_socket_open_proxy(MODE_CONNECT, ROAR_SOCKET_TYPE_UNKNOWN, host, port, proxy_type); 
     402  return roar_socket_open_proxy(MODE_CONNECT, type, host, port, proxy_type); 
    399403#else 
    400404  ROAR_ERR("roar_socket_connect(host='%s', port=%i): no support for proxy code (proxy_type=%s)", host, port, proxy_type); 
     
    820824} 
    821825 
    822 int roar_socket_open_file  (int mode, const char * host, int port) { 
     826static int roar_socket_open_file  (int mode, const char * host, int port) { 
    823827#ifdef ROAR_HAVE_IO_POSIX 
    824828 int fh; 
     
    848852 
    849853#ifdef ROAR_SUPPORT_PROXY 
    850 int roar_socket_open_proxy (int mode, int type, const char * host, int port, const char * proxy_type) { 
     854static int roar_socket_open_proxy (int mode, int type, const char * host, int port, const char * proxy_type) { 
    851855 int    proxy_port = -1; 
    852856 char   proxy_host[ROAR_SOCKET_MAX_HOSTNAMELEN]; 
     
    975979// protocoll dependet proxy code: 
    976980 
    977 int roar_socket_open_socks4 (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 
     981static int roar_socket_open_socks4 (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 
    978982#ifndef ROAR_TARGET_MICROCONTROLLER 
    979983 struct hostent     * he; 
     
    990994} 
    991995 
    992 int roar_socket_open_socks4a(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 
     996static int roar_socket_open_socks4a(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 
    993997 return roar_socket_open_socks4x(mode, fh, "\0\0\0\1", port, host, strlen(host)+1, user); 
    994998} 
    995999 
    996 int roar_socket_open_socks4d(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 
     1000static int roar_socket_open_socks4d(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 
    9971001 size_t len = strlen(host)+1; 
    9981002 char * dp; 
     
    10101014} 
    10111015 
    1012 int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, const char * app, size_t app_len, const char * user) { 
     1016static int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, const char * app, size_t app_len, const char * user) { 
    10131017 char buf[9]; 
    10141018 int len; 
     
    10481052} 
    10491053 
    1050 int roar_socket_open_http   (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 
     1054static int roar_socket_open_http   (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 
    10511055 char buf[1024]; 
    10521056 int len; 
     
    10811085 
    10821086#ifdef ROAR_HAVE_BIN_SSH 
    1083 int roar_socket_open_ssh    (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 
     1087static int roar_socket_open_ssh    (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) { 
    10841088 char * proxy_addr = getenv("ssh_proxy"); 
    10851089 char * sep; 
Note: See TracChangeset for help on using the changeset viewer.