[PD-cvs] externals/iem/comport/comport comport.c,1.9,1.10

Hans-Christoph Steiner eighthave at users.sourceforge.net
Sat Apr 29 01:55:39 CEST 2006


Update of /cvsroot/pure-data/externals/iem/comport/comport
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24235

Modified Files:
	comport.c 
Log Message:
turned off asynchronous mode since this object is implemented to use synchronous mode; added up to COM40 (I wonder what the limit is?)

Index: comport.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/comport/comport/comport.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** comport.c	27 Jan 2006 09:34:51 -0000	1.9
--- comport.c	28 Apr 2006 23:55:37 -0000	1.10
***************
*** 10,16 ****
  #include "m_pd.h"
  
! #ifdef NT
  #pragma warning( disable : 4244 )
  #pragma warning( disable : 4305 )
  #include <windows.h>
  #include <commctrl.h>
--- 10,19 ----
  #include "m_pd.h"
  
! #ifdef _MSC_VER
  #pragma warning( disable : 4244 )
  #pragma warning( disable : 4305 )
+ #endif
+ 
+ #ifdef _WIN32
  #include <windows.h>
  #include <commctrl.h>
***************
*** 22,26 ****
  #define HANDLE int
  #define INVALID_HANDLE_VALUE -1
! #endif
  
  #include <string.h>
--- 25,29 ----
  #define HANDLE int
  #define INVALID_HANDLE_VALUE -1
! #endif /* _WIN32 */
  
  #include <string.h>
***************
*** 36,40 ****
    HANDLE comhandle;              /* holds the comport handle */
  
! #ifdef NT
    DCB dcb;                      /* holds the comm pars */
    DCB dcb_old;                  /* holds the comm pars */
--- 39,43 ----
    HANDLE comhandle;              /* holds the comport handle */
  
! #ifdef _WIN32
    DCB dcb;                      /* holds the comm pars */
    DCB dcb_old;                  /* holds the comm pars */
***************
*** 74,84 ****
  #define TXBUFOVERRUN    -5
  
! #ifdef NT
  
! #define COMPORT_MAX 8
  static char *sys_com_port[COMPORT_MAX] = 
  {
    "COM1", "COM2", "COM3", "COM4",
!   "COM5", "COM6", "COM7", "COM8"
  };
  
--- 77,95 ----
  #define TXBUFOVERRUN    -5
  
! #ifdef _WIN32
  
! #define COMPORT_MAX 40
  static char *sys_com_port[COMPORT_MAX] = 
  {
    "COM1", "COM2", "COM3", "COM4",
!   "COM5", "COM6", "COM7", "COM8",
!   "COM9", "COM10", "COM11", "COM12",
!   "COM13", "COM14", "COM15", "COM16",
!   "COM17", "COM18", "COM19", "COM20",
!   "COM21", "COM22", "COM23", "COM24",
!   "COM25", "COM26", "COM27", "COM28",
!   "COM29", "COM30", "COM31", "COM32",
!   "COM33", "COM34", "COM35", "COM36",
!   "COM37", "COM38", "COM39", "COM40"
  };
  
***************
*** 103,107 ****
  }; 
  
! #else /* NT */
  
  #ifdef  IRIX  
--- 114,118 ----
  }; 
  
! #else /* _WIN32 */
  
  #ifdef  IRIX  
***************
*** 162,166 ****
  struct timeval null_tv;
  
! #endif /* else NT */
  
  
--- 173,177 ----
  struct timeval null_tv;
  
! #endif /* else _WIN32 */
  
  
***************
*** 214,218 ****
  /* --------------------- NT ------------------------------------ */
  
! #ifdef NT
  
  
--- 225,229 ----
  /* --------------------- NT ------------------------------------ */
  
! #ifdef _WIN32
  
  
***************
*** 328,336 ****
  		   0, 
  		   OPEN_EXISTING,
- #ifdef WIN2000
  		   0,
- #else
- 		   FILE_FLAG_OVERLAPPED,
- #endif
  		   0);
  
--- 339,343 ----
***************
*** 680,684 ****
    
    /* while there are bytes, read them and send them out, ignore errors */
! #ifdef NT
    {
      DWORD dwCommEvent;
--- 687,691 ----
    
    /* while there are bytes, read them and send them out, ignore errors */
! #ifdef _WIN32
    {
      DWORD dwCommEvent;
***************
*** 776,780 ****
      x->comhandle = fd;           /* holds the comport handle */
  
! #ifdef NT
    memcpy(&(test.dcb_old),&(x->dcb_old),sizeof(DCB));    /*  save the old com config  */
    memcpy(&(test.dcb),&(x->dcb),sizeof(DCB));       /*  for the new com config  */
--- 783,787 ----
      x->comhandle = fd;           /* holds the comport handle */
  
! #ifdef _WIN32
    memcpy(&(test.dcb_old),&(x->dcb_old),sizeof(DCB));    /*  save the old com config  */
    memcpy(&(test.dcb),&(x->dcb),sizeof(DCB));       /*  for the new com config  */
***************
*** 978,985 ****
    class_addmethod(comport_class, (t_method)comport_pollintervall, gensym("pollintervall"), 
  		  A_FLOAT, 0);
! #ifndef NT
    null_tv.tv_sec = 0; /* no wait */
    null_tv.tv_usec = 0;
! #endif
    post("comport - PD external for unix/windows\n"
         "LGPL 1998-2005,  Winfried Ritsch and others (see LICENCE.txt)\n"
--- 985,992 ----
    class_addmethod(comport_class, (t_method)comport_pollintervall, gensym("pollintervall"), 
  		  A_FLOAT, 0);
! #ifndef _WIN32
    null_tv.tv_sec = 0; /* no wait */
    null_tv.tv_usec = 0;
! #endif /* NOT _WIN32 */
    post("comport - PD external for unix/windows\n"
         "LGPL 1998-2005,  Winfried Ritsch and others (see LICENCE.txt)\n"





More information about the Pd-cvs mailing list