*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Mon, 19 Dec 2005 17:14:22 +0100
changeset 9025 e9fff455ecfb
parent 9024 8066b17d9ccf
child 9026 49a370c4ceb9
*** empty log message ***
FileStream.st
Win32OperatingSystem.st
--- a/FileStream.st	Mon Dec 19 17:12:51 2005 +0100
+++ b/FileStream.st	Mon Dec 19 17:14:22 2005 +0100
@@ -79,6 +79,8 @@
 # undef Signal
 # undef Delay
 # undef Context
+# undef Message
+# undef Process
 
 # define NOATOM
 # define NOGDICAPMASKS
@@ -134,6 +136,12 @@
 # ifdef __DEF_Context
 #  define Context __DEF_Context
 # endif
+# ifdef __DEF_Message
+#  define Message __DEF_Message
+# endif
+# ifdef __DEF_Process
+#  define Process __DEF_Process
+# endif
 
 # define INT int
 
@@ -1441,7 +1449,7 @@
 !FileStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/FileStream.st,v 1.121 2005-07-08 17:15:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/FileStream.st,v 1.122 2005-12-19 16:14:22 cg Exp $'
 ! !
 
 FileStream initialize!
--- a/Win32OperatingSystem.st	Mon Dec 19 17:12:51 2005 +0100
+++ b/Win32OperatingSystem.st	Mon Dec 19 17:14:22 2005 +0100
@@ -169,6 +169,8 @@
 # undef Set
 # undef Signal
 # undef Delay
+# undef Message
+# undef Process
 
 # include <stdarg.h> /* */
 # ifndef WINDOWS_H_INCLUDED
@@ -235,6 +237,12 @@
 # ifdef __DEF_Delay
 #  define Delay __DEF_Delay
 # endif
+# ifdef __DEF_Message
+#  define Message __DEF_Message
+# endif
+# ifdef __DEF_Process
+#  define Process __DEF_Process
+# endif
 
 # define INT int
 
@@ -4462,13 +4470,13 @@
      Returns nil if no mimeType for the given suffix is known."
 
     ^ RegistryEntry
-        stringValueFor:'Content Type'
-        atKey:('HKEY_CLASSES_ROOT\.' , aFileSuffix)
+	stringValueFor:'Content Type'
+	atKey:('HKEY_CLASSES_ROOT\.' , aFileSuffix)
 
     "
      self mimeTypeForSuffix:'au'
-     self mimeTypeForSuffix:'st' 
-     self mimeTypeForSuffix:'dll' 
+     self mimeTypeForSuffix:'st'
+     self mimeTypeForSuffix:'dll'
     "
 !
 
@@ -6573,31 +6581,31 @@
 
     libDirPath := self stxLibDirPath.
     libDirPath notNil ifTrue:[
-        "/ and also add the libDirPath from the registry ...
-        (sysPath includes:libDirPath) ifFalse:[
-            sysPath add:libDirPath
-        ].
+	"/ and also add the libDirPath from the registry ...
+	(sysPath includes:libDirPath) ifFalse:[
+	    sysPath add:libDirPath
+	].
     ].
     #(
-        '\programs\eXept\smalltalk'
-        '\programme\eXept\smalltalk'
-        '\programs\smalltalk'
-        '\programme\smalltalk'
-        '\smalltalk'
-    ) do:[:dir | 
-        |vsnDir|
-
-        (dir asFilename isDirectory) ifTrue:[
-            vsnDir := dir , '\' , Smalltalk versionString.
-            (vsnDir asFilename isDirectory) ifTrue:[
-                (sysPath includes:vsnDir) ifFalse:[
-                    sysPath add:vsnDir.
-                ]
-            ].
-            (sysPath includes:dir) ifFalse:[
-                sysPath add:dir.
-            ].
-        ]
+	'\programs\eXept\smalltalk'
+	'\programme\eXept\smalltalk'
+	'\programs\smalltalk'
+	'\programme\smalltalk'
+	'\smalltalk'
+    ) do:[:dir |
+	|vsnDir|
+
+	(dir asFilename isDirectory) ifTrue:[
+	    vsnDir := dir , '\' , Smalltalk versionString.
+	    (vsnDir asFilename isDirectory) ifTrue:[
+		(sysPath includes:vsnDir) ifFalse:[
+		    sysPath add:vsnDir.
+		]
+	    ].
+	    (sysPath includes:dir) ifFalse:[
+		sysPath add:dir.
+	    ].
+	]
     ].
 
     ^ sysPath
