/[svn]/liblscp/trunk/src/socket.c
ViewVC logotype

Diff of /liblscp/trunk/src/socket.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 868 by capela, Tue Jul 6 15:52:25 2004 UTC revision 869 by capela, Thu Jun 1 08:32:16 2006 UTC
# Line 2  Line 2 
2  //  //
3  /****************************************************************************  /****************************************************************************
4     liblscp - LinuxSampler Control Protocol API     liblscp - LinuxSampler Control Protocol API
5     Copyright (C) 2004, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2006, rncbc aka Rui Nuno Capela. All rights reserved.
6    
7     This library is free software; you can redistribute it and/or     This library is free software; you can redistribute it and/or
8     modify it under the terms of the GNU Lesser General Public     modify it under the terms of the GNU Lesser General Public
# Line 127  void lscp_socket_herror ( const char *ps Line 127  void lscp_socket_herror ( const char *ps
127  static void _lscp_socket_getopt_bool ( lscp_socket_t sock, const char *pszOptName, int iOptName )  static void _lscp_socket_getopt_bool ( lscp_socket_t sock, const char *pszOptName, int iOptName )
128  {  {
129      int iSockOpt;      int iSockOpt;
130      int iSockLen = sizeof(int);      socklen_t cSockLen = sizeof(int);
131      char szPrefix[33];      char szPrefix[33];
132    
133      sprintf(szPrefix, "  %s\t", pszOptName);      sprintf(szPrefix, "  %s\t", pszOptName);
134      if (getsockopt(sock, SOL_SOCKET, iOptName, (char *) &iSockOpt, &iSockLen) == SOCKET_ERROR)      if (getsockopt(sock, SOL_SOCKET, iOptName, (char *) &iSockOpt, &cSockLen) == SOCKET_ERROR)
135          lscp_socket_perror(szPrefix);          lscp_socket_perror(szPrefix);
136      else      else
137          fprintf(stderr, "%s: %s\n", szPrefix, (iSockOpt ? "ON" : "OFF"));          fprintf(stderr, "%s: %s\n", szPrefix, (iSockOpt ? "ON" : "OFF"));
# Line 140  static void _lscp_socket_getopt_bool ( l Line 140  static void _lscp_socket_getopt_bool ( l
140  static void _lscp_socket_getopt_int  ( lscp_socket_t sock, const char *pszOptName, int iOptName )  static void _lscp_socket_getopt_int  ( lscp_socket_t sock, const char *pszOptName, int iOptName )
141  {  {
142      int iSockOpt;      int iSockOpt;
143      int iSockLen = sizeof(int);      socklen_t cSockLen = sizeof(int);
144      char szPrefix[33];      char szPrefix[33];
145    
146      sprintf(szPrefix, "  %s\t", pszOptName);      sprintf(szPrefix, "  %s\t", pszOptName);
147      if (getsockopt(sock, SOL_SOCKET, iOptName, (char *) &iSockOpt, &iSockLen) == SOCKET_ERROR)      if (getsockopt(sock, SOL_SOCKET, iOptName, (char *) &iSockOpt, &cSockLen) == SOCKET_ERROR)
148          lscp_socket_perror(szPrefix);          lscp_socket_perror(szPrefix);
149      else      else
150          fprintf(stderr, "%s: %d\n", szPrefix, iSockOpt);          fprintf(stderr, "%s: %d\n", szPrefix, iSockOpt);

Legend:
Removed from v.868  
changed lines
  Added in v.869

  ViewVC Help
Powered by ViewVC