* Makefile.in: Fixed to build in directories other than the top
authorpatthoyts <patthoyts>
Mon, 9 Feb 2004 12:02:32 +0000 (12:02 +0000)
committerpatthoyts <patthoyts>
Mon, 9 Feb 2004 12:02:32 +0000 (12:02 +0000)
of the source tree.

* generic/udp_tcl.c: Applied the patch from bug #810572 which
fixes a memory leak in udp_open - from D. Richard Hipp?

* generic/udp_tcl.h: Fix for missing define WIN32 sometimes.
* win/makefile.vc:  Added the standard windows nmake makefiles
* win/nmakehlp.c:   from the sampleextension project.
* win/rules.vc:     Visual Studio project updated as a Makefile
* win/tcludp.dsp:   project.

ChangeLog
Makefile.in
configure
configure.in
generic/udp_tcl.c
generic/udp_tcl.h
win/tcludp.dsp
win/tcludp.rc

index c20b03772ad9f79a3eed2dd168fd8fc2c74bf007..e631784f62e58680c472ea61a06d2a28ec2e4a93 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2004-02-09  Pat Thoyts  <patthoyts@users.sourceforge.net>
+
+       * all:        INCREMENTED VERSION TO 1.0.6
+
+       * Makefile.in: Fixed to build in directories other than the top
+       of the source tree.
+
+       * generic/udp_tcl.c: Applied the patch from bug #810572 which
+       fixes a memory leak in udp_open - from D. Richard Hipp?
+
+       * generic/udp_tcl.h: Fix for missing define WIN32 sometimes.
+       
+       * win/makefile.vc:  Added the standard windows nmake makefiles
+       * win/nmakehlp.c:   from the sampleextension project.
+       * win/rules.vc:     Visual Studio project updated as a Makefile
+       * win/tcludp.dsp:   project.
+
 2003-10-14  Pat Thoyts  <patthoyts@users.sourceforge.net>
 
        * generic/udp_tcl.c: Fix CONSTness for Tcl < 8.4
index 3c8108d179cbf04c77f3766f4db8c005fd8fbbec..dde947d98a18e8c1cde206ca96b7e7b6761d8f6a 100644 (file)
@@ -27,7 +27,7 @@
 # unix subdirectory.
 #========================================================================
 
-udp_SOURCES    = generic/udp_tcl.c
+udp_SOURCES    = $(srcdir)/generic/udp_tcl.c
 
 WIN_SOURCES    =
 UNIX_SOURCES   = 
index 0f43d2155a0bfb11f1cbffc3382095258f274475..db9c7e23795a6c0e031c6d5402a44fd93babc6e8 100755 (executable)
--- a/configure
+++ b/configure
@@ -573,7 +573,7 @@ PACKAGE=udp
 
 MAJOR_VERSION=1
 MINOR_VERSION=0
-PATCHLEVEL=5
+PATCHLEVEL=6
 
 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${PATCHLEVEL}
 NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION}
index 4d951c81d7b04591c14d14788b1485a9882b7c9e..4355ec6729b35c20b10844902786c8a12f1725a7 100644 (file)
@@ -39,7 +39,7 @@ PACKAGE=udp
 
 MAJOR_VERSION=1
 MINOR_VERSION=0
-PATCHLEVEL=5
+PATCHLEVEL=6
 
 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${PATCHLEVEL}
 NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION}
index 98987678e0bef33fd04bca40b71a482b3f2e53ac..373547f02faf9807d5e84fec6e8f03c056dd10a7 100644 (file)
@@ -21,7 +21,7 @@
 #ifdef WIN32
 #include <stdlib.h>
 #include <malloc.h>
-#else
+#else /* ! WIN32 */
 #if defined(HAVE_SYS_IOCTL_H)
 #include <sys/ioctl.h>
 #elif defined(HAVE_SYS_FILIO_H)
@@ -29,7 +29,7 @@
 #else
 #error "Neither sys/ioctl.h nor sys/filio.h found. We need ioctl()"
 #endif
-#endif
+#endif /* WIN32 */
 
 /* Tcl 8.4 CONST support */
 #ifndef CONST84
@@ -42,7 +42,7 @@
 #define INVALID_SOCKET -1
 #define closesocket close
 #define ioctlsocket ioctl
-#endif
+#endif /* WIN32 */
 
 #ifdef DEBUG
 #define UDPTRACE udpTrace
@@ -101,6 +101,26 @@ static UdpState *sockTail;
 
 #endif /* ! WIN32 */
 