@@ -6624,18 +6632,18 @@
 stxLibDirPath
     "ask the registry for the lib directory"
 
-    (Array 
-        with:('HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X\' , Smalltalk versionString)
-        with:('HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X'))
+    (Array
+	with:('HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X\' , Smalltalk versionString)
+	with:('HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X'))
     do:[:eachKeyToTry |
-        |k p|
-
-        k := RegistryEntry key:eachKeyToTry.
-        k notNil ifTrue:[
-            p := k valueNamed:'LibDir'.
-            k closeKey.
-            ^ p
-        ].
+	|k p|
+
+	k := RegistryEntry key:eachKeyToTry.
+	k notNil ifTrue:[
+	    p := k valueNamed:'LibDir'.
+	    k closeKey.
+	    ^ p
+	].
     ].
     ^ nil
 
@@ -6697,16 +6705,16 @@
       'NON'     'no_NO'
       'NOR'     'no_NO'
      ) pairWiseDo:[:key :mappedValue|
-        key = windowsLanguageString ifTrue:[
-            ^ mappedValue
-        ]
+	key = windowsLanguageString ifTrue:[
+	    ^ mappedValue
+	]
     ].
 
     "no mapping"
     ^ windowsLanguageString.
 
     "
-     self mapLanguage:'DEU'  
+     self mapLanguage:'DEU'
     "
 !
 
@@ -7204,53 +7212,53 @@
 
     /* try cache */
     {
-        OBJ lastSeconds, lastTimeInfo;
-
-        lastSeconds = @global(LastTimeInfoSeconds);
-        if (lastSeconds
-         && (__longIntVal(lastSeconds) == t)
-         && (@global(LastTimeInfoMilliseconds) == osMilliseconds)
-         && (@global(LastTimeInfoIsLocal) == isLocalTime)
-        ) {
-            lastTimeInfo = @global(LastTimeInfo);
-            if (lastTimeInfo != nil) {
-                RETURN (lastTimeInfo);
-            }
-        }
+	OBJ lastSeconds, lastTimeInfo;
+
+	lastSeconds = @global(LastTimeInfoSeconds);
+	if (lastSeconds
+	 && (__longIntVal(lastSeconds) == t)
+	 && (@global(LastTimeInfoMilliseconds) == osMilliseconds)
+	 && (@global(LastTimeInfoIsLocal) == isLocalTime)
+	) {
+	    lastTimeInfo = @global(LastTimeInfo);
+	    if (lastTimeInfo != nil) {
+		RETURN (lastTimeInfo);
+	    }
+	}
     }
 
     tt = (TIME_T)t;
 
     if (isLocalTime == true) {
-        tmPtr = localtime(&tt);
+	tmPtr = localtime(&tt);
 #ifdef WINDOWS_IS_POSIX_CONFORM_WHICH_IT_IS_NOT
-        utcOffset = __MKINT(tmPtr->tm_gstoff);
+	utcOffset = __MKINT(tmPtr->tm_gstoff);
 #else
-        {
-            TIME_ZONE_INFORMATION tzInfo;
-            int gstoffMinutes = 0;
-
-            switch (GetTimeZoneInformation(&tzInfo)) {
-                default:
-                case TIME_ZONE_ID_UNKNOWN:
-                    fprintf(stderr, "Win32OperatingSystem [warning]: unknown timezone\n");
-                    break;
-                case TIME_ZONE_ID_STANDARD:
-                    gstoffMinutes = tzInfo.Bias;
-                    /* printf("standard\n");  */
-                    break;
-                case TIME_ZONE_ID_DAYLIGHT:
-                    gstoffMinutes = tzInfo.Bias;
-                    /* printf("daylight\n");  */
-                    break;
-            }
-            /* printf("utcOffset: %d\n", gstoffMinutes); */
-            utcOffset = __MKINT(gstoffMinutes*60);
-        }
+	{
+	    TIME_ZONE_INFORMATION tzInfo;
+	    int gstoffMinutes = 0;
+
+	    switch (GetTimeZoneInformation(&tzInfo)) {
+		default:
+		case TIME_ZONE_ID_UNKNOWN:
+		    fprintf(stderr, "Win32OperatingSystem [warning]: unknown timezone\n");
+		    break;
+		case TIME_ZONE_ID_STANDARD:
+		    gstoffMinutes = tzInfo.Bias;
+		    /* printf("standard\n");  */
+		    break;
+		case TIME_ZONE_ID_DAYLIGHT:
+		    gstoffMinutes = tzInfo.Bias;
+		    /* printf("daylight\n");  */
+		    break;
+	    }
+	    /* printf("utcOffset: %d\n", gstoffMinutes); */
+	    utcOffset = __MKINT(gstoffMinutes*60);
+	}
 #endif
     } else {
-        tmPtr = gmtime(&tt);
-        utcOffset = __mkSmallInteger(0);
+	tmPtr = gmtime(&tt);
+	utcOffset = __mkSmallInteger(0);
     }
 
     hours = __mkSmallInteger(tmPtr->tm_hour);
@@ -7267,29 +7275,29 @@
     dst = (tmPtr->tm_isdst == 0) ? false : true;
 #ifdef THIS_IS_WRONG
     if (dst == true) {
-        utcOffset = __MKINT(__intVal(utcOffset) + 3600);
+	utcOffset = __MKINT(__intVal(utcOffset) + 3600);
     }
 #endif
 %}.
     info := self timeInfoClass new.
 
     info
