summaryrefslogtreecommitdiffstats
path: root/generic/tclStubInit.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclStubInit.c')
-rw-r--r--generic/tclStubInit.c58
1 files changed, 50 insertions, 8 deletions
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index a300afc..3a7a6d4 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -39,6 +39,7 @@
#undef Tcl_CreateHashEntry
#undef Tcl_Panic
#undef Tcl_FindExecutable
+#undef TclpGetPid
#undef TclSockMinimumBuffers
/* See bug 510001: TclSockMinimumBuffers needs plat imp */
@@ -65,11 +66,15 @@ int __stdcall GetModuleHandleExW(unsigned int, const char *, void *);
#define TclWinGetTclInstance winGetTclInstance
#define TclWinNToHS winNToHS
#define TclWinSetSockOpt winSetSockOpt
+#define TclWinGetSockOpt winGetSockOpt
+#define TclWinGetServByName winGetServByName
#define TclWinNoBackslash winNoBackslash
#define TclWinSetInterfaces (void (*) (int)) doNothing
#define TclWinAddProcess (void (*) (void *, unsigned int)) doNothing
+#define TclIntPlatReserved13 (void (*) ()) TclpCreateCommandChannel
#define TclWinFlushDirtyChannels doNothing
#define TclWinResetInterfaces doNothing
+#define TclpGetPid getPid
static Tcl_Encoding winTCharEncoding;
@@ -102,6 +107,19 @@ TclWinSetSockOpt(void *s, int level, int optname,
return setsockopt((int) s, level, optname, optval, optlen);
}
+static int
+TclWinGetSockOpt(void *s, int level, int optname,
+ char *optval, int *optlen)
+{
+ return getsockopt((int) s, level, optname, optval, optlen);
+}
+
+struct servent *
+TclWinGetServByName(const char *name, const char *proto)
+{
+ return getservbyname(name, proto);
+}
+
static char *
TclWinNoBackslash(char *path)
{
@@ -115,6 +133,12 @@ TclWinNoBackslash(char *path)
return path;
}
+static int
+TclpGetPid(Tcl_Pid pid)
+{
+ return (int) (size_t) pid;
+}
+
static void
doNothing(void)
{
@@ -167,11 +191,15 @@ Tcl_WinTCharToUtf(
# define TclWinGetTclInstance (void *(*)()) TclpCreateProcess
# define TclWinNToHS (unsigned short (*) _ANSI_ARGS_((unsigned short ns))) TclpMakeFile
# define TclWinSetSockOpt (int (*) _ANSI_ARGS_((void *, int, int, const char *, int))) TclpOpenFile
+# define TclWinGetSockOpt (int (*) _ANSI_ARGS_((void *, int, int, char *, int))) TclpCreatePipe
+# define TclWinGetServByName (struct servent *(*) _ANSI_ARGS_((const char *nm, const char *proto))) TclpCreateCommandChannel
+# define TclIntPlatReserved13 (void (*) ()) TclpInetNtoa
# define TclWinAddProcess 0
# define TclWinNoBackslash 0
# define TclWinSetInterfaces 0
# define TclWinFlushDirtyChannels 0
# define TclWinResetInterfaces 0
+# define TclpGetPid 0
# define TclMacOSXGetFileAttribute 0 /* Only implemented in Tcl >= 8.5 */
# define TclMacOSXMatchType 0 /* Only implemented in Tcl >= 8.5 */
# define TclMacOSXNotifierAddRunLoopMode 0 /* Only implemented in Tcl >= 8.5 */
@@ -456,18 +484,18 @@ static const TclIntPlatStubs tclIntPlatStubs = {
#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
TclWinConvertError, /* 0 */
TclWinConvertWSAError, /* 1 */
- TclpCreateCommandChannel, /* 2 */
- TclpCreatePipe, /* 3 */
+ TclWinGetServByName, /* 2 */
+ TclWinGetSockOpt, /* 3 */
TclWinGetTclInstance, /* 4 */
0, /* 5 */
TclWinNToHS, /* 6 */
TclWinSetSockOpt, /* 7 */
- TclUnixWaitForFile, /* 8 */
+ TclpGetPid, /* 8 */
TclWinGetPlatformId, /* 9 */
TclpReaddir, /* 10 */
TclpLocaltime_unix, /* 11 */
TclpGmtime_unix, /* 12 */
- TclpInetNtoa, /* 13 */
+ TclIntPlatReserved13, /* 13 */
TclUnixCopyFile, /* 14 */
TclMacOSXGetFileAttribute, /* 15 */
0, /* 16 */
@@ -486,6 +514,13 @@ static const TclIntPlatStubs tclIntPlatStubs = {
TclWinCPUID, /* 29 */
TclGetAndDetachPids, /* 30 */
TclpCloseFile, /* 31 */
+ TclpCreateCommandChannel, /* 32 */
+ TclpCreatePipe, /* 33 */
+ TclpCreateProcess, /* 34 */
+ TclpInetNtoa, /* 35 */
+ TclpMakeFile, /* 36 */
+ TclpOpenFile, /* 37 */
+ TclUnixWaitForFile, /* 38 */
#endif /* UNIX */
#ifdef __WIN32__ /* WIN */
TclWinConvertError, /* 0 */
@@ -522,18 +557,18 @@ static const TclIntPlatStubs tclIntPlatStubs = {
#ifdef MAC_OSX_TCL /* MACOSX */
TclWinConvertError, /* 0 */
TclWinConvertWSAError, /* 1 */
- TclpCreateCommandChannel, /* 2 */
- TclpCreatePipe, /* 3 */
+ TclWinGetServByName, /* 2 */
+ TclWinGetSockOpt, /* 3 */
TclWinGetTclInstance, /* 4 */
0, /* 5 */
TclWinNToHS, /* 6 */
TclWinSetSockOpt, /* 7 */
- TclUnixWaitForFile, /* 8 */
+ TclpGetPid, /* 8 */
TclWinGetPlatformId, /* 9 */
TclpReaddir, /* 10 */
TclpLocaltime_unix, /* 11 */
TclpGmtime_unix, /* 12 */
- TclpInetNtoa, /* 13 */
+ TclIntPlatReserved13, /* 13 */
TclUnixCopyFile, /* 14 */
TclMacOSXGetFileAttribute, /* 15 */
TclMacOSXSetFileAttribute, /* 16 */
@@ -552,6 +587,13 @@ static const TclIntPlatStubs tclIntPlatStubs = {
TclWinCPUID, /* 29 */
TclGetAndDetachPids, /* 30 */
TclpCloseFile, /* 31 */
+ TclpCreateCommandChannel, /* 32 */
+ TclpCreatePipe, /* 33 */
+ TclpCreateProcess, /* 34 */
+ TclpInetNtoa, /* 35 */
+ TclpMakeFile, /* 36 */
+ TclpOpenFile, /* 37 */
+ TclUnixWaitForFile, /* 38 */
#endif /* MACOSX */
};