1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
-
+
|
/*
* tclWinSock.c --
*
* This file contains Windows-specific socket related code.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* RCS: @(#) $Id: tclWinSock.c,v 1.53 2006/03/27 18:08:51 andreas_kupries Exp $
* RCS: @(#) $Id: tclWinSock.c,v 1.54 2006/04/05 16:32:45 dgp Exp $
*/
#include "tclWinInt.h"
/*
* Make sure to remove the redirection defines set in tclWinPort.h that is in
* use in other sections of the core, except for us.
|
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
|
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
|
+
+
|
*/
Tcl_DStringInit(&ds);
Tcl_DStringSetLength(&ds, 255);
if (winSock.gethostname(Tcl_DStringValue(&ds),
Tcl_DStringLength(&ds)) == 0) {
Tcl_DStringSetLength(&ds, 0);
} else {
Tcl_DStringSetLength(&ds, strlen(Tcl_DStringValue(&ds)));
}
}
*encodingPtr = Tcl_GetEncoding(NULL, "utf-8");
*lengthPtr = Tcl_DStringLength(&ds);
*valuePtr = ckalloc((unsigned int) (*lengthPtr)+1);
memcpy((VOID *) *valuePtr, (VOID *) Tcl_DStringValue(&ds),
|