-        year:year
-        month:month
-        day:day
-        hours:hours
-        minutes:minutes
-        seconds:seconds
-        milliseconds:osMilliseconds
-        utcOffset:utcOffset
-        dst:dst
-        dayInYear:yDay
-        dayInWeek:wDay.
-
-    LastTimeInfo := info.                      
-    LastTimeInfoSeconds := osSeconds.          
-    LastTimeInfoMilliseconds := osMilliseconds. 
-    LastTimeInfoIsLocal := isLocalTime.       
+	year:year
+	month:month
+	day:day
+	hours:hours
+	minutes:minutes
+	seconds:seconds
+	milliseconds:osMilliseconds
+	utcOffset:utcOffset
+	dst:dst
+	dayInYear:yDay
+	dayInWeek:wDay.
+
+    LastTimeInfo := info.
+    LastTimeInfoSeconds := osSeconds.
+    LastTimeInfoMilliseconds := osMilliseconds.
+    LastTimeInfoIsLocal := isLocalTime.
 
     ^ info
 
@@ -8402,13 +8410,13 @@
     "returns a collection of root keyNames"
 
     ^ #(
-        'HKEY_CLASSES_ROOT'
-        'HKEY_CURRENT_USER'
-        'HKEY_LOCAL_MACHINE'
-        'HKEY_USERS'
-        'HKEY_PERFORMANCE_DATA'
-        'HKEY_CURRENT_CONFIG'
-        'HKEY_DYN_DATA'
+	'HKEY_CLASSES_ROOT'
+	'HKEY_CURRENT_USER'
+	'HKEY_LOCAL_MACHINE'
+	'HKEY_USERS'
+	'HKEY_PERFORMANCE_DATA'
+	'HKEY_CURRENT_CONFIG'
+	'HKEY_DYN_DATA'
       )
 !
 
@@ -8424,150 +8432,150 @@
 "
     Interface to a WIN32 registry.
 
-    As this is a private class, access it via 
-        Win32OperatingSystem registryEntry
+    As this is a private class, access it via
+	Win32OperatingSystem registryEntry
 
     [author:]
-        Claus Gittinger (initial version & cleanup)
+	Claus Gittinger (initial version & cleanup)
 "
 !
 
 examples
 "
     retrieve an existing entry by key:
-                                                                        [exBegin]
-        |k|
-
-        k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'
-                                                                        [exEnd]
+									[exBegin]
+	|k|
+
+	k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'
+									[exEnd]
 
 
     retrieve a non-existing entry by key:
-                                                                        [exBegin]
-        |k|
-
-        k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\xxx'
-                                                                        [exEnd]
+									[exBegin]
+	|k|
+
+	k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\xxx'
+									[exEnd]
 
 
     ask a keys value:
-                                                                        [exBegin]
-        |k|
-
-        k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion'.
-        Transcript show:'Windows serial NR:'; showCR:(k valueNamed:'ProductId').
-
-        k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'.
-        Transcript showCR:(k valueNamed:'CurrentVersion').
-                                                                        [exEnd]
+									[exBegin]
+	|k|
+
+	k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion'.
+	Transcript show:'Windows serial NR:'; showCR:(k valueNamed:'ProductId').
+
+	k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'.
+	Transcript showCR:(k valueNamed:'CurrentVersion').
+									[exEnd]
 
 
     create a sub-key (if not already present):
-                                                                        [exBegin]
-        |k subKey|
-
-        k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'.
-        subKey := k createSubKeyNamed:'RegistryDemo'
-                                                                        [exEnd]
+									[exBegin]
+	|k subKey|
+
+	k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'.
+	subKey := k createSubKeyNamed:'RegistryDemo'
+									[exEnd]
 
 
     change a keys value:
-                                                                        [exBegin]
-        |k|
-
-        k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\RegistryDemo'.
-        k valueNamed:'FooBarBaz' put:'a foo bar baz string'.
-                                                                        [exEnd]
+									[exBegin]
+	|k|
+
+	k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\RegistryDemo'.
+	k valueNamed:'FooBarBaz' put:'a foo bar baz string'.
+									[exEnd]
 
     delete a value:
-                                                                        [exBegin]
-        |k|
-
-        k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\RegistryDemo'.
-        k deleteValueNamed:'FooBarBaz'.
-                                                                        [exEnd]
+									[exBegin]
+	|k|
+
+	k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\RegistryDemo'.
+	k deleteValueNamed:'FooBarBaz'.
+									[exEnd]
 
     delete a key:
-                                                                        [exBegin]
-        |k|
-
-        k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'.
-        k deleteSubKeyNamed:'RegistryDemo'.
-                                                                        [exEnd]
+									[exBegin]
+	|k|
+
+	k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'.
+	k deleteSubKeyNamed:'RegistryDemo'.
+									[exEnd]
 
     enumerate keys:
-                                                                        [exBegin]
-        |k|
-
-        k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software'.
-        k subKeysDo:[:subKey |
-            Transcript showCR:subKey path
-        ]
-                                                                        [exEnd]
+									[exBegin]
+	|k|
+
+	k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software'.
+	k subKeysDo:[:subKey |
+	    Transcript showCR:subKey path
+	]
+									[exEnd]
 
     enumerate all keys (recursive):
-                                                                        [exBegin]
-        |k|
-
-        k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software'.
-        k allSubKeysDo:[:subKey |
-            Transcript showCR:subKey path
-        ]
-                                                                        [exEnd]
+									[exBegin]
+	|k|
+
+	k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software'.
+	k allSubKeysDo:[:subKey |
+	    Transcript showCR:subKey path
+	]
+									[exEnd]
 
     fetch value by index:
-                                                                        [exBegin]
-        |k|
-
-        k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X'.
-        Transcript showCR:(k valueNameAtIndex:0)
-                                                                        [exEnd]
+									[exBegin]
+	|k|
+
+	k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X'.
+	Transcript showCR:(k valueNameAtIndex:0)
+									[exEnd]
 
 
     enumerate value names:
-                                                                        [exBegin]
-        |k|
-
-        k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X'.
-        k valueNamesDo:[:nm  |
-           Transcript showCR:nm.
-        ]
-                                                                        [exEnd]
+									[exBegin]
+	|k|
+
+	k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X'.
+	k valueNamesDo:[:nm  |
+	   Transcript showCR:nm.
+	]
+									[exEnd]
 
     enumerate values:
-                                                                        [exBegin]
-        |k|
-
-        k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X'.
-        k valueNamesAndValuesDo:[:nm :val |
-            Transcript showCR:(nm , ' -> ' , val storeString).
-        ]
-                                                                        [exEnd]
+									[exBegin]
+	|k|
+
+	k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X'.
+	k valueNamesAndValuesDo:[:nm :val |
+	    Transcript showCR:(nm , ' -> ' , val storeString).
+	]
+									[exEnd]
 
     search for a value (where does NT store the domain ?):