+/*
+ * This structure describes the channel type for accessing UDP.
+ */
+static Tcl_ChannelType Udp_ChannelType = {
+#ifdef SIPC_IPV6
+    "udp6",                /* Type name.                                    */
+#else 
+    "udp",                 /* Type name.                                    */
+#endif 
+    NULL,                  /* Set blocking/nonblocking behaviour. NULL'able */
+    udpClose,              /* Close channel, clean instance data            */
+    udpInput,              /* Handle read request                           */
+    udpOutput,             /* Handle write request                          */
+    NULL,                  /* Move location of access point.      NULL'able */
+    udpSetOption,          /* Set options.                        NULL'able */
+    udpGetOption,          /* Get options.                        NULL'able */
+    udpWatch,              /* Initialize notifier                           */
+    udpGetHandle,          /* Get OS handle from the channel.               */
+};
+
 /*
  * ----------------------------------------------------------------------
  * udpInit
@@ -186,25 +206,27 @@ udpOpen(ClientData clientData, Tcl_Interp *interp,
     unsigned long status = 1;
     int len;
     
-    Tcl_ChannelType *Udp_ChannelType;
-    Udp_ChannelType = (Tcl_ChannelType *) ckalloc((unsigned) sizeof(Tcl_ChannelType));
-    memset(Udp_ChannelType, 0, sizeof(Tcl_ChannelType));
-#ifdef SIPC_IPV6
-    Udp_ChannelType->typeName = strdup("udp6");
-#else 
-    Udp_ChannelType->typeName = strdup("udp");
-#endif
-    Udp_ChannelType->blockModeProc = NULL;
-    Udp_ChannelType->closeProc = udpClose;
-    Udp_ChannelType->inputProc = udpInput;
-    Udp_ChannelType->outputProc = udpOutput;
-    Udp_ChannelType->seekProc = NULL;
-    Udp_ChannelType->setOptionProc = udpSetOption;
-    Udp_ChannelType->getOptionProc = udpGetOption;
-    Udp_ChannelType->watchProc = udpWatch;
-    Udp_ChannelType->getHandleProc = udpGetHandle;
-    Udp_ChannelType->close2Proc = NULL;
-    
+    /*
+     *    Tcl_ChannelType *Udp_ChannelType;
+     *    Udp_ChannelType = (Tcl_ChannelType *) ckalloc((unsigned) sizeof(Tcl_ChannelType));
+     *    memset(Udp_ChannelType, 0, sizeof(Tcl_ChannelType));
+     * #ifdef SIPC_IPV6
+     *    Udp_ChannelType->typeName = strdup("udp6");
+     *#else 
+     *    Udp_ChannelType->typeName = strdup("udp");
+     *#endif
+     *    Udp_ChannelType->blockModeProc = NULL;
+     *    Udp_ChannelType->closeProc = udpClose;
+     *    Udp_ChannelType->inputProc = udpInput;
+     *    Udp_ChannelType->outputProc = udpOutput;
+     *    Udp_ChannelType->seekProc = NULL;
+     *    Udp_ChannelType->setOptionProc = udpSetOption;
+     *    Udp_ChannelType->getOptionProc = udpGetOption;
+     *    Udp_ChannelType->watchProc = udpWatch;
+     *    Udp_ChannelType->getHandleProc = udpGetHandle;
+     *    Udp_ChannelType->close2Proc = NULL;
+     */
+
     if (argc >= 2) {
         if (udpGetService(interp, argv[1], &localport) != TCL_OK)
             return TCL_ERROR;
@@ -258,7 +280,7 @@ udpOpen(ClientData clientData, Tcl_Interp *interp,
     memset(statePtr, 0, sizeof(UdpState));
     statePtr->sock = sock;
     sprintf(channelName, "sock%d", statePtr->sock);
-    statePtr->channel = Tcl_CreateChannel(Udp_ChannelType, channelName,
+    statePtr->channel = Tcl_CreateChannel(&Udp_ChannelType, channelName,
                                           (ClientData) statePtr,
                                           (TCL_READABLE | TCL_WRITABLE | TCL_MODE_NONBLOCKING));
     statePtr->doread = 1;
index 508767fa283acf984dcb7394d6ff790cbe81e594..fdcf8998c7c4e295814b628a146fe6242253ede3 100644 (file)
 #  include <stdlib.h>
 #endif
 
+#if defined(_WIN32) && !defined(WIN32)
+#define WIN32
+#endif
+
 #ifdef WIN32
 #  include <winsock.h>
 #else
@@ -33,7 +37,7 @@
 #  include <netinet/in.h>
 #  include <arpa/inet.h>
 #  include <netdb.h>
-#endif
+#endif /* WIN32 */
 
 #include <stdio.h>
 #include <string.h>
@@ -64,7 +68,7 @@ typedef struct PacketList {
   struct PacketList *next;
 } PacketList;
 
-#endif // WIN32
+#endif /* WIN32 */
 
 typedef struct UdpState {
   Tcl_Channel       channel;
index 4508c7e93f5ec77641adc0a596f3193266483a58..1d7ae3be1a2335e8eff752032672f61d30eb5d89 100644 (file)
@@ -2,7 +2,7 @@
 # Microsoft Developer Studio Generated Build File, Format Version 6.00
 # ** DO NOT EDIT **
 
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+# TARGTYPE "Win32 (x86) External Target" 0x0106
 
 CFG=tcludp - Win32 Debug
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
@@ -17,17 +17,14 @@ CFG=tcludp - Win32 Debug
 !MESSAGE 
 !MESSAGE Possible choices for configuration are:
 !MESSAGE 
-!MESSAGE "tcludp - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "tcludp - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "tcludp - Win32 Release" (based on "Win32 (x86) External Target")
+!MESSAGE "tcludp - Win32 Debug" (based on "Win32 (x86) External Target")
 !MESSAGE 
 
 # Begin Project
 # PROP AllowPerConfigDependencies 0
 # PROP Scc_ProjName ""
 # PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
 
 !IF  "$(CFG)" == "tcludp - Win32 Release"
 
@@ -35,25 +32,20 @@ RSC=rc.exe
 # PROP BASE Use_Debug_Libraries 0
 # PROP BASE Output_Dir "Release"
 # PROP BASE Intermediate_Dir "Release"
+# PROP BASE Cmd_Line "NMAKE /f tcludp.mak"
+# PROP BASE Rebuild_Opt "/a"
+# PROP BASE Target_File "tcludp.exe"
+# PROP BASE Bsc_Name "tcludp.bsc"
 # PROP BASE Target_Dir ""
 # PROP Use_MFC 0
 # PROP Use_Debug_Libraries 0
 # PROP Output_Dir "Release"
 # PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
+# PROP Cmd_Line "nmake -f Makefile.vc INSTALLDIR=c:\opt\tcl"
+# PROP Rebuild_Opt "/a"
+# PROP Target_File "Release/udp106.dll"
+# PROP Bsc_Name ""
 # PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TCLUDP_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D VERSION=\"1.0.5\" /D "USE_TCL_STUBS" /D "TCLUDP_EXPORTS" /D "BUILD_udp" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x809 /d "NDEBUG"
-# ADD RSC /l 0x809 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 tclstub84.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"Release/udp105.dll"
 
 !ELSEIF  "$(CFG)" == "tcludp - Win32 Debug"
 
@@ -61,25 +53,20 @@ LINK32=link.exe
 # PROP BASE Use_Debug_Libraries 1
 # PROP BASE Output_Dir "Debug"
 # PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Cmd_Line "NMAKE /f tcludp.mak"
+# PROP BASE Rebuild_Opt "/a"
+# PROP BASE Target_File "tcludp.exe"
+# PROP BASE Bsc_Name "tcludp.bsc"
 # PROP BASE Target_Dir ""
 # PROP Use_MFC 0
 # PROP Use_Debug_Libraries 1
 # PROP Output_Dir "Debug"
 # PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
+# PROP Cmd_Line "nmake /f makefile.vc INSTALLDIR=c:\opt\tcl OPTS=symbols all"
+# PROP Rebuild_Opt "/a"
+# PROP Target_File "Debug/udp106g.dll"
+# PROP Bsc_Name ""
 # PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TCLUDP_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D VERSION=\"1.0.5\" /D "USE_TCL_STUBS" /D "TCLUDP_EXPORTS" /D "BUILD_udp" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x809 /d "_DEBUG"
-# ADD RSC /l 0x809 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 tclstub84.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Debug/udp105d.dll" /pdbtype:sept
 
 !ENDIF 
 
@@ -87,6 +74,13 @@ LINK32=link.exe
 
 # Name "tcludp - Win32 Release"
 # Name "tcludp - Win32 Debug"
+
+!IF  "$(CFG)" == "tcludp - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "tcludp - Win32 Debug"
+
+!ENDIF 
+
 # Begin Group "Source Files"
 
 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
@@ -111,9 +105,5 @@ SOURCE=..\generic\udp_tcl.h
 SOURCE=.\tcludp.rc
 # End Source File
 # End Group
-# Begin Source File
-
-SOURCE=..\tests\udp.test
-# End Source File
 # End Target
 # End Project
index 12e2caa9d9d79f088cb0b6727179d6b5f8671fd3..fb16bf5b2c0cfb2740f5afc7abdfdb0ac838aff1 100644 (file)
@@ -8,8 +8,8 @@
 LANGUAGE 0x9, 0x1      /* LANG_ENGLISH, SUBLANG_DEFAULT */
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION    1,0,5,0
- PRODUCTVERSION 1,0,5,0
+ FILEVERSION    1,0,6,0
+ PRODUCTVERSION 1,0,6,0
  FILEFLAGSMASK         0x3fL
 #ifdef DEBUG
  FILEFLAGS     VS_FF_DEBUG
@@ -25,11 +25,11 @@ BEGIN
         BLOCK "040904b0" /* LANG_ENGLISH/SUBLANG_ENGLISH_US, Unicode CP */
         BEGIN
             VALUE "FileDescription", "Tcl UDP extension\0"
-            VALUE "OriginalFilename", "udp105.dll\0"
-            VALUE "FileVersion", "1.0.5.0\0"
+            VALUE "OriginalFilename", "udp106.dll\0"
+            VALUE "FileVersion", "1.0.6.0\0"
             VALUE "LegalCopyright", "Copyright \251 1999-2000 Columbia University; all rights reserved\0"
             VALUE "ProductName", "TclUDP\0"
-            VALUE "ProductVersion", "1.0.5.0\0"
+            VALUE "ProductVersion", "1.0.6.0\0"
         END                
     END
     BLOCK "VarFileInfo"