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.
+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
# unix subdirectory.
#========================================================================
-udp_SOURCES = generic/udp_tcl.c
+udp_SOURCES = $(srcdir)/generic/udp_tcl.c
WIN_SOURCES =
UNIX_SOURCES =
MAJOR_VERSION=1
MINOR_VERSION=0
-PATCHLEVEL=5
+PATCHLEVEL=6
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${PATCHLEVEL}
NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION}
MAJOR_VERSION=1
MINOR_VERSION=0
-PATCHLEVEL=5
+PATCHLEVEL=6
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${PATCHLEVEL}
NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION}
#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)
#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
#define INVALID_SOCKET -1
#define closesocket close
#define ioctlsocket ioctl
-#endif
+#endif /* WIN32 */
#ifdef DEBUG
#define UDPTRACE udpTrace
#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
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;
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;
# include <stdlib.h>
#endif
+#if defined(_WIN32) && !defined(WIN32)
+#define WIN32
+#endif
+
#ifdef WIN32
# include <winsock.h>
#else
# include <netinet/in.h>
# include <arpa/inet.h>
# include <netdb.h>
-#endif
+#endif /* WIN32 */
#include <stdio.h>
#include <string.h>
struct PacketList *next;
} PacketList;
-#endif // WIN32
+#endif /* WIN32 */
typedef struct UdpState {
Tcl_Channel channel;
# 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,
!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"
# 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"
# 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
# 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"
SOURCE=.\tcludp.rc
# End Source File
# End Group
-# Begin Source File
-
-SOURCE=..\tests\udp.test
-# End Source File
# End Target
# End Project
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
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"