-                                                                        [exBegin]
-        |k|
-
-        k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\System'.
-        k subKeysDo:[:subKey |
-            subKey subKeysDo:[:subSubKey |
-                |tcp params|
-
-                (subSubKey path asLowercase endsWith:'services') ifTrue:[
-                    tcp := subSubKey subKeyNamed:'tcpip'.
-                    tcp notNil ifTrue:[
-                        params := tcp subKeyNamed:'parameters'.
-                        params notNil ifTrue:[
-                            Transcript showCR:'Domain is found in ' , params path ,
-                                        ' value: ' , (params valueNamed:'Domain').
-                            params close.
-                        ].
-                        tcp close.
-                    ]
-                ]
-            ]
-        ]
-                                                                        [exEnd]
+									[exBegin]
+	|k|
+
+	k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\System'.
+	k subKeysDo:[:subKey |
+	    subKey subKeysDo:[:subSubKey |
+		|tcp params|
+
+		(subSubKey path asLowercase endsWith:'services') ifTrue:[
+		    tcp := subSubKey subKeyNamed:'tcpip'.
+		    tcp notNil ifTrue:[
+			params := tcp subKeyNamed:'parameters'.
+			params notNil ifTrue:[
+			    Transcript showCR:'Domain is found in ' , params path ,
+					' value: ' , (params valueNamed:'Domain').
+			    params close.
+			].
+			tcp close.
+		    ]
+		]
+	    ]
+	]
+									[exEnd]
 
 
 "
@@ -8596,31 +8604,31 @@
 !
 
 rootKeyValueFor:specialKeyStringOrSymbol
-    "returns one of the root keys or nil 
+    "returns one of the root keys or nil
      (these are shared and not finalized, as opposed to all other keys)"
 
     HKEY_CLASSES_ROOT isNil ifTrue:[self initialize].
 
     specialKeyStringOrSymbol = #'HKEY_CLASSES_ROOT' ifTrue:[
-        ^ HKEY_CLASSES_ROOT.
+	^ HKEY_CLASSES_ROOT.
     ].
     specialKeyStringOrSymbol = #'HKEY_CURRENT_USER' ifTrue:[
-        ^ HKEY_CURRENT_USER.
+	^ HKEY_CURRENT_USER.
     ].
     specialKeyStringOrSymbol = #'HKEY_LOCAL_MACHINE' ifTrue:[
-        ^ HKEY_LOCAL_MACHINE.
+	^ HKEY_LOCAL_MACHINE.
     ].
     specialKeyStringOrSymbol = #'HKEY_USERS' ifTrue:[
-        ^ HKEY_USERS.
+	^ HKEY_USERS.
     ].
     specialKeyStringOrSymbol = #'HKEY_PERFORMANCE_DATA' ifTrue:[
-        ^ HKEY_PERFORMANCE_DATA.
+	^ HKEY_PERFORMANCE_DATA.
     ].
     specialKeyStringOrSymbol = #'HKEY_CURRENT_CONFIG' ifTrue:[
-        ^ HKEY_CURRENT_CONFIG.
+	^ HKEY_CURRENT_CONFIG.
     ].
     specialKeyStringOrSymbol = #'HKEY_DYN_DATA' ifTrue:[
-        ^ HKEY_DYN_DATA.
+	^ HKEY_DYN_DATA.
     ].
 
     ^ nil
@@ -9428,7 +9436,7 @@
 !
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.187 2005-12-16 14:52:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.188 2005-12-19 16:14:22 cg Exp $'
 ! !
 
 !Win32OperatingSystem::Win32FILEHandle methodsFor:'release'!
@@ -9455,7 +9463,7 @@
 !
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.187 2005-12-16 14:52:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.188 2005-12-19 16:14:22 cg Exp $'
 ! !
 
 !Win32OperatingSystem::Win32Handle methodsFor:'io'!
@@ -10475,7 +10483,7 @@
 !Win32OperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.187 2005-12-16 14:52:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.188 2005-12-19 16:14:22 cg Exp $'
 ! !
 
 Win32OperatingSystem initialize!