author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 13 Feb 2012 19:19:41 +0000 | |
branch | jv |
changeset 17921 | 4069fe8e9039 |
parent 17912 | 80eb31a5a622 |
child 18005 | e67ae1bced52 |
permissions | -rw-r--r-- |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2 |
COPYRIGHT (c) 1988 by Claus Gittinger |
17910 | 3 |
All Rights Reserved |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5 |
This software is furnished under a license and may be used |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6 |
only in accordance with the terms of that license and with the |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
10 |
hereby transferred. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
11 |
" |
5407 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
14 |
Object subclass:#AbstractOperatingSystem |
17814 | 15 |
instanceVariableNames:'' |
16 |
classVariableNames:'ConcreteClass LastErrorNumber LocaleInfo OSSignals PipeFailed |
|
17 |
ErrorSignal AccessDeniedErrorSignal FileNotFoundErrorSignal |
|
18 |
InvalidArgumentsSignal UnsupportedOperationSignal Resources' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'System-Support' |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
21 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
22 |
|
9476 | 23 |
Object subclass:#PrinterInfo |
17814 | 24 |
instanceVariableNames:'printerName attributes documentProperties printerInfo2' |
25 |
classVariableNames:'' |
|
26 |
poolDictionaries:'' |
|
27 |
privateIn:AbstractOperatingSystem |
|
9476 | 28 |
! |
29 |
||
7514 | 30 |
Object subclass:#TimeInfo |
17814 | 31 |
instanceVariableNames:'year month day hours minutes seconds utcOffset dst milliseconds |
32 |
dayInYear dayInWeek' |
|
33 |
classVariableNames:'' |
|
34 |
poolDictionaries:'' |
|
35 |
privateIn:AbstractOperatingSystem |
|
7514 | 36 |
! |
37 |
||
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
38 |
Object subclass:#TimeZoneInfo |
17814 | 39 |
instanceVariableNames:'bias name standardYear standardMonth standardDay standardWeekDay |
40 |
standardHour standardMinute standardBias daylightName |
|
41 |
standardDate daylightDate daylightYear daylightMonth daylightDay |
|
42 |
daylightWeekDay daylightHour daylightMinute daylightBias' |
|
43 |
classVariableNames:'' |
|
44 |
poolDictionaries:'' |
|
45 |
privateIn:AbstractOperatingSystem |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
46 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
47 |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
48 |
!AbstractOperatingSystem primitiveDefinitions! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
49 |
%{ |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
50 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
51 |
#include "stxOSDefs.h" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
52 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
53 |
%} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
54 |
! ! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
55 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
56 |
!AbstractOperatingSystem class methodsFor:'documentation'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
57 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
58 |
copyright |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
59 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
60 |
COPYRIGHT (c) 1988 by Claus Gittinger |
17910 | 61 |
All Rights Reserved |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
62 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
63 |
This software is furnished under a license and may be used |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
64 |
only in accordance with the terms of that license and with the |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
65 |
inclusion of the above copyright notice. This software may not |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
66 |
be provided or otherwise made available to, or used by, any |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
67 |
other person. No title to or ownership of the software is |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
68 |
hereby transferred. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
69 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
70 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
71 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
72 |
documentation |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
73 |
" |
4200 | 74 |
this class realizes services common to the supported operating systems; |
75 |
typically, services which can be implemented based upon more primitive |
|
76 |
functions, or which can be implemented in a portable way (but probably |
|
77 |
less performant) are implemented here. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
78 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
79 |
[Class variables:] |
17910 | 80 |
ConcreteClass <Class> the real OS class |
81 |
||
82 |
LocaleInfo <Dictionary> if non nil, that is taken instead of the operating |
|
83 |
systems locale definitions (allows for overwriting |
|
84 |
these, or provide a compatible info on systems which do |
|
85 |
not support locales) |
|
86 |
||
87 |
LastErrorNumber <Integer> the last value of errno |
|
88 |
||
89 |
OSSignals <Array> Array of signals to be raised for corresponding |
|
90 |
OperatingSystem signals. |
|
91 |
||
92 |
PipeFailed <Boolean> set if a fork (or popen) has failed; |
|
93 |
ST/X will avoid doing more forks/popens |
|
94 |
if this flag is set, for a slightly |
|
95 |
smoother operation. |
|
96 |
||
97 |
ErrorSignal <Signal> Parentsignal of all OS error signals. |
|
98 |
not directly raised. |
|
99 |
||
100 |
AccessDeniedErrorSignal misc concrete error reporting signals |
|
101 |
FileNotFoundErrorSignal |
|
102 |
UnsupportedOperationSignal |
|
103 |
InvalidArgumentsSignal |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
104 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
105 |
[author:] |
17910 | 106 |
Claus Gittinger |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
107 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
108 |
[see also:] |
17910 | 109 |
OSProcessStatus |
110 |
Filename Date Time |
|
111 |
ExternalStream FileStream PipeStream Socket |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
112 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
113 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
114 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
115 |
examples |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
116 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
117 |
various queries |
17910 | 118 |
[exBegin] |
8669 | 119 |
Transcript |
17910 | 120 |
showCR:'hello ' , (OperatingSystem getLoginName) |
121 |
[exEnd] |
|
122 |
||
123 |
[exBegin] |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
124 |
OperatingSystem isUNIXlike ifTrue:[ |
17910 | 125 |
Transcript showCR:'this is some UNIX-like OS' |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
126 |
] ifFalse:[ |
17910 | 127 |
Transcript showCR:'this OS is not UNIX-like' |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
128 |
] |
17910 | 129 |
[exEnd] |
130 |
||
131 |
[exBegin] |
|
8669 | 132 |
Transcript |
17910 | 133 |
showCR:'this machine is called ' , OperatingSystem getHostName |
134 |
[exEnd] |
|
135 |
||
136 |
[exBegin] |
|
8669 | 137 |
Transcript |
17910 | 138 |
showCR:('this machine is in the ' |
139 |
, OperatingSystem getDomainName |
|
140 |
, ' domain') |
|
141 |
[exEnd] |
|
142 |
||
143 |
[exBegin] |
|
8669 | 144 |
Transcript |
17910 | 145 |
showCR:('this machine''s CPU is a ' |
146 |
, OperatingSystem getCPUType |
|
147 |
) |
|
148 |
[exEnd] |
|
149 |
||
150 |
[exBegin] |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
151 |
Transcript showCR:'executing ls command ...'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
152 |
OperatingSystem executeCommand:'ls'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
153 |
Transcript showCR:'... done.'. |
17910 | 154 |
[exEnd] |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
155 |
|
8669 | 156 |
locking a file |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
157 |
(should be executed on two running smalltalks - not in two threads): |
17910 | 158 |
[exBegin] |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
159 |
|f| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
160 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
161 |
f := 'testFile' asFilename readWriteStream. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
162 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
163 |
10 timesRepeat:[ |
17910 | 164 |
'about to lock ...' printCR. |
165 |
[ |
|
166 |
OperatingSystem |
|
167 |
lockFD:(f fileDescriptor) |
|
168 |
shared:false |
|
169 |
blocking:false |
|
170 |
] whileFalse:[ |
|
171 |
'process ' print. OperatingSystem getProcessId print. ' is waiting' printCR. |
|
172 |
Delay waitForSeconds:1 |
|
173 |
]. |
|
174 |
'LOCKED ...' printCR. |
|
175 |
Delay waitForSeconds:10. |
|
176 |
'unlock ...' printCR. |
|
177 |
(OperatingSystem |
|
178 |
unlockFD:(f fileDescriptor)) printCR. |
|
179 |
Delay waitForSeconds:3. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
180 |
] |
17910 | 181 |
[exBegin] |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
182 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
183 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
184 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
185 |
!AbstractOperatingSystem class methodsFor:'initialization'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
186 |
|
6278 | 187 |
initResources |
8715 | 188 |
"/ allow for ResourcePack class to be missing (non-GUI smalltalks) |
10734
47c85e53a9d0
handle & ignore error when loading resources;
Claus Gittinger <cg@exept.de>
parents:
10733
diff
changeset
|
189 |
|
8715 | 190 |
ResourcePack notNil ifTrue:[ |
17910 | 191 |
Error handle:[:ex | |
192 |
'OS [warning]: error when reading resources for libbasic:' errorPrintCR. |
|
193 |
'OS [info]: 'errorPrint. ex description errorPrintCR. |
|
194 |
'OS [info]: backtrace: ' errorPrintCR. |
|
195 |
self withErrorStreamDo:[:s | |
|
196 |
ex suspendedContext fullPrintAllOn:s. |
|
197 |
]. |
|
198 |
] do:[ |
|
199 |
Resources := ResourcePack forPackage:(self package). |
|
200 |
]. |
|
8715 | 201 |
] |
10734
47c85e53a9d0
handle & ignore error when loading resources;
Claus Gittinger <cg@exept.de>
parents:
10733
diff
changeset
|
202 |
|
17841 | 203 |
"Modified: / 21-04-2011 / 12:48:02 / cg" |
6278 | 204 |
! |
205 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
206 |
initialize |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
207 |
"initialize the class" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
208 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
209 |
self initializeConcreteClass. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
210 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
211 |
ErrorSignal isNil ifTrue:[ |
17910 | 212 |
OSErrorHolder initialize. |
213 |
ErrorSignal := OsError. |
|
214 |
InvalidArgumentsSignal := OsInvalidArgumentsError. |
|
215 |
AccessDeniedErrorSignal := OSErrorHolder noPermissionsSignal. |
|
216 |
FileNotFoundErrorSignal := OSErrorHolder nonexistentSignal. |
|
217 |
UnsupportedOperationSignal := OSErrorHolder unsupportedOperationSignal. |
|
6278 | 218 |
]. |
219 |
Smalltalk addDependent:self. "/ to catch language changes |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
220 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
221 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
222 |
initializeConcreteClass |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
223 |
|osType cls| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
224 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
225 |
osType := self getSystemType. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
226 |
osType = 'win32' ifTrue:[ |
17910 | 227 |
cls := Win32OperatingSystem |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
228 |
] ifFalse:[ |
17910 | 229 |
osType = 'os2' ifTrue:[ |
230 |
cls := OS2OperatingSystem |
|
231 |
] ifFalse:[ |
|
232 |
osType = 'macos' ifTrue:[ |
|
233 |
cls := MacOperatingSystem |
|
234 |
] ifFalse:[ |
|
235 |
((osType = 'VMS') or:[osType = 'openVMS']) ifTrue:[ |
|
236 |
cls := OpenVMSOperatingSystem |
|
237 |
] ifFalse:[ |
|
238 |
cls := UnixOperatingSystem |
|
239 |
] |
|
240 |
] |
|
241 |
] |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
242 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
243 |
OperatingSystem := ConcreteClass := cls. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
244 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
245 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
246 |
!AbstractOperatingSystem class methodsFor:'OS signal constants'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
247 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
248 |
sigABRT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
249 |
"return the signal number for SIGABRT - 0 if not supported by OS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
250 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
251 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
252 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
253 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
254 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
255 |
sigALRM |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
256 |
"return the signal number for SIGALRM - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
257 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
258 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
259 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
260 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
261 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
262 |
sigBREAK |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
263 |
"return the signal number for SIGBREAK - 0 if not supported. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
264 |
This is an MSDOS specific signal" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
265 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
266 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
267 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
268 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
269 |
sigBUS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
270 |
"return the signal number for SIGBUS - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
271 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
272 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
273 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
274 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
275 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
276 |
sigCHLD |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
277 |
"return the signal number for SIGCHLD - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
278 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
279 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
280 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
281 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
282 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
283 |
sigCONT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
284 |
"return the signal number for SIGCONT - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
285 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
286 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
287 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
288 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
289 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
290 |
sigDANGER |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
291 |
"return the signal number for SIGDANGER - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
292 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
293 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
294 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
295 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
296 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
297 |
sigEMT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
298 |
"return the signal number for SIGEMT - 0 if not supported by OS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
299 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
300 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
301 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
302 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
303 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
304 |
sigFP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
305 |
"return the signal number for SIGFP - 0 if not supported by OS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
306 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
307 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
308 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
309 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
310 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
311 |
sigGRANT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
312 |
"return the signal number for SIGGRANT - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
313 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
314 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
315 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
316 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
317 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
318 |
sigHUP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
319 |
"return the signal number for SIGHUP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
320 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
321 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
322 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
323 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
324 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
325 |
sigILL |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
326 |
"return the signal number for SIGILL - 0 if not supported by OS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
327 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
328 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
329 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
330 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
331 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
332 |
sigINT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
333 |
"return the signal number for SIGINT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
334 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
335 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
336 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
337 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
338 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
339 |
sigIO |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
340 |
"return the signal number for SIGIO - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
341 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
342 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
343 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
344 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
345 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
346 |
sigIOT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
347 |
"return the signal number for SIGIOT - 0 if not supported by OS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
348 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
349 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
350 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
351 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
352 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
353 |
sigKILL |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
354 |
"return the signal number for SIGKILL |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
355 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
356 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
357 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
358 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
359 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
360 |
sigLOST |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
361 |
"return the signal number for SIGLOST - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
362 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
363 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
364 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
365 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
366 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
367 |
sigMIGRATE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
368 |
"return the signal number for SIGMIGRATE - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
369 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
370 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
371 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
372 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
373 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
374 |
sigMSG |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
375 |
"return the signal number for SIGMSG - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
376 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
377 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
378 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
379 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
380 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
381 |
sigPIPE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
382 |
"return the signal number for SIGPIPE - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
383 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
384 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
385 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
386 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
387 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
388 |
sigPOLL |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
389 |
"return the signal number for SIGPOLL - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
390 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
391 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
392 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
393 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
394 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
395 |
sigPRE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
396 |
"return the signal number for SIGPRE - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
397 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
398 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
399 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
400 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
401 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
402 |
sigPROF |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
403 |
"return the signal number for SIGPROF - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
404 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
405 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
406 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
407 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
408 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
409 |
sigPWR |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
410 |
"return the signal number for SIGPWR - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
411 |
(not available on all systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
412 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
413 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
414 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
415 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
416 |
sigQUIT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
417 |
"return the signal number for SIGQUIT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
418 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
419 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
420 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
421 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
422 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
423 |
sigRETRACT |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
424 |
"return the signal number for SIGRETRACT - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
425 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
426 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
427 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
428 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
429 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
430 |
sigSAK |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
431 |
"return the signal number for SIGSAK - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
432 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
433 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
434 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
435 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
436 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
437 |
sigSEGV |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
438 |
"return the signal number for SIGSEGV - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
439 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
440 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
441 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
442 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
443 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
444 |
sigSOUND |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
445 |
"return the signal number for SIGSOUND - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
446 |
(seems to be an AIX special)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
447 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
448 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
449 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
450 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
451 |
sigSTOP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
452 |
"return the signal number for SIGSTOP - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
453 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
454 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
455 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
456 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
457 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
458 |
sigSYS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
459 |
"return the signal number for SIGSYS - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
460 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
461 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
462 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
463 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
464 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
465 |
sigTERM |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
466 |
"return the signal number for SIGTERM - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
467 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
468 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
469 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
470 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
471 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
472 |
sigTRAP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
473 |
"return the signal number for SIGTRAP - 0 if not supported by OS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
474 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
475 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
476 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
477 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
478 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
479 |
sigTSTP |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
480 |
"return the signal number for SIGTSTP - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
481 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
482 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
483 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
484 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
485 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
486 |
sigTTIN |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
487 |
"return the signal number for SIGTTIN - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
488 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
489 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
490 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
491 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
492 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
493 |
sigTTOU |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
494 |
"return the signal number for SIGTTOU - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
495 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
496 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
497 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
498 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
499 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
500 |
sigURG |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
501 |
"return the signal number for SIGURG - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
502 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
503 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
504 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
505 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
506 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
507 |
sigUSR1 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
508 |
"return the signal number for SIGUSR1 - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
509 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
510 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
511 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
512 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
513 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
514 |
sigUSR2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
515 |
"return the signal number for SIGUSR2 - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
516 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
517 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
518 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
519 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
520 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
521 |
sigVTALRM |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
522 |
"return the signal number for SIGVTALRM - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
523 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
524 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
525 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
526 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
527 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
528 |
sigWINCH |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
529 |
"return the signal number for SIGWINCH - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
530 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
531 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
532 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
533 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
534 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
535 |
sigXCPU |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
536 |
"return the signal number for SIGXCPU - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
537 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
538 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
539 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
540 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
541 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
542 |
sigXFSZ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
543 |
"return the signal number for SIGXFSZ - 0 if not supported |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
544 |
(the numeric value is not the same across unix-systems)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
545 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
546 |
^ 0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
547 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
548 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
549 |
!AbstractOperatingSystem class methodsFor:'Signal constants'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
550 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
551 |
accessDeniedErrorSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
552 |
"return the signal raised when a (file-) access is denied." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
553 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
554 |
^ AccessDeniedErrorSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
555 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
556 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
557 |
errorSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
558 |
"return the parent signal of all OS signals." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
559 |
|
8497 | 560 |
^ OsError |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
561 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
562 |
"Modified: 22.4.1996 / 13:11:31 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
563 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
564 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
565 |
fileNotFoundErrorSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
566 |
"return the signal raised when a file was not found." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
567 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
568 |
^ FileNotFoundErrorSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
569 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
570 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
571 |
invalidArgumentsSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
572 |
"return the signal which is raised for invalid arguments. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
573 |
Currently, this is never raised." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
574 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
575 |
^ InvalidArgumentsSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
576 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
577 |
"Created: 13.9.1997 / 10:46:47 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
578 |
"Modified: 13.9.1997 / 10:47:03 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
579 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
580 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
581 |
unsupportedOperationSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
582 |
"return the signal which is raised when an operation |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
583 |
is attempted, which is not supported by the OS. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
584 |
(For example, creating a link on VMS or MSDOS)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
585 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
586 |
^ UnsupportedOperationSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
587 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
588 |
|
6278 | 589 |
!AbstractOperatingSystem class methodsFor:'change & update'! |
590 |
||
591 |
update:something with:aParameter from:changedObject |
|
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7492
diff
changeset
|
592 |
"Smalltalk notifies us about changes" |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7492
diff
changeset
|
593 |
|
6278 | 594 |
((something == #Language) or:[something == #LanguageTerritory]) ifTrue:[ |
17910 | 595 |
self initResources |
6278 | 596 |
] |
597 |
! ! |
|
598 |
||
17807 | 599 |
!AbstractOperatingSystem class methodsFor:'dummy shell operations'! |
600 |
||
601 |
openApplicationForDocument:aFilenameOrString operation:operationSymbol |
|
602 |
"open a windows-shell application to present the document contained in aFilenameOrString. |
|
603 |
This looks for the files extension, and is typically used to present help-files, |
|
604 |
html documents, pdf documents etc. |
|
605 |
operationSymbol is one of: |
|
17910 | 606 |
open |
607 |
edit |
|
608 |
explore |
|
17834 | 609 |
" |
17807 | 610 |
|
611 |
"/ use a fileBrowser |
|
612 |
UserPreferences current fileBrowserClass openOn:aFilenameOrString |
|
613 |
||
614 |
" |
|
615 |
self openApplicationForDocument: Filename currentDirectory operation:#open |
|
616 |
self openApplicationForDocument: '..\..\doc\books\ArtOfSmalltalk\artMissing186187Fix1.pdf' asFilename operation:#open |
|
617 |
||
618 |
self openApplicationForDocument: 'C:\WINDOWS\Help\clipbrd.chm' asFilename operation:#open |
|
619 |
" |
|
620 |
||
621 |
"Created: / 29-10-2010 / 12:16:38 / cg" |
|
17834 | 622 |
"Modified: / 05-02-2011 / 16:13:42 / cg" |
17807 | 623 |
! ! |
624 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
625 |
!AbstractOperatingSystem class methodsFor:'error messages'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
626 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
627 |
clearLastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
628 |
"return the last errors number. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
629 |
See also: #lastErrorSymbol and #lastErrorString. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
630 |
Notice: having a single error number is a bad idea in a multithreaded |
17910 | 631 |
environment - this interface will change." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
632 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
633 |
LastErrorNumber := nil. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
634 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
635 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
636 |
AbstractOperatingSystem clearLastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
637 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
638 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
639 |
"Created: 12.4.1996 / 09:28:58 / stefan" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
640 |
"Modified: 12.4.1996 / 09:38:51 / stefan" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
641 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
642 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
643 |
currentErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
644 |
"returns the OS's last error nr (i.e. the value of errno). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
645 |
Notice, that the value of this flag is only valid immediately |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
646 |
after the error occurred - it gets updated with every other |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
647 |
request to the OS. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
648 |
Use lastErrorNumber - currentErrorNumber is invalidated by |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
649 |
many, many internal calls." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
650 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
651 |
^ self lastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
652 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
653 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
654 |
OperatingSystem currentErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
655 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
656 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
657 |
|
6284 | 658 |
errorHolderForNumber:anInteger |
659 |
||
660 |
^ self subclassResponsibility |
|
661 |
! |
|
662 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
663 |
errorNumberFor:aSymbol |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
664 |
"given a symbolic error, return the numeric; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
665 |
(i.e. errorNumberFor:#EBADF returns EBADF's value). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
666 |
Use this, since error numbers are really not standard across unix systems." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
667 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
668 |
^ -1 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
669 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
670 |
|
6278 | 671 |
errorStringForSymbol:errorSymbol |
672 |
"return an errorMessage for an errorSymbol |
|
673 |
(as kept in an osErrorHolder)." |
|
674 |
||
675 |
Resources isNil ifTrue:[ |
|
17910 | 676 |
"/ do not care to load resource strings, if the error happens durig early initialization |
677 |
Smalltalk isInitialized ifFalse:[ |
|
678 |
^ errorSymbol |
|
679 |
]. |
|
680 |
self initResources. |
|
681 |
Resources isNil ifTrue:[ |
|
682 |
^ errorSymbol |
|
683 |
] |
|
6278 | 684 |
]. |
685 |
^ Resources at:errorSymbol ifAbsent:errorSymbol |
|
686 |
||
687 |
" |
|
8669 | 688 |
OperatingSystem errorStringForSymbol:#EPERM |
6278 | 689 |
OperatingSystem errorStringForSymbol:(OperatingSystem errorSymbolForNumber:4) |
690 |
" |
|
10733
c83c02dae4f8
handle & ignore error when loading resources;
Claus Gittinger <cg@exept.de>
parents:
10684
diff
changeset
|
691 |
|
17841 | 692 |
"Modified: / 21-04-2011 / 13:13:29 / cg" |
6278 | 693 |
! |
694 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
695 |
errorSymbolAndTextForNumber:errNr |
6284 | 696 |
"do not use - temporary for backward compatibility. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
697 |
The returned message is in english (as found in /usr/include/errno.h) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
698 |
and should be replaced by a resource lookup before being presented to the user." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
699 |
|
6284 | 700 |
|holder errSym| |
701 |
||
702 |
holder := self errorHolderForNumber:errNr. |
|
703 |
errSym := holder errorSymbol. |
|
8669 | 704 |
^ Array |
17910 | 705 |
with:errSym |
706 |
with:(self errorStringForSymbol:errSym) |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
707 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
708 |
" |
8669 | 709 |
OperatingSystem errorSymbolAndTextForNumber:(OperatingSystem errorNumberFor:#EPERM) |
710 |
OperatingSystem errorSymbolAndTextForNumber:(OperatingSystem errorNumberFor:#EIO) |
|
6287 | 711 |
OperatingSystem errorSymbolAndTextForNumber:(OperatingSystem errorNumberFor:#ENXIO) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
712 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
713 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
714 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
715 |
errorSymbolForNumber:errNr |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
716 |
"return a symbol for a unix errorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
717 |
(as returned by a system call)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
718 |
|
6284 | 719 |
^ (self errorHolderForNumber:errNr) errorSymbol |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
720 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
721 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
722 |
OperatingSystem errorSymbolForNumber:4 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
723 |
OperatingSystem errorSymbolForNumber:2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
724 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
725 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
726 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
727 |
errorTextForNumber:errNr |
8669 | 728 |
"return a message string from a unix errorNumber |
729 |
(as returned by a system call). |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
730 |
The returned message is in english (as found in /usr/include/errno.h) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
731 |
and should be replaced by a resource lookup before being presented to the user." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
732 |
|
6284 | 733 |
^ (self errorHolderForNumber:errNr) errorString |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
734 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
735 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
736 |
OperatingSystem errorTextForNumber:4 |
8669 | 737 |
OperatingSystem errorTextForNumber:(OperatingSystem errorNumberFor:#EPERM) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
738 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
739 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
740 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
741 |
lastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
742 |
"return the last errors number. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
743 |
See also: #lastErrorSymbol and #lastErrorString. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
744 |
Notice: having a single error number is a bad idea in a multithreaded |
17910 | 745 |
environment - this interface will change." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
746 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
747 |
^ LastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
748 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
749 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
750 |
OperatingSystem lastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
751 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
752 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
753 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
754 |
lastErrorString |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
755 |
"return a message string describing the last error. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
756 |
See also: #lastErrorNumber and #lastErrorSymbol. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
757 |
Notice: having a single error number is a bad idea in a multithreaded |
17910 | 758 |
environment - this interface will change." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
759 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
760 |
LastErrorNumber isNil ifTrue:[^ nil]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
761 |
^ self errorTextForNumber:LastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
762 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
763 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
764 |
OperatingSystem lastErrorString |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
765 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
766 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
767 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
768 |
lastErrorSymbol |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
769 |
"return a symbol (such as #EBADF or #EACCESS) describing the last error. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
770 |
See also: #lastErrorNumber and #lastErrorString. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
771 |
Notice: having a single error number is a bad idea in a multithreaded |
17910 | 772 |
environment - this interface will change." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
773 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
774 |
LastErrorNumber isNil ifTrue:[^ nil]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
775 |
^ self errorSymbolForNumber:LastErrorNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
776 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
777 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
778 |
OperatingSystem lastErrorSymbol |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
779 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
780 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
781 |
|
7656 | 782 |
!AbstractOperatingSystem class methodsFor:'executing OS commands-implementation'! |
783 |
||
784 |
exec:aCommandPath withArguments:argArray environment:env fileDescriptors:fds fork:doFork newPgrp:newGrp inDirectory:aDirectory |
|
785 |
"execute an OS command" |
|
786 |
||
787 |
^ self subclassResponsibility |
|
788 |
||
789 |
"Created: / 12.11.1998 / 14:46:15 / cg" |
|
790 |
! |
|
791 |
||
792 |
fork |
|
793 |
"fork a new (HEAVY-weight) unix process. |
|
794 |
Not supported with MSDOS & VMS systems. |
|
795 |
Dont confuse this with Block>>fork, which creates |
|
796 |
lightweight smalltalk processes. This method will return |
|
797 |
0 to the child process, and a non-zero number (which is the childs |
|
798 |
unix-process-id) to the parent (original) process. |
|
799 |
||
800 |
In normal situations, you dont need to use this low level entry; see |
|
801 |
#startProcess: and #executCommand: for higher level interfaces." |
|
802 |
||
803 |
"/ |
|
804 |
"/ not supported by OS |
|
805 |
"/ |
|
806 |
||
807 |
^ UnsupportedOperationSignal raise |
|
808 |
! |
|
7637 | 809 |
|
8669 | 810 |
startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream |
7637 | 811 |
errorTo:anExternalErrStream auxFrom:anExternalAuxStreamOrNil environment:environment inDirectory:dir |
812 |
"start executing the OS command as specified by the argument, aCommandString |
|
813 |
as a separate process; do not wait for the command to finish. |
|
814 |
The commandString is passed to a shell for execution - see the description of |
|
815 |
'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
|
816 |
The command gets stdIn, stdOut and stdErr assigned from the arguments; |
|
817 |
each may be nil. |
|
818 |
Return the processId if successful, nil otherwise. |
|
819 |
Use #monitorPid:action: for synchronization and exec status return, |
|
820 |
or #killProcess: to stop it." |
|
821 |
||
822 |
"raise an error: must be redefined in concrete subclass(es)" |
|
823 |
||
824 |
^ self subclassResponsibility |
|
7656 | 825 |
! ! |
826 |
||
827 |
!AbstractOperatingSystem class methodsFor:'executing OS commands-private'! |
|
828 |
||
829 |
shuffleAllFrom:anInStream to:anOutStream lineWise:lineWise lockWith:aLock |
|
830 |
||
831 |
lineWise ifFalse:[ |
|
17910 | 832 |
^ anInStream copyToEndInto:anOutStream. |
7656 | 833 |
]. |
834 |
[anInStream atEnd] whileFalse:[ |
|
17910 | 835 |
aLock critical:[ |
836 |
self |
|
837 |
shuffleFrom:anInStream |
|
838 |
to:anOutStream |
|
839 |
lineWise:lineWise |
|
840 |
] |
|
7656 | 841 |
] |
842 |
! |
|
843 |
||
844 |
shuffleFrom:anInStream to:anOutStream lineWise:lineWise |
|
845 |
"copy data from anInStream to anOutStream. |
|
846 |
Caller makes sure, than anInStream does not block. |
|
847 |
anOutstream should have been set to non-blocking-mode" |
|
848 |
||
849 |
lineWise ifTrue:[ |
|
17910 | 850 |
|data| |
851 |
||
852 |
data := anInStream nextLine. |
|
853 |
data notNil ifTrue:[ |
|
854 |
anOutStream nextPutLine:data |
|
855 |
] . |
|
8669 | 856 |
] ifFalse:[ |
17910 | 857 |
anInStream copyToEndInto:anOutStream. |
7656 | 858 |
]. |
859 |
! |
|
860 |
||
8669 | 861 |
shuffleRestFrom:anInStream to:anOutStream lineWise:lineWise |
7656 | 862 |
[anInStream atEnd] whileFalse:[ |
17910 | 863 |
self |
864 |
shuffleFrom:anInStream |
|
865 |
to:anOutStream |
|
866 |
lineWise:lineWise. |
|
7656 | 867 |
]. |
868 |
! |
|
869 |
||
870 |
startProcess:aCommandString |
|
871 |
"start executing the OS command as specified by the argument, aCommandString |
|
872 |
as a separate process; do not wait for the command to finish. |
|
873 |
The commandString is passed to a shell for execution - see the description of |
|
874 |
'sh -c' in your UNIX manual. |
|
875 |
Return the processId if successful, nil otherwise. |
|
876 |
Use #waitForProcess: for synchronization and exec status return, |
|
877 |
or #killProcess: to stop it." |
|
878 |
||
879 |
^ self |
|
17910 | 880 |
startProcess:aCommandString |
881 |
inputFrom:nil |
|
882 |
outputTo:nil |
|
883 |
errorTo:nil |
|
884 |
auxFrom:nil |
|
885 |
inDirectory:nil |
|
7656 | 886 |
|
887 |
" |
|
888 |
|pid| |
|
889 |
||
890 |
pid := OperatingSystem startProcess:'sleep 2; echo 1; sleep 2; echo 2'. |
|
891 |
(Delay forSeconds:3) wait. |
|
892 |
OperatingSystem killProcess:pid. |
|
893 |
" |
|
894 |
" |
|
895 |
|pid| |
|
896 |
||
897 |
pid := OperatingSystem startProcess:'dir/l'. |
|
898 |
(Delay forSeconds:1) wait. |
|
899 |
OperatingSystem killProcess:pid. |
|
900 |
" |
|
901 |
" |
|
902 |
|pid| |
|
903 |
||
8669 | 904 |
pid := OperatingSystem |
17910 | 905 |
startProcess:'dir/l' |
906 |
inputFrom:nil |
|
907 |
outputTo:Stdout |
|
908 |
errorTo:nil |
|
909 |
inDirectory:nil. |
|
7656 | 910 |
(Delay forSeconds:2) wait. |
911 |
OperatingSystem killProcess:pid. |
|
912 |
" |
|
913 |
||
914 |
"Modified: / 21.3.1997 / 10:04:35 / dq" |
|
915 |
"Modified: / 10.11.1998 / 21:03:50 / cg" |
|
916 |
! |
|
917 |
||
918 |
startProcess:aCommandString inDirectory:aDirectory |
|
919 |
"start executing the OS command as specified by the argument, aCommandString |
|
920 |
as a separate process; do not wait for the command to finish. |
|
921 |
The commandString is passed to a shell for execution - see the description of |
|
922 |
'sh -c' in your UNIX manual. |
|
923 |
Return the processId if successful, nil otherwise. |
|
924 |
Use #waitForProcess: for synchronization and exec status return, |
|
925 |
or #killProcess: to stop it." |
|
926 |
||
927 |
^ self |
|
17910 | 928 |
startProcess:aCommandString |
929 |
inputFrom:nil |
|
930 |
outputTo:nil |
|
931 |
errorTo:nil |
|
932 |
auxFrom:nil |
|
933 |
inDirectory:aDirectory |
|
7656 | 934 |
" |
935 |
|pid| |
|
936 |
||
937 |
pid := OperatingSystem startProcess:'sleep 2; echo 1; sleep 2; echo 2'. |
|
938 |
(Delay forSeconds:3) wait. |
|
939 |
OperatingSystem killProcess:pid. |
|
940 |
" |
|
941 |
||
942 |
"Modified: / 21.3.1997 / 10:04:35 / dq" |
|
943 |
"Modified: / 28.1.1998 / 14:13:33 / md" |
|
944 |
"Modified: / 10.11.1998 / 20:59:33 / cg" |
|
945 |
! |
|
946 |
||
947 |
startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream errorTo:anExternalErrStream |
|
948 |
"start executing the OS command as specified by the argument, aCommandString |
|
949 |
as a separate process; do not wait for the command to finish. |
|
950 |
The commandString is passed to a shell for execution - see the description of |
|
951 |
'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
|
952 |
The command gets stdIn, stdOut and stdErr assigned from the arguments; |
|
953 |
each may be nil. |
|
954 |
Return the processId if successful, nil otherwise. |
|
955 |
Use #monitorPid:action: for synchronization and exec status return, |
|
956 |
or #killProcess: to stop it." |
|
957 |
||
8669 | 958 |
^ self |
17910 | 959 |
startProcess:aCommandString |
960 |
inputFrom:anExternalInStream |
|
961 |
outputTo:anExternalOutStream |
|
962 |
errorTo:anExternalErrStream |
|
963 |
auxFrom:nil |
|
964 |
inDirectory:nil |
|
7656 | 965 |
|
966 |
"Modified: / 10.11.1998 / 20:59:05 / cg" |
|
967 |
! |
|
968 |
||
8587 | 969 |
startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream |
970 |
errorTo:anExternalErrStream auxFrom:anAuxiliaryStream inDirectory:dir |
|
971 |
||
8669 | 972 |
^ self |
17910 | 973 |
startProcess:aCommandString |
974 |
inputFrom:anExternalInStream |
|
975 |
outputTo:anExternalOutStream |
|
976 |
errorTo:anExternalErrStream |
|
977 |
auxFrom:anAuxiliaryStream |
|
978 |
environment:nil |
|
979 |
inDirectory:dir |
|
8587 | 980 |
! |
981 |
||
7656 | 982 |
startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream errorTo:anExternalErrStream inDirectory:dir |
983 |
"start executing the OS command as specified by the argument, aCommandString |
|
984 |
as a separate process; do not wait for the command to finish. |
|
985 |
The commandString is passed to a shell for execution - see the description of |
|
986 |
'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
|
987 |
The command gets stdIn, stdOut and stdErr assigned from the arguments; |
|
988 |
each may be nil. |
|
989 |
Return the processId if successful, nil otherwise. |
|
990 |
Use #monitorPid:action: for synchronization and exec status return, |
|
991 |
or #killProcess: to stop it." |
|
992 |
||
993 |
^ self |
|
17910 | 994 |
startProcess:aCommandString |
995 |
inputFrom:anExternalInStream |
|
996 |
outputTo:anExternalOutStream |
|
997 |
errorTo:anExternalErrStream |
|
998 |
auxFrom:nil |
|
999 |
inDirectory:dir |
|
7637 | 1000 |
! ! |
1001 |
||
8587 | 1002 |
!AbstractOperatingSystem class methodsFor:'executing OS commands-public'! |
7656 | 1003 |
|
1004 |
executeCommand:aCommandString |
|
1005 |
"execute the unix command specified by the argument, aCommandString. |
|
1006 |
The commandString is passed to a shell for execution - see the description of |
|
1007 |
'sh -c' in your UNIX manual. |
|
1008 |
Return true if successful, false otherwise." |
|
1009 |
||
1010 |
^ self |
|
17910 | 1011 |
executeCommand:aCommandString |
1012 |
inputFrom:nil |
|
1013 |
outputTo:nil |
|
1014 |
errorTo:nil |
|
1015 |
auxFrom:nil |
|
1016 |
inDirectory:nil |
|
1017 |
lineWise:false |
|
1018 |
onError:[:status| false] |
|
7656 | 1019 |
|
1020 |
"unix: |
|
1021 |
||
8669 | 1022 |
OperatingSystem executeCommand:'sleep 30'. |
1023 |
OperatingSystem executeCommand:'pwd'. |
|
1024 |
OperatingSystem executeCommand:'ls -l'. |
|
1025 |
OperatingSystem executeCommand:'invalidCommand'. |
|
1026 |
OperatingSystem executeCommand:'rm /tmp/foofoofoofoo'. |
|
7656 | 1027 |
" |
1028 |
||
1029 |
"msdos: |
|
1030 |
||
8669 | 1031 |
OperatingSystem executeCommand:'dir' |
7656 | 1032 |
OperatingSystem executeCommand:'dir /w' |
1033 |
" |
|
1034 |
||
1035 |
"vms: |
|
1036 |
||
1037 |
OperatingSystem executeCommand:'dir' |
|
1038 |
OperatingSystem executeCommand:'purge' |
|
1039 |
OperatingSystem executeCommand:'cc foo.c' |
|
1040 |
" |
|
1041 |
||
1042 |
"Modified: / 7.1.1997 / 19:29:55 / stefan" |
|
1043 |
"Modified: / 10.11.1998 / 20:55:37 / cg" |
|
1044 |
! |
|
1045 |
||
1046 |
executeCommand:aCommandString errorTo:errorStream |
|
1047 |
"execute the unix command specified by the argument, aCommandString. |
|
1048 |
The commandString is passed to a shell for execution - see the description of |
|
1049 |
'sh -c' in your UNIX manual. |
|
1050 |
Return true if successful, false otherwise." |
|
1051 |
||
1052 |
^ self |
|
17910 | 1053 |
executeCommand:aCommandString |
1054 |
inputFrom:nil |
|
1055 |
outputTo:nil |
|
1056 |
errorTo:errorStream |
|
1057 |
auxFrom:nil |
|
1058 |
inDirectory:nil |
|
1059 |
lineWise:false |
|
1060 |
onError:[:status| false] |
|
7656 | 1061 |
|
1062 |
"unix: |
|
1063 |
||
8669 | 1064 |
OperatingSystem executeCommand:'ls -l' errorTo:Transcript. |
1065 |
OperatingSystem executeCommand:'invalidCommand' errorTo:Transcript. |
|
1066 |
OperatingSystem executeCommand:'rm /tmp/foofoofoofoo' errorTo:Transcript. |
|
7656 | 1067 |
" |
1068 |
! |
|
1069 |
||
10021 | 1070 |
executeCommand:aCommandString errorTo:errorStream inDirectory:aDirectory |
1071 |
"execute the unix command specified by the argument, aCommandString. |
|
1072 |
The commandString is passed to a shell for execution - see the description of |
|
1073 |
'sh -c' in your UNIX manual. |
|
1074 |
Return true if successful, false otherwise." |
|
1075 |
||
1076 |
^ self |
|
17910 | 1077 |
executeCommand:aCommandString |
1078 |
inputFrom:nil |
|
1079 |
outputTo:nil |
|
1080 |
errorTo:errorStream |
|
1081 |
auxFrom:nil |
|
1082 |
inDirectory:aDirectory |
|
1083 |
lineWise:false |
|
1084 |
onError:[:status| false] |
|
10021 | 1085 |
|
1086 |
"unix: |
|
1087 |
||
1088 |
OperatingSystem executeCommand:'ls -l' errorTo:Transcript. |
|
1089 |
OperatingSystem executeCommand:'invalidCommand' errorTo:Transcript. |
|
1090 |
OperatingSystem executeCommand:'rm /tmp/foofoofoofoo' errorTo:Transcript. |
|
1091 |
" |
|
1092 |
||
1093 |
"Created: / 29-09-2006 / 14:58:30 / cg" |
|
1094 |
! |
|
1095 |
||
7656 | 1096 |
executeCommand:aCommandString inDirectory:aDirectory |
1097 |
"execute the unix command specified by the argument, aCommandString. |
|
1098 |
The commandString is passed to a shell for execution - see the description of |
|
1099 |
'sh -c' in your UNIX manual. |
|
1100 |
Return true if successful, false otherwise." |
|
1101 |
||
1102 |
^ self |
|
17910 | 1103 |
executeCommand:aCommandString |
1104 |
inputFrom:nil |
|
1105 |
outputTo:nil |
|
1106 |
errorTo:nil |
|
1107 |
auxFrom:nil |
|
1108 |
inDirectory:aDirectory |
|
1109 |
lineWise:false |
|
1110 |
onError:[:exitStatus| false] |
|
7656 | 1111 |
|
1112 |
"Modified: / 10.11.1998 / 20:54:37 / cg" |
|
1113 |
! |
|
1114 |
||
8669 | 1115 |
executeCommand:aCommandString inDirectory:aDirectory onError:aBlock |
7656 | 1116 |
"execute the unix command specified by the argument, aCommandString. |
1117 |
The commandString is passed to a shell for execution - see the description of |
|
1118 |
'sh -c' in your UNIX manual. |
|
1119 |
Return true if successful, the value from aBlock if not. |
|
1120 |
If not successfull, aBlock is called with an OsProcessStatus |
|
1121 |
(containing the exit status) as argument." |
|
1122 |
||
1123 |
^ self |
|
17910 | 1124 |
executeCommand:aCommandString |
1125 |
inputFrom:nil |
|
1126 |
outputTo:nil |
|
1127 |
errorTo:nil |
|
1128 |
auxFrom:nil |
|
1129 |
inDirectory:aDirectory |
|
1130 |
lineWise:false |
|
1131 |
onError:aBlock |
|
7656 | 1132 |
|
1133 |
"Modified: / 10.11.1998 / 20:54:37 / cg" |
|
1134 |
! |
|
1135 |
||
8669 | 1136 |
executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1137 |
errorTo:anErrStream auxFrom:anAuxStream environment:environmentDictionary |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1138 |
inDirectory:dirOrNil lineWise:lineWise onError:aBlock |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1139 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1140 |
"execute the unix command specified by the argument, aCommandString. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1141 |
The commandString is passed to a shell for execution - see the description of |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1142 |
'sh -c' in your UNIX manual. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1143 |
Return true if successful, or the value of aBlock if not. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1144 |
If not successfull, aBlock is called with an OsProcessStatus |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1145 |
(containing the exit status) as argument. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1146 |
The given in, out and err streams may be arbitrary (Smalltalk-) streams; |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1147 |
if any is not an external stream (which is required by the command), |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1148 |
extra pipes and shuffler processes are created, which stuff the data into |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1149 |
those internal stream(s). |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1150 |
Nil stream args will execute the command connected to ST/X's standard input, output or |
7488
5afbbabd4ae4
More fixes for executeCommand...
Stefan Vogel <sv@exept.de>
parents:
7484
diff
changeset
|
1151 |
error resp. - i.e. usually, i/o will be from/to the terminal. |
5afbbabd4ae4
More fixes for executeCommand...
Stefan Vogel <sv@exept.de>
parents:
7484
diff
changeset
|
1152 |
|
8669 | 1153 |
Set lineWise to true, if both error and output is sent to the same stream |
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7492
diff
changeset
|
1154 |
and you don't want lines to be mangled. Set lineWise = false to |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7492
diff
changeset
|
1155 |
avoid vlocking on pipes" |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1156 |
|
8669 | 1157 |
|pid exitStatus sema pIn pOut pErr pAux externalInStream externalOutStream externalErrStream externalAuxStream |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1158 |
shuffledInStream shuffledOutStream shuffledErrStream shuffledAuxStream |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1159 |
inputShufflerProcess outputShufflerProcess errorShufflerProcess auxShufflerProcess stopShufflers |
10387 | 1160 |
inStreamToClose outStreamToClose errStreamToClose auxStreamToClose terminateLock |
1161 |
closeStreams| |
|
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1162 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1163 |
terminateLock := Semaphore forMutualExclusion. |
8669 | 1164 |
((externalInStream := anInStream) notNil |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1165 |
and:[externalInStream isExternalStream not]) ifTrue:[ |
17910 | 1166 |
pIn := NonPositionableExternalStream makePipe. |
1167 |
inStreamToClose := externalInStream := pIn at:1. |
|
1168 |
shuffledInStream := pIn at:2. |
|
1169 |
anInStream isBinary ifTrue:[ |
|
1170 |
shuffledInStream binary |
|
1171 |
]. |
|
1172 |
lineWise ifFalse:[ |
|
1173 |
shuffledInStream blocking:false. |
|
1174 |
]. |
|
1175 |
||
1176 |
"/ start a reader process, shuffling data from the given |
|
1177 |
"/ inStream to the pipe (which is connected to the commands input) |
|
1178 |
inputShufflerProcess := |
|
1179 |
[ |
|
1180 |
[ |
|
1181 |
[anInStream atEnd] whileFalse:[ |
|
1182 |
self shuffleFrom:anInStream to:shuffledInStream lineWise:lineWise. |
|
1183 |
shuffledInStream flush |
|
1184 |
] |
|
1185 |
] ensure:[ |
|
1186 |
shuffledInStream close |
|
1187 |
] |
|
1188 |
] newProcess |
|
1189 |
name:'cmd input shuffler'; |
|
10498
db5cd86b77e2
Be conservative when setting helper processes of executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
10491
diff
changeset
|
1190 |
"/ beSystemProcess; |
17910 | 1191 |
resume. |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1192 |
]. |
8669 | 1193 |
((externalOutStream := anOutStream) notNil |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1194 |
and:[externalOutStream isExternalStream not]) ifTrue:[ |
17910 | 1195 |
pOut := NonPositionableExternalStream makePipe. |
1196 |
shuffledOutStream := (pOut at:1). |
|
1197 |
anOutStream isBinary ifTrue:[ |
|
1198 |
shuffledOutStream binary |
|
1199 |
]. |
|
1200 |
outStreamToClose := externalOutStream := pOut at:2. |
|
1201 |
outputShufflerProcess := |
|
1202 |
[ |
|
1203 |
WriteError handle:[:ex | |
|
1204 |
"/ ignored |
|
1205 |
] do:[ |
|
1206 |
self shuffleAllFrom:shuffledOutStream to:anOutStream lineWise:lineWise lockWith:terminateLock. |
|
1207 |
]. |
|
1208 |
] newProcess |
|
1209 |
name:'cmd output shuffler'; |
|
10498
db5cd86b77e2
Be conservative when setting helper processes of executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
10491
diff
changeset
|
1210 |
"/ beSystemProcess; |
17910 | 1211 |
resume. |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1212 |
]. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1213 |
(externalErrStream := anErrStream) notNil ifTrue:[ |
17910 | 1214 |
anErrStream == anOutStream ifTrue:[ |
1215 |
externalErrStream := externalOutStream |
|
1216 |
] ifFalse:[ |
|
1217 |
anErrStream isExternalStream ifFalse:[ |
|
1218 |
pErr := NonPositionableExternalStream makePipe. |
|
1219 |
shuffledErrStream := (pErr at:1). |
|
1220 |
anErrStream isBinary ifTrue:[ |
|
1221 |
shuffledErrStream binary |
|
1222 |
]. |
|
1223 |
errStreamToClose := externalErrStream := pErr at:2. |
|
1224 |
errorShufflerProcess := |
|
1225 |
[ |
|
1226 |
self shuffleAllFrom:shuffledErrStream to:anErrStream lineWise:lineWise lockWith:terminateLock. |
|
1227 |
] newProcess |
|
1228 |
name:'cmd err-output shuffler'; |
|
10498
db5cd86b77e2
Be conservative when setting helper processes of executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
10491
diff
changeset
|
1229 |
"/ beSystemProcess; |
17910 | 1230 |
resume. |
1231 |
] |
|
1232 |
] |
|
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1233 |
]. |
8669 | 1234 |
((externalAuxStream := anAuxStream) notNil |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1235 |
and:[externalAuxStream isExternalStream not]) ifTrue:[ |
17910 | 1236 |
pAux := NonPositionableExternalStream makePipe. |
1237 |
auxStreamToClose := externalAuxStream := pAux at:1. |
|
1238 |
shuffledAuxStream := pAux at:2. |
|
1239 |
shuffledAuxStream blocking:false. |
|
1240 |
anAuxStream isBinary ifTrue:[ |
|
1241 |
shuffledAuxStream binary |
|
1242 |
]. |
|
1243 |
||
1244 |
"/ start a reader process, shuffling data from the given |
|
1245 |
"/ auxStream to the pipe (which is connected to the commands aux) |
|
1246 |
auxShufflerProcess := |
|
1247 |
[ |
|
1248 |
[ |
|
1249 |
[anAuxStream atEnd] whileFalse:[ |
|
1250 |
self shuffleFrom:anAuxStream to:shuffledAuxStream lineWise:false. |
|
1251 |
shuffledAuxStream flush |
|
1252 |
] |
|
1253 |
] ensure:[ |
|
1254 |
shuffledAuxStream close |
|
1255 |
] |
|
1256 |
] newProcess |
|
1257 |
name:'cmd aux shuffler'; |
|
10498
db5cd86b77e2
Be conservative when setting helper processes of executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
10491
diff
changeset
|
1258 |
"/ beSystemProcess; |
17910 | 1259 |
resume. |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1260 |
]. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1261 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1262 |
stopShufflers := [ |
17910 | 1263 |
inputShufflerProcess notNil ifTrue:[ |
1264 |
terminateLock critical:[inputShufflerProcess terminate]. |
|
1265 |
inputShufflerProcess waitUntilTerminated |
|
1266 |
]. |
|
1267 |
auxShufflerProcess notNil ifTrue:[ |
|
1268 |
terminateLock critical:[auxShufflerProcess terminate]. |
|
1269 |
auxShufflerProcess waitUntilTerminated |
|
1270 |
]. |
|
1271 |
outputShufflerProcess notNil ifTrue:[ |
|
1272 |
terminateLock critical:[outputShufflerProcess terminate]. |
|
1273 |
outputShufflerProcess waitUntilTerminated. |
|
1274 |
self shuffleRestFrom:shuffledOutStream to:anOutStream lineWise:lineWise. |
|
1275 |
shuffledOutStream close. |
|
1276 |
]. |
|
1277 |
errorShufflerProcess notNil ifTrue:[ |
|
1278 |
terminateLock critical:[errorShufflerProcess terminate]. |
|
1279 |
errorShufflerProcess waitUntilTerminated. |
|
1280 |
self shuffleRestFrom:shuffledErrStream to:anErrStream lineWise:lineWise. |
|
1281 |
shuffledErrStream close. |
|
1282 |
]. |
|
10387 | 1283 |
]. |
1284 |
||
1285 |
closeStreams := [ |
|
17910 | 1286 |
inStreamToClose notNil ifTrue:[ |
1287 |
inStreamToClose close |
|
1288 |
]. |
|
1289 |
errStreamToClose notNil ifTrue:[ |
|
1290 |
errStreamToClose close |
|
1291 |
]. |
|
1292 |
outStreamToClose notNil ifTrue:[ |
|
1293 |
outStreamToClose close |
|
1294 |
]. |
|
1295 |
auxStreamToClose notNil ifTrue:[ |
|
1296 |
auxStreamToClose close |
|
1297 |
]. |
|
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7492
diff
changeset
|
1298 |
]. |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1299 |
|
10387 | 1300 |
|
1301 |
sema := Semaphore new name:'OS command wait'. |
|
1302 |
[ |
|
17910 | 1303 |
pid := Processor |
1304 |
monitor:[ |
|
1305 |
self |
|
1306 |
startProcess:aCommandString |
|
1307 |
inputFrom:externalInStream |
|
1308 |
outputTo:externalOutStream |
|
1309 |
errorTo:externalErrStream |
|
1310 |
auxFrom:externalAuxStream |
|
1311 |
environment:environmentDictionary |
|
1312 |
inDirectory:dirOrNil |
|
1313 |
] |
|
1314 |
action:[:status | |
|
1315 |
status stillAlive ifFalse:[ |
|
1316 |
exitStatus := status. |
|
1317 |
sema signal. |
|
1318 |
self closePid:pid |
|
1319 |
] |
|
1320 |
]. |
|
1321 |
||
1322 |
pid isNil ifTrue:[ |
|
1323 |
exitStatus := self osProcessStatusClass processCreationFailure |
|
1324 |
] ifFalse:[ |
|
1325 |
sema wait. |
|
1326 |
]. |
|
10387 | 1327 |
] ifCurtailed:[ |
17910 | 1328 |
closeStreams value. |
1329 |
pid notNil ifTrue:[ |
|
1330 |
"/ terminate the os-command (and all of its forked commands) |
|
1331 |
self terminateProcessGroup:pid. |
|
1332 |
self terminateProcess:pid. |
|
1333 |
self closePid:pid. |
|
1334 |
]. |
|
1335 |
stopShufflers value. |
|
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1336 |
]. |
10387 | 1337 |
|
1338 |
closeStreams value. |
|
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1339 |
stopShufflers value. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1340 |
exitStatus success ifFalse:[ |
17910 | 1341 |
^ aBlock value:exitStatus |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1342 |
]. |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1343 |
^ true |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1344 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1345 |
" |
17910 | 1346 |
|outStream errStream| |
1347 |
||
1348 |
outStream := '' writeStream. |
|
1349 |
||
1350 |
OperatingSystem executeCommand:'ls -l' |
|
1351 |
inputFrom:'abc' readStream |
|
1352 |
outputTo:outStream |
|
1353 |
errorTo:nil |
|
1354 |
inDirectory:nil |
|
1355 |
lineWise:true |
|
1356 |
onError:[:exitStatus | ^ false]. |
|
1357 |
outStream contents |
|
1358 |
" |
|
1359 |
||
1360 |
" |
|
1361 |
|outStream errStream| |
|
1362 |
||
1363 |
outStream := #[] writeStream. |
|
1364 |
||
1365 |
OperatingSystem executeCommand:'cat' |
|
1366 |
inputFrom:(ByteArray new:5000000) readStream |
|
1367 |
outputTo:outStream |
|
1368 |
errorTo:nil |
|
1369 |
inDirectory:nil |
|
1370 |
lineWise:false |
|
1371 |
onError:[:exitStatus | ^ false]. |
|
1372 |
outStream size |
|
1373 |
" |
|
1374 |
||
1375 |
" |
|
1376 |
|outStream errStream| |
|
1377 |
||
1378 |
outStream := '' writeStream. |
|
1379 |
||
1380 |
OperatingSystem executeCommand:'gpg -s --batch --no-tty --passphrase-fd 0 /tmp/passwd' |
|
1381 |
inputFrom:'bla' readStream |
|
1382 |
outputTo:outStream |
|
1383 |
errorTo:nil |
|
1384 |
inDirectory:nil |
|
1385 |
lineWise:true |
|
1386 |
onError:[:exitStatus | false]. |
|
1387 |
outStream contents |
|
10387 | 1388 |
" |
1389 |
||
1390 |
"Modified: / 11-02-2007 / 20:54:39 / cg" |
|
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1391 |
! |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
1392 |
|
8669 | 1393 |
executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream errorTo:anErrStream auxFrom:anAuxStream inDirectory:dirOrNil lineWise:lineWise onError:aBlock |
1394 |
^ self |
|
17910 | 1395 |
executeCommand:aCommandString |
1396 |
inputFrom:anInStream |
|
1397 |
outputTo:anOutStream |
|
1398 |
errorTo:anErrStream |
|
1399 |
auxFrom:anAuxStream |
|
1400 |
environment:nil |
|
1401 |
inDirectory:dirOrNil |
|
1402 |
lineWise:lineWise |
|
1403 |
onError:aBlock |
|
7110
808437ea66af
add: #executeCommand:inputFrom:outputTo:errorTo:auxFrom:inDirectory:lineWise:onError:
ca
parents:
7106
diff
changeset
|
1404 |
! |
808437ea66af
add: #executeCommand:inputFrom:outputTo:errorTo:auxFrom:inDirectory:lineWise:onError:
ca
parents:
7106
diff
changeset
|
1405 |
|
8655 | 1406 |
executeCommand:aCommandString inputFrom:inputStreamOrNil outputTo:outStreamOrNil errorTo:errStreamOrNil inDirectory:aDirectory |
1407 |
"much like #executeCommand:, but changes the current directory |
|
1408 |
for the command. Since this is OS specific, use this instead of |
|
1409 |
hardwiring any 'cd ..' command strings into your applictions." |
|
1410 |
||
1411 |
^ self |
|
17910 | 1412 |
executeCommand:aCommandString |
1413 |
inputFrom:inputStreamOrNil |
|
1414 |
outputTo:outStreamOrNil |
|
1415 |
errorTo:errStreamOrNil |
|
1416 |
auxFrom:nil |
|
1417 |
inDirectory:aDirectory |
|
1418 |
lineWise:false |
|
1419 |
onError:[:status| false] |
|
8669 | 1420 |
|
1421 |
" |
|
1422 |
OperatingSystem executeCommand:'tdump date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
|
1423 |
OperatingSystem executeCommand:'xxdir date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
|
1424 |
OperatingSystem executeCommand:'dir' inDirectory:'c:\'. |
|
1425 |
OperatingSystem executeCommand:'dir' |
|
8655 | 1426 |
" |
1427 |
||
1428 |
"Modified: / 20.1.1998 / 17:03:03 / md" |
|
1429 |
"Modified: / 10.11.1998 / 20:28:10 / cg" |
|
1430 |
"Created: / 10.11.1998 / 21:05:45 / cg" |
|
1431 |
! |
|
1432 |
||
8669 | 1433 |
executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream errorTo:anErrStream inDirectory:dirOrNil lineWise:lineWise onError:aBlock |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1434 |
"execute the unix command specified by the argument, aCommandString. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1435 |
The commandString is passed to a shell for execution - see the description of |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1436 |
'sh -c' in your UNIX manual. |
7119 | 1437 |
Return true if successful, the value from aBlock if not. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1438 |
If not successfull, aBlock is called with an OsProcessStatus |
4847 | 1439 |
(containing the exit status) as argument. |
1440 |
The given in, out and err streams may be arbitrary (Smalltalk-) streams; |
|
1441 |
if any is not an external stream (which is required by the command), |
|
1442 |
extra pipes and shuffler processes are created, which stuff the data into |
|
1443 |
those internal stream(s). |
|
7059 | 1444 |
Nil stream args will execute the command connected to ST/X's standard input, output or |
1445 |
error resp. - i.e. usually, i/o will be from/to the terminal" |
|
6610 | 1446 |
|
7119 | 1447 |
^ self |
17910 | 1448 |
executeCommand:aCommandString |
1449 |
inputFrom:anInStream |
|
1450 |
outputTo:anOutStream |
|
1451 |
errorTo:anErrStream |
|
1452 |
auxFrom:nil |
|
1453 |
inDirectory:dirOrNil |
|
1454 |
lineWise:lineWise |
|
1455 |
onError:aBlock |
|
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1456 |
! |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1457 |
|
6162 | 1458 |
executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream errorTo:anErrStream inDirectory:dirOrNil onError:aBlock |
1459 |
"execute the unix command specified by the argument, aCommandString. |
|
1460 |
The commandString is passed to a shell for execution - see the description of |
|
1461 |
'sh -c' in your UNIX manual. |
|
7119 | 1462 |
Return true if successful, the value from aBlock if not. |
6162 | 1463 |
If not successfull, aBlock is called with an OsProcessStatus |
1464 |
(containing the exit status) as argument. |
|
1465 |
The given in, out and err streams may be arbitrary (Smalltalk-) streams; |
|
1466 |
if any is not an external stream (which is required by the command), |
|
1467 |
extra pipes and shuffler processes are created, which stuff the data into |
|
1468 |
those internal stream(s). |
|
1469 |
Nil stream args will execute the command connected to ST/X's input, output or |
|
8669 | 1470 |
error resp. - i.e. i/o will be from/to the xterminal" |
1471 |
||
1472 |
^ self |
|
17910 | 1473 |
executeCommand:aCommandString |
1474 |
inputFrom:anInStream |
|
1475 |
outputTo:anOutStream |
|
1476 |
errorTo:anErrStream |
|
1477 |
auxFrom:nil |
|
1478 |
inDirectory:dirOrNil |
|
1479 |
lineWise:false |
|
1480 |
onError:aBlock |
|
6162 | 1481 |
|
1482 |
" |
|
1483 |
OperatingSystem |
|
17910 | 1484 |
executeCommand:'dir' |
1485 |
inputFrom:nil |
|
1486 |
outputTo:nil |
|
1487 |
errorTo:nil |
|
1488 |
inDirectory:'c:' |
|
1489 |
onError:[:status | Transcript flash] |
|
6162 | 1490 |
|
1491 |
OperatingSystem |
|
17910 | 1492 |
executeCommand:'foo' |
1493 |
inputFrom:nil |
|
1494 |
outputTo:nil |
|
1495 |
errorTo:nil |
|
1496 |
inDirectory:'/etc' |
|
1497 |
onError:[:status | Transcript flash] |
|
6162 | 1498 |
|
1499 |
|s| |
|
1500 |
s := '' writeStream. |
|
1501 |
OperatingSystem |
|
17910 | 1502 |
executeCommand:'ls -l' |
1503 |
inputFrom:nil |
|
1504 |
outputTo:s |
|
1505 |
errorTo:nil |
|
1506 |
onError:[:status | Transcript flash]. |
|
6162 | 1507 |
Transcript showCR:s contents. |
1508 |
||
1509 |
|s| |
|
1510 |
s := '' writeStream. |
|
1511 |
OperatingSystem |
|
17910 | 1512 |
executeCommand:'sh foo' |
1513 |
inputFrom:nil |
|
1514 |
outputTo:s |
|
1515 |
errorTo:s |
|
1516 |
onError:[:status | Transcript flash]. |
|
6162 | 1517 |
Transcript showCR:s contents. |
1518 |
" |
|
1519 |
||
1520 |
"Modified: / 25.3.1997 / 11:02:02 / stefan" |
|
1521 |
"Modified: / 28.1.1998 / 14:46:36 / md" |
|
1522 |
"Modified: / 10.11.1998 / 20:48:08 / cg" |
|
1523 |
"Created: / 10.11.1998 / 20:51:11 / cg" |
|
1524 |
! |
|
1525 |
||
6610 | 1526 |
executeCommand:aCommandString inputFrom:anInStream outputTo:anOutStream errorTo:anErrStream onError:aBlock |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1527 |
"execute the unix command specified by the argument, aCommandString. |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1528 |
The commandString is passed to a shell for execution - see the description of |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1529 |
'sh -c' in your UNIX manual. |
7119 | 1530 |
Return true if successful, the value from aBlock if not. |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1531 |
If not successfull, aBlock is called with an OsProcessStatus |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1532 |
(containing the exit status) as argument." |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1533 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1534 |
^ self |
17910 | 1535 |
executeCommand:aCommandString |
1536 |
inputFrom:anInStream |
|
1537 |
outputTo:anOutStream |
|
1538 |
errorTo:anErrStream |
|
1539 |
auxFrom:nil |
|
1540 |
inDirectory:nil |
|
1541 |
lineWise:false |
|
1542 |
onError:aBlock |
|
1543 |
||
1544 |
" |
|
1545 |
OperatingSystem |
|
1546 |
executeCommand:'dir' |
|
1547 |
inputFrom:nil |
|
1548 |
outputTo:nil |
|
1549 |
errorTo:nil |
|
1550 |
onError:[:status | Transcript flash] |
|
1551 |
||
1552 |
OperatingSystem |
|
1553 |
executeCommand:'foo' |
|
1554 |
inputFrom:nil |
|
1555 |
outputTo:nil |
|
1556 |
errorTo:nil |
|
1557 |
onError:[:status | Transcript flash] |
|
1558 |
" |
|
1559 |
" |
|
1560 |
|outStr errStr| |
|
1561 |
||
1562 |
outStr := '' writeStream. |
|
1563 |
errStr := '' writeStream. |
|
1564 |
OperatingSystem |
|
1565 |
executeCommand:'ls' |
|
1566 |
inputFrom:nil |
|
1567 |
outputTo:outStr |
|
1568 |
errorTo:errStr |
|
1569 |
onError:[:status | Transcript flash]. |
|
1570 |
Transcript show:'out:'; showCR:outStr contents. |
|
1571 |
Transcript show:'err:'; showCR:errStr contents. |
|
1572 |
" |
|
1573 |
" |
|
1574 |
|outStr errStr| |
|
1575 |
||
1576 |
outStr := '' writeStream. |
|
1577 |
errStr := '' writeStream. |
|
1578 |
OperatingSystem |
|
1579 |
executeCommand:'ls /fooBar' |
|
1580 |
inputFrom:nil |
|
1581 |
outputTo:outStr |
|
1582 |
errorTo:errStr |
|
1583 |
onError:[:status | Transcript flash]. |
|
1584 |
Transcript show:'out:'; showCR:outStr contents. |
|
1585 |
Transcript show:'err:'; showCR:errStr contents. |
|
6610 | 1586 |
" |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1587 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1588 |
"Modified: / 10.11.1998 / 20:51:39 / cg" |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1589 |
! |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1590 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1591 |
executeCommand:aCommandString onError:aBlock |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1592 |
"execute the unix command specified by the argument, aCommandString. |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1593 |
The commandString is passed to a shell for execution - see the description of |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1594 |
'sh -c' in your UNIX manual. |
7119 | 1595 |
Return true if successful, the value from aBlock if not. |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1596 |
If not successfull, aBlock is called with an OsProcessStatus |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1597 |
(containing the exit status) as argument." |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1598 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1599 |
^ self |
17910 | 1600 |
executeCommand:aCommandString |
1601 |
inputFrom:nil |
|
1602 |
outputTo:nil |
|
1603 |
errorTo:nil |
|
1604 |
auxFrom:nil |
|
1605 |
inDirectory:nil |
|
1606 |
lineWise:false |
|
1607 |
onError:aBlock |
|
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1608 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1609 |
"unix: |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1610 |
|
8669 | 1611 |
OperatingSystem executeCommand:'sleep 30' onError:[]. |
1612 |
OperatingSystem executeCommand:'pwd' onError:[:status|status inspect]. |
|
1613 |
OperatingSystem executeCommand:'ls -l' onError:[]. |
|
1614 |
OperatingSystem executeCommand:'invalidCommand' onError:[:status| status inspect]. |
|
1615 |
OperatingSystem executeCommand:'rm /tmp/foofoofoofoo'onError:[:status | status inspect]. |
|
1616 |
||
1617 |
OperatingSystem executeCommand:'dir' onError:[]. |
|
1618 |
OperatingSystem executeCommand:'foo' onError:[]. |
|
1619 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1620 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1621 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1622 |
"Modified: / 25.3.1997 / 11:06:43 / stefan" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1623 |
"Modified: / 28.1.1998 / 14:46:56 / md" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1624 |
"Created: / 5.6.1998 / 19:02:09 / cg" |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1625 |
"Modified: / 10.11.1998 / 20:55:02 / cg" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1626 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1627 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1628 |
executeCommand:aCommandString onError:aBlock inDirectory:aDirectory |
7119 | 1629 |
"OBSOLETE for backward compatibility. |
1630 |
execute the unix command specified by the argument, aCommandString. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1631 |
The commandString is passed to a shell for execution - see the description of |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1632 |
'sh -c' in your UNIX manual. |
7119 | 1633 |
Return true if successful, the value from aBlock if not. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1634 |
If not successfull, aBlock is called with an OsProcessStatus |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1635 |
(containing the exit status) as argument." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1636 |
|
5861 | 1637 |
<resource:#obsolete> |
1638 |
||
4849 | 1639 |
self obsoleteMethodWarning:'use executeCommand:inDirectory:onError:'. |
1640 |
||
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1641 |
^ self |
17910 | 1642 |
executeCommand:aCommandString |
1643 |
inputFrom:nil |
|
1644 |
outputTo:nil |
|
1645 |
errorTo:nil |
|
1646 |
auxFrom:nil |
|
1647 |
inDirectory:aDirectory |
|
1648 |
lineWise:false |
|
1649 |
onError:aBlock |
|
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1650 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3901
diff
changeset
|
1651 |
"Modified: / 10.11.1998 / 20:54:37 / cg" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1652 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1653 |
|
7119 | 1654 |
executeCommand:aCommandString outputTo:anOutStreamOrNil |
1655 |
"execute the unix command specified by the argument, aCommandString. |
|
1656 |
The commandString is passed to a shell for execution - see the description of |
|
1657 |
'sh -c' in your UNIX manual. |
|
1658 |
Return true if successful, false otherwise." |
|
1659 |
||
1660 |
^ self |
|
17910 | 1661 |
executeCommand:aCommandString |
1662 |
inputFrom:nil |
|
1663 |
outputTo:anOutStreamOrNil |
|
1664 |
errorTo:nil |
|
1665 |
auxFrom:nil |
|
1666 |
inDirectory:nil |
|
1667 |
lineWise:false |
|
1668 |
onError:[:status| false] |
|
7119 | 1669 |
|
1670 |
" |
|
8669 | 1671 |
String streamContents:[:s|OperatingSystem |
17910 | 1672 |
executeCommand:'ls' |
1673 |
outputTo:s |
|
7119 | 1674 |
] |
1675 |
" |
|
1676 |
||
1677 |
" |
|
8669 | 1678 |
String streamContents:[:s|OperatingSystem |
17910 | 1679 |
executeCommand:'pwd' |
1680 |
outputTo:s |
|
8669 | 1681 |
] |
7119 | 1682 |
" |
1683 |
! |
|
1684 |
||
4849 | 1685 |
executeCommand:aCommandString outputTo:outStreamOrNil errorTo:errStreamOrNil inDirectory:aDirectory |
1686 |
"much like #executeCommand:, but changes the current directory |
|
1687 |
for the command. Since this is OS specific, use this instead of |
|
1688 |
hardwiring any 'cd ..' command strings into your applictions." |
|
1689 |
||
1690 |
^ self |
|
17910 | 1691 |
executeCommand:aCommandString |
1692 |
inputFrom:nil |
|
1693 |
outputTo:outStreamOrNil |
|
1694 |
errorTo:errStreamOrNil |
|
1695 |
auxFrom:nil |
|
1696 |
inDirectory:aDirectory |
|
1697 |
lineWise:false |
|
1698 |
onError:[:status| false] |
|
4849 | 1699 |
|
1700 |
" |
|
8669 | 1701 |
OperatingSystem executeCommand:'tdump date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
1702 |
OperatingSystem executeCommand:'xxdir date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
|
1703 |
OperatingSystem executeCommand:'dir' inDirectory:'c:\'. |
|
1704 |
OperatingSystem executeCommand:'dir' |
|
4849 | 1705 |
" |
1706 |
||
1707 |
"Modified: / 20.1.1998 / 17:03:03 / md" |
|
1708 |
"Modified: / 10.11.1998 / 20:28:10 / cg" |
|
1709 |
"Created: / 10.11.1998 / 21:05:45 / cg" |
|
1710 |
! |
|
1711 |
||
17921 | 1712 |
executeCommand:aCommandString outputTo:outStreamOrNil inDirectory:aDirectory |
1713 |
"much like #executeCommand:, but changes the current directory |
|
1714 |
for the command. Since this is OS specific, use this instead of |
|
1715 |
hardwiring any 'cd ..' command strings into your applictions." |
|
1716 |
||
1717 |
^ self |
|
1718 |
executeCommand:aCommandString |
|
1719 |
inputFrom:nil |
|
1720 |
outputTo:outStreamOrNil |
|
1721 |
errorTo:nil |
|
1722 |
auxFrom:nil |
|
1723 |
inDirectory:aDirectory |
|
1724 |
lineWise:false |
|
1725 |
onError:[:status| false] |
|
1726 |
||
1727 |
" |
|
1728 |
OperatingSystem executeCommand:'tdump date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
|
1729 |
OperatingSystem executeCommand:'xxdir date.obj' inDirectory:'c:\winstx\stx\libbasic\objbc'. |
|
1730 |
OperatingSystem executeCommand:'dir' inDirectory:'c:\'. |
|
1731 |
OperatingSystem executeCommand:'dir' |
|
1732 |
" |
|
1733 |
||
1734 |
"Modified: / 20-01-1998 / 17:03:03 / md" |
|
1735 |
"Created: / 23-01-2012 / 14:07:50 / cg" |
|
1736 |
! |
|
1737 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1738 |
getCommandOutputFrom:aCommand |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1739 |
"execute a simple command (such as hostname) and |
5482 | 1740 |
return the commands first line of output as a string (forget stdErr). |
4204 | 1741 |
If the command generates multiple output lines, only the first line is returned. |
1742 |
If the commands does not generate any output, an empty string is returned; |
|
1743 |
if the command fails, nil is returned." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1744 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1745 |
|result| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1746 |
|
5482 | 1747 |
result := self getCommandOutputFrom:aCommand maxNumberOfLines:1 errorDisposition:#discard. |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1748 |
result notNil ifTrue:[ |
17910 | 1749 |
^ result firstIfEmpty:[''] |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1750 |
]. |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1751 |
^ result |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1752 |
|
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1753 |
" |
8669 | 1754 |
OperatingSystem getCommandOutputFrom:'hostname' |
1755 |
OperatingSystem getCommandOutputFrom:'pwd' |
|
1756 |
OperatingSystem getCommandOutputFrom:'sleep 1' |
|
1757 |
OperatingSystem getCommandOutputFrom:'foo' |
|
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1758 |
" |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1759 |
|
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1760 |
! |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1761 |
|
5482 | 1762 |
getCommandOutputFrom:aCommand maxNumberOfLines:numLinesOrNil errorDisposition:errorDisposition |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1763 |
"execute a simple command (such as hostname) and |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1764 |
return the commands output as a collection of strings, |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1765 |
but only up to the given number of lines (if non-nil). |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1766 |
If the command generates more output, only the first nLines are returned |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1767 |
(but the command is allowed to finish execution). |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1768 |
If the commands does not generate any output, an empty string is returned; |
5482 | 1769 |
if the command fails, nil is returned. |
1770 |
errorDisposition controls where the stdErr output should go, |
|
1771 |
and may be one of #discard, #inline or #stderr (default). |
|
8669 | 1772 |
#discard causes stderr to be discarded (/dev/null), |
5482 | 1773 |
#inline causes it to be written to smalltalks own stdout and |
1774 |
#stderr causes it to be written to smalltalks own stderr. |
|
1775 |
Nil is treated like #stderr" |
|
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1776 |
|
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1777 |
|result| |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1778 |
|
4200 | 1779 |
PipeFailed ~~ true ifTrue:[ |
17910 | 1780 |
PipeStream openErrorSignal handle:[:ex | |
1781 |
PipeFailed := true. |
|
1782 |
'OperatingSystem [warning]: cannot fork/popen' errorPrintCR. |
|
1783 |
ex return. |
|
1784 |
] do:[ |
|
1785 |
|p line| |
|
1786 |
||
1787 |
p := PipeStream |
|
1788 |
readingFrom:aCommand |
|
1789 |
errorDisposition:errorDisposition |
|
1790 |
inDirectory:nil. |
|
1791 |
result := StringCollection new. |
|
1792 |
[p atEnd] whileFalse:[ |
|
1793 |
line := p nextLine. |
|
1794 |
(numLinesOrNil isNil |
|
1795 |
or:[result size < numLinesOrNil]) ifTrue:[ |
|
1796 |
result add:line |
|
1797 |
]. |
|
1798 |
]. |
|
1799 |
p close. |
|
1800 |
(p exitStatus notNil |
|
1801 |
and:[p exitStatus success]) ifFalse:[ |
|
1802 |
result isEmpty ifTrue:[ |
|
1803 |
result := nil |
|
1804 |
] |
|
1805 |
]. |
|
1806 |
]. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1807 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1808 |
^ result |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1809 |
|
4204 | 1810 |
" |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1811 |
OperatingSystem getCommandOutputFrom:'ls' maxNumberOfLines:1 |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1812 |
OperatingSystem getCommandOutputFrom:'ls' maxNumberOfLines:10 |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1813 |
OperatingSystem getCommandOutputFrom:'ls' maxNumberOfLines:nil |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1814 |
OperatingSystem getCommandOutputFrom:'foo' maxNumberOfLines:nil |
4204 | 1815 |
" |
1816 |
||
1817 |
"Modified: / 19.5.1999 / 14:25:02 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1818 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1819 |
|
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1820 |
getFullCommandOutputFrom:aCommand |
5482 | 1821 |
"execute a command and |
5483 | 1822 |
return the commands output as a collection of strings (ignoring stdErr). |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1823 |
If the commands does not generate any output, an empty string is returned; |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1824 |
if the command fails, nil is returned." |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1825 |
|
5483 | 1826 |
^ self getCommandOutputFrom:aCommand maxNumberOfLines:nil errorDisposition:#discard |
5480
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1827 |
|
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1828 |
" |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1829 |
OperatingSystem getFullCommandOutputFrom:'mt status' |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1830 |
" |
92eb8594f437
better getCommandOutputFrom:
Claus Gittinger <cg@exept.de>
parents:
5429
diff
changeset
|
1831 |
|
8587 | 1832 |
! ! |
1833 |
||
1834 |
!AbstractOperatingSystem class methodsFor:'executing OS commands-queries'! |
|
1835 |
||
1836 |
canExecuteCommand:aCommandString |
|
1837 |
"return true, if the OS can execute aCommand. |
|
1838 |
For now, this only works with UNIX." |
|
1839 |
||
1840 |
|fn fullPath| |
|
1841 |
||
1842 |
fullPath := (self pathOfCommand:aCommandString). |
|
1843 |
fullPath isNil ifTrue:[^ false]. |
|
1844 |
fn := fullPath asFilename. |
|
1845 |
^ fn exists and:[fn isExecutableProgram]. |
|
1846 |
||
1847 |
" |
|
8669 | 1848 |
OperatingSystem canExecuteCommand:'fooBar' |
1849 |
OperatingSystem canExecuteCommand:'ls' |
|
17910 | 1850 |
OperatingSystem canExecuteCommand:'cvs' |
1851 |
OperatingSystem canExecuteCommand:'diff' |
|
1852 |
OperatingSystem canExecuteCommand:'cvs.exe' |
|
17912 | 1853 |
OperatingSystem canExecuteCommand:'hg' |
1854 |
OperatingSystem pathOfCommand:'hg' |
|
1855 |
" |
|
1856 |
||
1857 |
"Created: / 04-11-1995 / 19:13:54 / cg" |
|
8587 | 1858 |
! |
1859 |
||
1860 |
commandAndArgsForOSCommand:aCommandString |
|
1861 |
"get a shell and shell arguments for command execution" |
|
1862 |
||
1863 |
self subclassResponsibility |
|
1864 |
! |
|
1865 |
||
1866 |
executableFileExtensions |
|
1867 |
"return a collection of extensions for executable program files. |
|
1868 |
Only req'd for msdos & vms like systems ..." |
|
1869 |
||
1870 |
^ #('') |
|
1871 |
||
1872 |
"Created: 2.5.1997 / 11:42:29 / cg" |
|
1873 |
! |
|
1874 |
||
1875 |
nameOfSTXExecutable |
|
1876 |
"return the name of the running ST/X executable program. |
|
1877 |
Usually, 'stx' is returned - |
|
1878 |
but may be different for standAlone apps (or winstx.exe)." |
|
1879 |
||
1880 |
%{ |
|
1881 |
extern char *__stxExecutableName__(); |
|
1882 |
||
1883 |
RETURN (__MKSTRING(__stxExecutableName__())); |
|
1884 |
%} |
|
1885 |
" |
|
1886 |
OperatingSystem nameOfSTXExecutable |
|
1887 |
" |
|
1888 |
! |
|
1889 |
||
1890 |
pathOfCommand:aCommand |
|
1891 |
"find where aCommand's executable file is; |
|
1892 |
return its full pathName if there is such a command, otherwise |
|
1893 |
return nil." |
|
1894 |
||
1895 |
^ self subclassResponsibility |
|
1896 |
! |
|
1897 |
||
1898 |
pathOfSTXExecutable |
|
1899 |
"return the full path of the running ST/X executable program. |
|
8669 | 1900 |
Usually, '.../stx' is returned - |
8587 | 1901 |
but may be different for standAlone apps (or winstx.exe)." |
1902 |
||
17912 | 1903 |
|path| |
1904 |
||
1905 |
path := self pathOfCommand:(self nameOfSTXExecutable). |
|
1906 |
self assert:(path notNil). |
|
1907 |
^ path |
|
8587 | 1908 |
|
1909 |
" |
|
1910 |
OperatingSystem pathOfSTXExecutable |
|
1911 |
" |
|
17912 | 1912 |
|
1913 |
"Modified: / 20-01-2012 / 12:52:46 / cg" |
|
8587 | 1914 |
! ! |
1915 |
||
1916 |
!AbstractOperatingSystem class methodsFor:'executing OS commands-wrappers'! |
|
1917 |
||
1918 |
exec:aCommandPath withArguments:argArray |
|
1919 |
"execute the OS command specified by the argument, aCommandPath, with |
|
1920 |
arguments in argArray (no arguments, if nil). |
|
1921 |
If successful, this method does NOT return and smalltalk is gone. |
|
8669 | 1922 |
If not successful, it does return. |
8587 | 1923 |
Can be used on UNIX with fork or on other systems to chain to another program." |
7656 | 1924 |
|
8669 | 1925 |
^ self |
17910 | 1926 |
exec:aCommandPath |
1927 |
withArguments:argArray |
|
1928 |
environment:nil |
|
1929 |
fileDescriptors:#(0 1 2) |
|
1930 |
fork:false |
|
1931 |
newPgrp:false |
|
1932 |
inDirectory:nil |
|
8587 | 1933 |
|
1934 |
"/ never reached ... |
|
1935 |
||
1936 |
"Modified: / 12.11.1998 / 14:44:26 / cg" |
|
1937 |
! |
|
1938 |
||
1939 |
exec:aCommandPath withArguments:argArray fileDescriptors:fileDescriptors fork:doFork newPgrp:newPgrp inDirectory:aDirectory |
|
8669 | 1940 |
^ self |
17910 | 1941 |
exec:aCommandPath |
1942 |
withArguments:argArray |
|
1943 |
environment:nil |
|
1944 |
fileDescriptors:fileDescriptors |
|
1945 |
fork:doFork |
|
1946 |
newPgrp:newPgrp |
|
1947 |
inDirectory:aDirectory |
|
8587 | 1948 |
! |
1949 |
||
1950 |
exec:aCommandPath withArguments:argArray fork:doFork |
|
1951 |
"execute an OS command without I/O redirection. |
|
1952 |
The command reads its input and writes its output |
|
1953 |
from/to whatever terminal device ST/X was started |
|
1954 |
(typically, the terminal window)" |
|
1955 |
||
8669 | 1956 |
^ self |
17910 | 1957 |
exec:aCommandPath |
1958 |
withArguments:argArray |
|
1959 |
environment:nil |
|
1960 |
fileDescriptors:#(0 1 2) |
|
1961 |
fork:doFork |
|
1962 |
newPgrp:false |
|
1963 |
inDirectory:nil |
|
8587 | 1964 |
|
1965 |
" |
|
1966 |
|id| |
|
1967 |
||
1968 |
id := OperatingSystem fork. |
|
1969 |
id == 0 ifTrue:[ |
|
17910 | 1970 |
'I am the child'. |
1971 |
OperatingSystem |
|
1972 |
exec:'/bin/ls' |
|
1973 |
withArguments:#('ls' '/tmp') |
|
1974 |
fork:false. |
|
1975 |
'not reached'. |
|
8587 | 1976 |
] |
1977 |
" |
|
1978 |
||
1979 |
" |
|
1980 |
|id| |
|
1981 |
||
1982 |
id := OperatingSystem fork. |
|
1983 |
id == 0 ifTrue:[ |
|
17910 | 1984 |
'I am the child'. |
1985 |
OperatingSystem |
|
1986 |
exec:'/bin/sh' |
|
1987 |
withArguments:#('sh' '-c' 'sleep 2;echo 1;sleep 2;echo 2') |
|
1988 |
fork:false. |
|
1989 |
'not reached'. |
|
8587 | 1990 |
]. |
1991 |
id printNL. |
|
1992 |
(Delay forSeconds:3.5) wait. |
|
1993 |
'killing ...' printNL. |
|
1994 |
OperatingSystem sendSignal:(OperatingSystem sigTERM) to:id. |
|
1995 |
OperatingSystem sendSignal:(OperatingSystem sigKILL) to:id |
|
1996 |
" |
|
1997 |
||
1998 |
"Modified: / 15.7.1997 / 15:54:32 / stefan" |
|
1999 |
"Modified: / 12.11.1998 / 14:44:46 / cg" |
|
2000 |
! |
|
2001 |
||
2002 |
exec:aCommandPath withArguments:argArray fork:doFork inDirectory:aDirectory |
|
2003 |
"execute an OS command without I/O redirection. |
|
2004 |
The command reads its input and writes its output |
|
2005 |
from/to whatever terminal device ST/X was started |
|
2006 |
(typically, the terminal window)" |
|
2007 |
||
8669 | 2008 |
^ self |
17910 | 2009 |
exec:aCommandPath |
2010 |
withArguments:argArray |
|
2011 |
environment:nil |
|
2012 |
fileDescriptors:#(0 1 2) |
|
2013 |
fork:doFork |
|
2014 |
newPgrp:false |
|
2015 |
inDirectory:aDirectory |
|
8587 | 2016 |
|
2017 |
" |
|
2018 |
|id| |
|
2019 |
||
2020 |
id := OperatingSystem fork. |
|
2021 |
id == 0 ifTrue:[ |
|
17910 | 2022 |
'I am the child'. |
2023 |
OperatingSystem |
|
2024 |
exec:'/bin/ls' |
|
2025 |
withArguments:#('ls' '/tmp') |
|
2026 |
fork:false. |
|
2027 |
'not reached'. |
|
8587 | 2028 |
] |
2029 |
" |
|
2030 |
||
2031 |
" |
|
2032 |
|id| |
|
2033 |
||
2034 |
id := OperatingSystem fork. |
|
2035 |
id == 0 ifTrue:[ |
|
17910 | 2036 |
'I am the child'. |
2037 |
OperatingSystem |
|
2038 |
exec:'/bin/sh' |
|
2039 |
withArguments:#('sh' '-c' 'sleep 2;echo 1;sleep 2;echo 2') |
|
2040 |
fork:false. |
|
2041 |
'not reached'. |
|
8587 | 2042 |
]. |
2043 |
id printNL. |
|
2044 |
(Delay forSeconds:3.5) wait. |
|
2045 |
'killing ...' printNL. |
|
2046 |
OperatingSystem sendSignal:(OperatingSystem sigTERM) to:id. |
|
2047 |
OperatingSystem sendSignal:(OperatingSystem sigKILL) to:id |
|
2048 |
" |
|
2049 |
||
2050 |
"Created: / 28.1.1998 / 14:14:03 / md" |
|
2051 |
"Modified: / 28.1.1998 / 14:14:45 / md" |
|
2052 |
"Modified: / 12.11.1998 / 14:45:06 / cg" |
|
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
2053 |
! ! |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
2054 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2055 |
!AbstractOperatingSystem class methodsFor:'file access'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2056 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2057 |
closeFd:anInteger |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2058 |
"low level close of a filedescriptor" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2059 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2060 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2061 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2062 |
|
7699 | 2063 |
copyFromFd:inFd toFd:outFd startIndex:startIdx count:count |
2064 |
"directly copy from one FD to another (if supported by the OS)" |
|
2065 |
||
2066 |
^ 0 "/ not supported |
|
2067 |
! |
|
2068 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2069 |
createDirectory:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2070 |
"create a new directory with name 'aPathName', which may be an absolute |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2071 |
path, or relative to the current directory. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2072 |
Return true if successful (or the directory existed already), false if failed. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2073 |
This is a low-level entry - use Filename protocol for compatibility." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2074 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2075 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2076 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2077 |
|
6292 | 2078 |
createFileForReadAppend:pathName |
2079 |
self subclassResponsibility |
|
2080 |
! |
|
2081 |
||
2082 |
createFileForReadWrite:pathName |
|
2083 |
self subclassResponsibility |
|
2084 |
! |
|
2085 |
||
3758
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2086 |
createHardLinkFrom:oldPath to:newPath |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2087 |
"link the file 'oldPath' to 'newPath'. The link will be a hard link. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2088 |
Return true if successful, false if not." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2089 |
|
3758
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2090 |
"/ |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2091 |
"/ assume that this OperatingSystem does not support links |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2092 |
"/ |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2093 |
^ UnsupportedOperationSignal raise |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2094 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2095 |
"Created: / 13.8.1998 / 21:37:12 / cg" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2096 |
"Modified: / 13.8.1998 / 21:38:39 / cg" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2097 |
! |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2098 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2099 |
createSymbolicLinkFrom:oldPath to:newPath |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2100 |
"make a link from the file 'oldPath' to the file 'newPath'. |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2101 |
The link will be a soft (symbolic) link. |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2102 |
Return true if successful, false if not." |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2103 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2104 |
"/ |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2105 |
"/ assume that this OperatingSystem does not support symbolic links |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2106 |
"/ |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2107 |
^ UnsupportedOperationSignal raise |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2108 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2109 |
"Created: / 13.8.1998 / 21:38:24 / cg" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2110 |
"Modified: / 13.8.1998 / 21:38:43 / cg" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2111 |
! |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2112 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2113 |
linkFile:oldPath to:newPath |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2114 |
"link the file 'oldPath' to 'newPath'. The link will be a hard link. |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2115 |
Return true if successful, false if not. |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2116 |
This method has been renamed - it remains in existance for |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2117 |
backward compatibility." |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2118 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2119 |
^ self createHardLinkFrom:oldPath to:newPath |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2120 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2121 |
" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2122 |
OperatingSystem linkFile:'foo' to:'bar' |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2123 |
" |
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2124 |
|
1cc926a7b2a6
added #createSymbolicLinkFrom:to:
Claus Gittinger <cg@exept.de>
parents:
3736
diff
changeset
|
2125 |
"Modified: / 13.8.1998 / 21:37:24 / cg" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2126 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2127 |
|
6292 | 2128 |
openFileForAppend:pathName |
2129 |
self subclassResponsibility |
|
2130 |
! |
|
2131 |
||
2132 |
openFileForRead:pathName |
|
2133 |
self subclassResponsibility |
|
2134 |
! |
|
2135 |
||
2136 |
openFileForReadAppend:pathName |
|
2137 |
self subclassResponsibility |
|
2138 |
! |
|
2139 |
||
2140 |
openFileForReadWrite:pathName |
|
2141 |
self subclassResponsibility |
|
2142 |
! |
|
2143 |
||
2144 |
openFileForWrite:pathName |
|
2145 |
self subclassResponsibility |
|
2146 |
! |
|
2147 |
||
4149 | 2148 |
recursiveCopyDirectory:fullPathName to:destinationPathName |
8669 | 2149 |
"copy the directory named 'fullPathName' and all contained |
4149 | 2150 |
files/directories recursively to destinationPathName. |
2151 |
Return true if successful. |
|
2152 |
Here, false is returned and the caller should be prepared |
|
2153 |
for a fallBack solution. |
|
8669 | 2154 |
Notice: |
17910 | 2155 |
this is not a public interface; instead, it is used |
2156 |
internally by the Filename class, to try a fast copy |
|
2157 |
before doing things manually. |
|
2158 |
Please use Filename recursiveCopyTo:" |
|
4149 | 2159 |
|
2160 |
^ false |
|
2161 |
||
2162 |
" |
|
2163 |
OperatingSystem recursiveCopyDirectory:'.' to:'/tmp/foo' |
|
2164 |
OperatingSystem recursiveRemoveDirectory:'/tmp/foo' |
|
2165 |
" |
|
2166 |
||
2167 |
"Modified: / 5.5.1999 / 13:29:16 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2168 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2169 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2170 |
recursiveCreateDirectory:dirName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2171 |
"create a directory - with all parent dirs if needed. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2172 |
Return true if successful, false otherwise. If false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2173 |
is returned, a partial created tree may be left, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2174 |
which is not cleaned-up here." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2175 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2176 |
self createDirectory:dirName. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2177 |
(self isDirectory:dirName) ifFalse:[ |
17910 | 2178 |
(self recursiveCreateDirectory:(dirName asFilename directoryName)) ifFalse:[^ false]. |
2179 |
^ self createDirectory:dirName |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2180 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2181 |
^ true |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2182 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2183 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2184 |
OperatingSystem recursiveCreateDirectory:'foo/bar/baz' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2185 |
OperatingSystem recursiveRemoveDirectory:'foo' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2186 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2187 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2188 |
"Modified: 7.3.1996 / 15:26:22 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2189 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2190 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2191 |
recursiveRemoveDirectory:fullPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2192 |
"remove the directory named 'fullPathName' and all contained files/directories. |
4149 | 2193 |
Return true if successful. |
2194 |
Here, false is returned and the caller should be prepared |
|
2195 |
for a fallBack solution. |
|
8669 | 2196 |
Notice: |
17910 | 2197 |
this is not a public interface; instead, it is used |
2198 |
internally by the Filename class, to try a fast remove |
|
2199 |
before doing things manually. |
|
2200 |
Please use Filename recursiveRemoveDirectory:" |
|
4149 | 2201 |
|
2202 |
^ false |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2203 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2204 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2205 |
OperatingSystem recursiveCreateDirectory:'foo/bar/baz' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2206 |
OperatingSystem recursiveRemoveDirectory:'foo' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2207 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2208 |
|
4149 | 2209 |
"Modified: / 5.5.1999 / 13:30:11 / cg" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2210 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2211 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2212 |
removeDirectory:fullPathName |
8669 | 2213 |
"remove the directory named 'fullPathName'. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2214 |
The directory must be empty and you must have appropriate access rights. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2215 |
Return true if successful, false if directory is not empty or no permission. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2216 |
This is a lowLevel entry - use Filename protocol for compatibility." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2217 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2218 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2219 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2220 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2221 |
removeFile:fullPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2222 |
"remove the file named 'fullPathName'; return true if successful. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2223 |
This is a lowLevel entry - use Filename protocol for compatibility." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2224 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2225 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2226 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2227 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2228 |
renameFile:oldPath to:newPath |
8669 | 2229 |
"rename the file 'oldPath' to 'newPath'. |
2230 |
Someone else has to care for the names to be correct and |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2231 |
correct for the OS used - therefore, this should not be called |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2232 |
directlt. Instead, use Filename protocol to rename; this cares for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2233 |
any invalid names. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2234 |
Returns true if successful, false if not" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2235 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2236 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2237 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2238 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2239 |
truncateFile:aPathName to:newSize |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2240 |
"change a files size return true on success, false on failure. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2241 |
This may not be supported on all architectures. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2242 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2243 |
This is a low-level entry - use Filename protocol." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2244 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2245 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2246 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2247 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2248 |
!AbstractOperatingSystem class methodsFor:'file access rights'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2249 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2250 |
accessMaskFor:aSymbol |
8669 | 2251 |
"return the access bits mask for numbers as returned by |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2252 |
OperatingSystem>>accessModeOf: |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2253 |
and expected by OperatingSystem>>changeAccessModeOf:to:. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2254 |
Since these numbers are OS dependent, always use the mask |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2255 |
(never hardcode 8rxxx into your code)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2256 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2257 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2258 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2259 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2260 |
accessModeOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2261 |
"return a number representing access rights rwxrwxrwx for owner, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2262 |
group and others. Return nil if such a file does not exist. |
8669 | 2263 |
Notice that the returned number is OS dependent - use the |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2264 |
modeMasks as returned by OperatingSystem>>accessMaskFor:" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2265 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2266 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2267 |
this could have been implemented as: |
17910 | 2268 |
(self infoOf:aPathName) at:#mode |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2269 |
but for huge directory searches the code below is faster |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2270 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2271 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2272 |
^ (self infoOf:aPathName) at:#mode |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2273 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2274 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2275 |
(OperatingSystem accessModeOf:'/') printStringRadix:8 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2276 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2277 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2278 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2279 |
changeAccessModeOf:aPathName to:modeBits |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2280 |
"change the access rights of aPathName to the OS dependent modeBits. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2281 |
You should construct this mask using accessMaskFor, to be OS |
8669 | 2282 |
independent. Return true if changed, |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2283 |
false if such a file does not exist or change was not allowd." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2284 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2285 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2286 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2287 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2288 |
!AbstractOperatingSystem class methodsFor:'file locking'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2289 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2290 |
lockFD:aFileDescriptor shared:isSharedReadLock blocking:blockIfLocked |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2291 |
"set a lock on the file represented by aFileDescriptor. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2292 |
(such as returned by ExternalStream>>fileDescriptor). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2293 |
On some systems, only advisory locks are available - |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2294 |
these depends on other accessors to also perform the locking operation. |
8669 | 2295 |
If they do not, they may still access the file |
2296 |
(on some systems, locks are mandatory, on others, they are advisory). |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2297 |
The isSharedReadLock argument (if true) specifies if multiple readers |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2298 |
are to be allowed - if false, they are not. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2299 |
On some systems, all locks are non-exclusive locks. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2300 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2301 |
Returns true, if the lock was aquired, false otherwise. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2302 |
|
8669 | 2303 |
Notice, that not all OS's support these locks; |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2304 |
on some, this may simply be a no-op. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2305 |
Also notice, that some systems block the process, to wait for the lock. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2306 |
This can (again: on some systems) be avoided by passing a false blockIfLocked |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2307 |
argument." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2308 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2309 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2310 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2311 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2312 |
supportsFileLinks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2313 |
"return true, if the OS supports file links (hard links). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2314 |
Typically, only unix returns true here." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2315 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2316 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2317 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2318 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2319 |
supportsFileLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2320 |
"return true, if the OS supports file locking" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2321 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2322 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2323 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2324 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2325 |
OperatingSystem supportsFileLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2326 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2327 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2328 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2329 |
supportsNonBlockingFileLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2330 |
"return true, if the OS supports nonBlocking file locking |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2331 |
(i.e. with immediate return instead of waiting for the lock)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2332 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2333 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2334 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2335 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2336 |
OperatingSystem supportsNonBlockingFileLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2337 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2338 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2339 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2340 |
supportsSharedLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2341 |
"return true, if the OS supports shared (i.e. multiple reader) |
4147 | 2342 |
file locking. Assume false here - redefined in concrete classes." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2343 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2344 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2345 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2346 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2347 |
OperatingSystem supportsNonBlockingFileLocks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2348 |
" |
4147 | 2349 |
|
2350 |
"Modified: / 5.5.1999 / 01:08:03 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2351 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2352 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2353 |
supportsSymbolicLinks |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2354 |
"return true, if the OS supports symbolic links on files/directories. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2355 |
Typically, only Unix returns true here" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2356 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2357 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2358 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2359 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2360 |
unlockFD:aFileDescriptor |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2361 |
"clear a file lock on the file represented by aFileDescriptor, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2362 |
which was previously aquired by #lockFD:. |
8669 | 2363 |
Return false, if the unlock failed |
2364 |
(which may happens when a wrong fd is passed, |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2365 |
no lock was set previously, or the systsem does not support locks). |
8669 | 2366 |
Notice, that not all OS's support file locks; |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2367 |
on some, this may simply be a no-op." |
8669 | 2368 |
|
3826 | 2369 |
^ false |
2370 |
||
2371 |
"Modified: / 10.9.1998 / 17:54:15 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2372 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2373 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2374 |
!AbstractOperatingSystem class methodsFor:'file queries'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2375 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2376 |
caseSensitiveFilenames |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2377 |
"return true, if the OS has caseSensitive file naming. |
8669 | 2378 |
On MSDOS, this will return false; |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2379 |
on a real OS, we return true." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2380 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2381 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2382 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2383 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2384 |
compressPath:pathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2385 |
"return the pathName compressed - that is, remove all ..-entries |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2386 |
and . entries. This does not always (in case of symbolic links) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2387 |
return the true pathName and is therefore used as a fallback |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2388 |
if realPath and popen failed." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2389 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2390 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2391 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2392 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2393 |
directoryNameOf:aPath |
5861 | 2394 |
<resource:#obsolete> |
2395 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2396 |
self obsoleteMethodWarning:'use asFilename directoryName'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2397 |
^ aPath asFilename directoryName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2398 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2399 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2400 |
fileSeparator |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2401 |
"return the character used to separate names in a path. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2402 |
This character differs for MSDOS and other systems, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2403 |
(but those are currently not supported - so this is some |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2404 |
preparation for the future)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2405 |
|
3736 | 2406 |
^ $/ "/ must be redefined for systems, where this is not true (i.e. MSDOS) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2407 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2408 |
|
17807 | 2409 |
getCurrentDirectory |
2410 |
"get the current directory of the ST/X OS process" |
|
2411 |
||
2412 |
^ self subclassResponsibility |
|
2413 |
! |
|
2414 |
||
4224
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2415 |
getDiskInfoOf:aDirectoryPath |
8669 | 2416 |
"return some disk info. |
4224
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2417 |
The amount of information returned depends upon the OS, and is |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2418 |
not guaranteed to be consistent across architectures. |
4226 | 2419 |
On unix and msdos, the information returned is (at least): |
17910 | 2420 |
freeBytes |
2421 |
totalBytes |
|
4224
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2422 |
Do not depend on any information being present in the returned dictionary; |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2423 |
users of this method should always use #at:ifAbsent:, and care for the absent case. |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2424 |
Nil is returned if no such information can be obtained. |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2425 |
" |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2426 |
|
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2427 |
^ nil |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2428 |
|
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2429 |
" |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2430 |
OperatingSystem getDiskInfoOf:'/' |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2431 |
OperatingSystem getDiskInfoOf:'.' |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2432 |
" |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2433 |
|
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2434 |
"Modified: / 22.5.1999 / 00:36:06 / cg" |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2435 |
! |
5ba55d46b2f4
added a portable interface to the df-command
Claus Gittinger <cg@exept.de>
parents:
4207
diff
changeset
|
2436 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2437 |
getDriveList |
8669 | 2438 |
"return a list of volumes in the system. |
2439 |
On unix, no such thing like a volume exists |
|
2440 |
- there, a syntetic list with root, home & current is returned. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2441 |
On MSDOS, a list of drive letters is (eventually) returned. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2442 |
On VMS, a list of volumes is (eventually) returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2443 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2444 |
"/ |
4146 | 2445 |
"/ default: return an array filled with |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2446 |
"/ root, home and current directories. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2447 |
"/ |
8669 | 2448 |
^ Array |
17910 | 2449 |
with:'/' |
2450 |
with:(self getHomeDirectory) |
|
2451 |
with:(Filename currentDirectory pathName) |
|
4146 | 2452 |
|
2453 |
"Modified: / 5.5.1999 / 01:06:26 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2454 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2455 |
|
4852 | 2456 |
getMountedVolumes |
8669 | 2457 |
"return info about mounted volumes. |
4852 | 2458 |
The amount of information returned depends upon the OS, and is |
2459 |
not guaranteed to be consistent across architectures. |
|
2460 |
On unix, the information returned is (at least): |
|
17910 | 2461 |
mountPoint - mount point |
2462 |
fileSystem - device or NFS-remotePath |
|
4852 | 2463 |
" |
2464 |
||
2465 |
^ #() |
|
2466 |
||
2467 |
" |
|
2468 |
OperatingSystem getMountedVolumes |
|
2469 |
" |
|
2470 |
||
2471 |
"Modified: / 22.5.1999 / 00:36:06 / cg" |
|
2472 |
! |
|
2473 |
||
4200 | 2474 |
getNullDevice |
2475 |
"get the name of the null-device. Nil is returned if not supported" |
|
2476 |
||
2477 |
^ nil |
|
2478 |
||
2479 |
"Created: / 19.5.1999 / 12:24:59 / cg" |
|
2480 |
! |
|
2481 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2482 |
idOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2483 |
"return the fileNumber (i.e. inode number) of a file. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2484 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2485 |
Not all operatingSystems may provide this - on those that do not, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2486 |
some dummy id will be returned. |
8669 | 2487 |
On unix, this information can be used to check for two files being |
2488 |
physically identical, even if found in different directories |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2489 |
(i.e. if they are hardLinked)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2490 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2491 |
|i id| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2492 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2493 |
id := self primIdOf:aPathName. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2494 |
id notNil ifTrue:[^ id]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2495 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2496 |
i := self infoOf:aPathName. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2497 |
i notNil ifTrue:[^ i id]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2498 |
^ nil. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2499 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2500 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2501 |
OperatingSystem idOf:'/' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2502 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2503 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2504 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2505 |
infoOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2506 |
"return some object filled with info for the file 'aPathName'; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2507 |
the info (for which corresponding access methods are understood by |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2508 |
the returned object) is: |
17910 | 2509 |
type - a symbol giving the files type |
2510 |
mode - numeric access mode |
|
2511 |
uid - owners user id |
|
2512 |
gid - owners group id |
|
2513 |
size - files size |
|
2514 |
id - files number (i.e. inode number) |
|
2515 |
accessed - last access time (as Timestamp) |
|
2516 |
modified - last modification time (as Timestamp) |
|
2517 |
statusChanged - last status change time (as Timestamp) |
|
2518 |
alternativeName - (windows only: the MSDOS name of the file) |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2519 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2520 |
Some of the fields may be returned as nil on systems which do not provide |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2521 |
all of the information. |
8669 | 2522 |
Return nil if such a file does not exist. |
2523 |
For symbolic links (if supported by the OS), |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2524 |
the info of the pointed-to-file (i.e. the target) is returned; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2525 |
use #linkInfoOf: to get info about the link itself. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2526 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2527 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2528 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2529 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2530 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2531 |
isDirectory:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2532 |
"return true, if 'aPathName' is a valid directory path name. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2533 |
(i.e. exists and is a directory). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2534 |
This also returns true for symbolic links pointing to a directory; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2535 |
if you need to check for this, use #linkInfo:." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2536 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2537 |
^ (self infoOf:aPathName) type == #directory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2538 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2539 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2540 |
isExecutable:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2541 |
"return true, if the given file is executable. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2542 |
For symbolic links, the pointed-to-file is checked." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2543 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2544 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2545 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2546 |
|
6772 | 2547 |
isMountPoint:aPathName |
6781 | 2548 |
"return true, if the given file is a mounted fileSystems mountPoint" |
2549 |
||
2550 |
^ self mountPoints contains:[:mountInfo | mountInfo mountPointPath = aPathName]. |
|
2551 |
||
2552 |
" |
|
8669 | 2553 |
OperatingSystem isMountPoint:'/phys/qnx' |
2554 |
OperatingSystem isMountPoint:'/proc' |
|
2555 |
OperatingSystem isMountPoint:'/' |
|
6781 | 2556 |
" |
6772 | 2557 |
! |
2558 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2559 |
isReadable:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2560 |
"return true, if the file/dir 'aPathName' is readable. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2561 |
For symbolic links, the pointed-to-file is checked." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2562 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2563 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2564 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2565 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2566 |
isSymbolicLink:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2567 |
"return true, if the given file is a symbolic link" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2568 |
|
8474
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2569 |
|info| |
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2570 |
|
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2571 |
info := self linkInfoOf:aPathName. |
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2572 |
^ info notNil and:[info isSymbolicLink] |
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2573 |
|
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2574 |
" |
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2575 |
OperatingSystem isSymbolicLink:'Makefile' |
f06681e84c85
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
8468
diff
changeset
|
2576 |
OperatingSystem isSymbolicLink:'/usr/tmp' |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2577 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2578 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2579 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2580 |
isValidPath:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2581 |
"return true, if 'aPathName' is a valid path name |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2582 |
(i.e. the file or directory exists)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2583 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2584 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2585 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2586 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2587 |
isWritable:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2588 |
"return true, if the given file is writable. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2589 |
For symbolic links, the pointed-to-file is checked." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2590 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2591 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2592 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2593 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2594 |
linkInfoOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2595 |
"return a dictionary filled with info for the file 'aPathName', |
8669 | 2596 |
IFF aPathName is a symbolic link. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2597 |
If aPathName is invalid, or its NOT a symbolic link, nil is returned. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2598 |
(which means, that systems like VMS or MSDOS always return nil here.) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2599 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2600 |
The contents of the dictionary gives info about the link itself, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2601 |
on contrast to #infoOf:, which returns the info of the pointed to file |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2602 |
in case of a symbolic link." |
8669 | 2603 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2604 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2605 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2606 |
|
5031 | 2607 |
mimeTypeForFilename:aFilename |
2608 |
"given a filename, return a corresponding mimeType. |
|
2609 |
This is placed here, to allow for OS-specific configuration |
|
2610 |
files and/or the win32 registry to be consultet. |
|
2611 |
Returns nil if no mimeType for the given name is known." |
|
2612 |
||
2613 |
^ nil |
|
2614 |
! |
|
2615 |
||
4240
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2616 |
mimeTypeForSuffix:aFileSuffix |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2617 |
"given a file suffix, return a corresponding mimeType. |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2618 |
This is placed here, to allow for OS-specific configuration |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2619 |
files and/or the win32 registry to be consultet. |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2620 |
Returns nil if no mimeType for the given suffix is known." |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2621 |
|
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2622 |
^ nil |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2623 |
! |
e1ea7a38f752
added entry to gather a mimeType
Claus Gittinger <cg@exept.de>
parents:
4226
diff
changeset
|
2624 |
|
6781 | 2625 |
mountPoints |
2626 |
"return a collection of mountPoints (aka. topDirectories of mounted file systems)" |
|
2627 |
||
2628 |
^ #() "/ dont know here |
|
2629 |
! |
|
2630 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2631 |
parentDirectoryName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2632 |
"return the name used to refer to parent directories. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2633 |
In MSDOS, Unix and other systems this is '..', but maybe different |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2634 |
for other systems. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2635 |
(but those are currently not supported - so this is some |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2636 |
preparation for the future)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2637 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2638 |
^ '..' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2639 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2640 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2641 |
pathNameOf:pathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2642 |
"return the pathName of the argument, aPathString, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2643 |
- thats the full pathname of the directory, starting at '/'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2644 |
This method needs the path to be valid |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2645 |
(i.e. all directories must exist, be readable and executable). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2646 |
Notice: if symbolic links are involved, the result may look different |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2647 |
from what you expect." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2648 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2649 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2650 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2651 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2652 |
primIdOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2653 |
"the actual code to return the fileNumber (i.e. inode number) of a file." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2654 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2655 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2656 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2657 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2658 |
primPathNameOf:pathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2659 |
"return the pathName of the argument, aPathString, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2660 |
- thats the full pathname of the directory, starting at '/'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2661 |
This method here returns nil, if the OS does not provide a |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2662 |
realPath library function. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2663 |
Notice: if symbolic links are involved, the result may look different |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2664 |
from what you expect." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2665 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2666 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2667 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2668 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2669 |
timeOfLastAccess:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2670 |
"return the time, when the file was last accessed. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2671 |
For nonexistent files, nil is returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2672 |
|
8669 | 2673 |
^ (self infoOf:aPathName) accessTime |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2674 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2675 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2676 |
timeOfLastChange:aPathName |
8669 | 2677 |
"return the time, when the file was last changed. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2678 |
For nonexistent files, nil is returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2679 |
|
6793
0d3e3fd18a70
modified -> modificationTime
Claus Gittinger <cg@exept.de>
parents:
6781
diff
changeset
|
2680 |
^ (self infoOf:aPathName) modificationTime |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2681 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2682 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2683 |
typeOf:aPathName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2684 |
"return the type of a file as a symbol; for nonexistent files, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2685 |
nil is returned. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2686 |
Notice: for symbolic links, the type of the pointed-to file is returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2687 |
|
8669 | 2688 |
^ (self infoOf:aPathName) type |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2689 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2690 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2691 |
volumeNameOf:aPathString |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2692 |
"return the volumeName of the argument, aPath |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2693 |
- thats the name of the volume where aPath is. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2694 |
Not all OperatingSystems support/use volumes; on unix, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2695 |
this always returns an empty string." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2696 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2697 |
^ '' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2698 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2699 |
|
4200 | 2700 |
!AbstractOperatingSystem class methodsFor:'interprocess communication'! |
2701 |
||
2702 |
createCOMFileForVMSCommand:aCommandString in:aDirectory |
|
4204 | 2703 |
"this is only implemented/required for VMS systems, to execute commands" |
2704 |
||
2705 |
^ UnsupportedOperationSignal raise |
|
2706 |
||
4200 | 2707 |
"Created: / 19.5.1999 / 12:16:31 / cg" |
4204 | 2708 |
"Modified: / 19.5.1999 / 14:22:05 / cg" |
4200 | 2709 |
! |
2710 |
||
2711 |
createMailBox |
|
4204 | 2712 |
"this is only implemented/required for VMS systems, to emulate pipes" |
2713 |
||
2714 |
^ UnsupportedOperationSignal raise |
|
4200 | 2715 |
|
2716 |
"Created: / 19.5.1999 / 12:14:56 / cg" |
|
4204 | 2717 |
"Modified: / 19.5.1999 / 14:22:22 / cg" |
4200 | 2718 |
! |
2719 |
||
2720 |
destroyMailBox:mbx |
|
4204 | 2721 |
"this is only implemented/required for VMS systems, to emulate pipes" |
2722 |
||
2723 |
^ UnsupportedOperationSignal raise |
|
2724 |
||
4200 | 2725 |
"Created: / 19.5.1999 / 12:16:43 / cg" |
4204 | 2726 |
"Modified: / 19.5.1999 / 14:22:33 / cg" |
4200 | 2727 |
! |
2728 |
||
2729 |
mailBoxNameOf:mbx |
|
4204 | 2730 |
"this is only implemented/required for VMS systems, to emulate pipes" |
2731 |
||
2732 |
^ UnsupportedOperationSignal raise |
|
4200 | 2733 |
|
2734 |
"Created: / 19.5.1999 / 12:14:56 / cg" |
|
4204 | 2735 |
"Modified: / 19.5.1999 / 14:22:40 / cg" |
4200 | 2736 |
! |
2737 |
||
8967
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2738 |
makeBidirectionalPipe |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2739 |
"answer an array with 2 filedescriptors representing |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2740 |
the two ends of a bidirectional pipe - see also #makePipe" |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2741 |
|
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2742 |
^ self subclassResponsibility |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2743 |
! |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2744 |
|
4200 | 2745 |
makePipe |
8967
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2746 |
"answer an array with 2 filedescriptors representing |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2747 |
the two ends of a unidirectional pipe- see also #makeSocketPair" |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2748 |
|
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2749 |
^ self subclassResponsibility |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2750 |
! |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2751 |
|
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2752 |
shutdownBidirectionalPipeOutput:fileDescriptor |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2753 |
"inform the other end of the bidirectional pipe represented by fileDescriptor, that |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2754 |
we will send no more data to the pipe, i.e. EOF is reached" |
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2755 |
|
30dcf961185d
Support for bidirectional PipeStreams
Stefan Vogel <sv@exept.de>
parents:
8913
diff
changeset
|
2756 |
^ self subclassResponsibility |
4200 | 2757 |
! ! |
2758 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2759 |
!AbstractOperatingSystem class methodsFor:'interrupts & signals'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2760 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2761 |
blockInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2762 |
"disable interrupt processing - if disabled, incoming |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2763 |
interrupts will be registered and handled as soon as |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2764 |
interrupts are reenabled by OperatingSystemclass>>unblockInterrupts. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2765 |
Returns the previous blocking status i.e. true if interrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2766 |
where already blocked. You need this information for proper |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2767 |
unblocking, in case of nested block/unblock calls." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2768 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2769 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2770 |
RETURN ( __BLOCKINTERRUPTS() ); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2771 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2772 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2773 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2774 |
defaultSignal:signalNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2775 |
"revert to the default action on arrival of a (Unix-)signal. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2776 |
Dont confuse Unix signals with smalltalk signals. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2777 |
WARNING: for some signals, it is no good idea to revert to default; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2778 |
for example, the default for SIGINT (i.e. ^C) is to exit; while the |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2779 |
default for SIGQUIT (^ \) is to dump core. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2780 |
Also, NOTICE that signal numbers are not portable between unix |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2781 |
systems - use OperatingSystem sigXXX to get the numeric value for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2782 |
a signal." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2783 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2784 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2785 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2786 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2787 |
disableChildSignalInterrupts |
8669 | 2788 |
"disable childSignal interrupts |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2789 |
(SIGCHLD, if the architecture supports it). |
8669 | 2790 |
We have to set the signal back to default, because ignoring |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2791 |
SIGCHLD breaks wait & co" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2792 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2793 |
^ self defaultSignal:(self sigCHLD) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2794 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2795 |
"Created: 5.1.1996 / 15:45:28 / stefan" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2796 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2797 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2798 |
disableIOInterruptsOn:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2799 |
"turn off IO interrupts for a filedescriptor" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2800 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2801 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2802 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2803 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2804 |
disableSignal:signalNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2805 |
"disable (Unix-) signal processing for signalNumber. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2806 |
Dont confuse Unix signals with smalltalk signals. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2807 |
WARNING: for some signals, it is no good idea to disable |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2808 |
them; for example, disabling the SIGINT signal turns off ^C |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2809 |
handling. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2810 |
Also, NOTICE that signal numbers are not portable between unix |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2811 |
systems - use OperatingSystem sigXXX to get the numeric value for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2812 |
a signal. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2813 |
Use only for fully debugged stand alone applications." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2814 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2815 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2816 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2817 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2818 |
disableTimer |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2819 |
"disable timer interrupts. |
8669 | 2820 |
WARNING: |
17910 | 2821 |
the system will not operate correctly with timer interrupts |
2822 |
disabled, because no scheduling or timeouts are possible." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2823 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2824 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2825 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2826 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2827 |
disableUserInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2828 |
"disable userInterrupt processing; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2829 |
when disabled, no ^C processing takes place. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2830 |
WARNING: |
17910 | 2831 |
If at all, use this only for debugged stand-alone applications, since |
2832 |
no exit to the debugger is possible with user interrupts disabled. |
|
2833 |
We recommend setting up a handler for the signal instead of disabling it." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2834 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2835 |
self disableSignal:(self sigBREAK). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2836 |
self disableSignal:(self sigINT). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2837 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2838 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2839 |
enableAbortInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2840 |
"enable abort signalhandling, and make it a regular signalInterrupt. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2841 |
(the default will dump core and exit - which is not a good idea for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2842 |
end-user applications ...). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2843 |
This is especially useful, if linked-in C-libraries call abort() ..." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2844 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2845 |
self enableSignal:(self sigABRT) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2846 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2847 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2848 |
enableChildSignalInterrupts |
8669 | 2849 |
"enable childSignal interrupts |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2850 |
(SIGCHLD, if the architecture supports it). |
8669 | 2851 |
After enabling, these signals will send the message |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2852 |
'childSignalInterrupt' to the ChildSignalInterruptHandler object." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2853 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2854 |
self enableSignal:(self sigCHLD) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2855 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2856 |
|
6389 | 2857 |
enableCrashSignalInterrupts |
2858 |
"enable powerFail signal exception interrupts (sigPWR). |
|
2859 |
After enabling, this signal will trigger the writing of a crash-image" |
|
2860 |
||
2861 |
self enableSignal:(self sigPWR). |
|
2862 |
self enableSignal:(self sigHUP) |
|
2863 |
! |
|
2864 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2865 |
enableFpExceptionInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2866 |
"enable floating point exception interrupts (if the |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2867 |
architecture supports it). |
8669 | 2868 |
After enabling, fpu-exceptions will send the message |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2869 |
'fpuExceptionInterrupt' to the FPUExceptionInterruptHandler object." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2870 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2871 |
self enableSignal:(self sigFP) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2872 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2873 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2874 |
enableHardSignalInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2875 |
"enable hard signal exception interrupts (trap, buserror & segm. violation). |
8669 | 2876 |
After enabling, these exceptions will send the message |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2877 |
'signalInterrupt' to the SignalInterruptHandler object." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2878 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2879 |
"/ leads to trouble ... |
6389 | 2880 |
"/ self enableSignal:(self sigPIPE). |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2881 |
"/ ... better to ignore them, and let it be handled as a writeErrorSignal. |
6389 | 2882 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2883 |
self disableSignal:(self sigPIPE). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2884 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2885 |
self enableSignal:(self sigILL). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2886 |
self enableSignal:(self sigBUS). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2887 |
self enableSignal:(self sigSEGV). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2888 |
self enableSignal:(self sigFP). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2889 |
self enableSignal:(self sigEMT). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2890 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2891 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2892 |
enableIOInterruptsOn:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2893 |
"turn on IO interrupts for a filedescriptor" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2894 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2895 |
self subclassResonsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2896 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2897 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2898 |
enableQuitInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2899 |
"enable quitInterrupt (usually ^\) handling, and make it a userInterrupt. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2900 |
(the default will dump core and exit - which is not a good idea for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2901 |
end-user applications ...)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2902 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2903 |
self enableSignal:(self sigQUIT) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2904 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2905 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2906 |
enableSignal:signalNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2907 |
"enable (Unix-)signal processing for signalNumber. |
8587 | 2908 |
Don't confuse Unix signals with smalltalk signals. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2909 |
The signal will be delivered to one of the standard handlers |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2910 |
(SIGINT, SIGQUIT, etc) or to a general handler, which |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2911 |
sends #signalInterrupt:. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2912 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2913 |
NOTICE that signal numbers are not portable between unix |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2914 |
systems - use OperatingSystem sigXXX to get the numeric value for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2915 |
a signal." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2916 |
|
8587 | 2917 |
self subclassResponsibility |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2918 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2919 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2920 |
enableTimer:milliSeconds |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2921 |
"setup for a timerInterrupt, to be signalled after some (real) time." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2922 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2923 |
self subclassResonsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2924 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2925 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2926 |
enableUserInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2927 |
"enable userInterrupt (^C) handling; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2928 |
when enabled, ^C in the terminal window will send the message |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2929 |
'userInterrupt' to the UserInterruptHandler object." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2930 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2931 |
self enableSignal:(self sigINT). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2932 |
self enableSignal:(self sigBREAK). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2933 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2934 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2935 |
interruptPending |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2936 |
"return true, if an interrupt is pending. The returned value is |
8669 | 2937 |
invalid if interrupts are not currently blocked, since otherwise |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2938 |
the interrupt is usually already handled before arriving here, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2939 |
or may be served while returning from here." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2940 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2941 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2942 |
extern OBJ __INTERRUPTPENDING(); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2943 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2944 |
RETURN ( __INTERRUPTPENDING() ); |
8669 | 2945 |
%} |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2946 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2947 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2948 |
interruptsBlocked |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2949 |
"return true, if interrupt handling is currently disabled; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2950 |
false otherwise." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2951 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2952 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2953 |
extern OBJ __INTERRUPTS_BLOCKED(); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2954 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2955 |
RETURN ( __INTERRUPTS_BLOCKED() ); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2956 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2957 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2958 |
|
6536 | 2959 |
isFatalSignal:aNumber |
2960 |
"return true if a signal with number aNumber is a fatal signal, |
|
2961 |
i.e. some severe internal error occured" |
|
2962 |
||
2963 |
^ self subclassResponsibility |
|
2964 |
! |
|
2965 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2966 |
killProcess:processId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2967 |
"kill an OS process. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2968 |
The process has a no chance to do some cleanup. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2969 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2970 |
WARNING: in order to avoid zombie processes (on unix), |
17910 | 2971 |
you may have to fetch the processes exitstatus with |
2972 |
OperatingSystem>>getStatusOfProcess:aProcessId." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2973 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2974 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2975 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2976 |
"Modified: / 10.6.1998 / 12:00:07 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2977 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2978 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2979 |
killProcessGroup:processGroupId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2980 |
"kill an OS process group. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2981 |
The process has NO chance to do some cleanup. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2982 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2983 |
WARNING: in order to avoid zombie processes (on unix), |
17910 | 2984 |
you may have to fetch the processes exitstatus with |
2985 |
OperatingSystem>>getStatusOfProcess:aProcessId." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2986 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2987 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2988 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2989 |
"Created: / 10.6.1998 / 12:00:26 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2990 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2991 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2992 |
nameForSignal:aSignalNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2993 |
"for a given Unix signalnumber, return a descriptive string" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2994 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2995 |
aSignalNumber == self sigHUP ifTrue:[^ 'hangup']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2996 |
aSignalNumber == self sigINT ifTrue:[^ 'interrupt']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2997 |
aSignalNumber == self sigKILL ifTrue:[^ 'kill']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2998 |
aSignalNumber == self sigQUIT ifTrue:[^ 'quit']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2999 |
aSignalNumber == self sigILL ifTrue:[^ 'illegal instruction']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3000 |
aSignalNumber == self sigTRAP ifTrue:[^ 'trap']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3001 |
aSignalNumber == self sigABRT ifTrue:[^ 'abort']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3002 |
aSignalNumber == self sigIOT ifTrue:[^ 'iot trap']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3003 |
aSignalNumber == self sigEMT ifTrue:[^ 'emt trap']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3004 |
aSignalNumber == self sigFP ifTrue:[^ 'fp exception']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3005 |
aSignalNumber == self sigBUS ifTrue:[^ 'bus error']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3006 |
aSignalNumber == self sigSEGV ifTrue:[^ 'segmentation violation']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3007 |
aSignalNumber == self sigSYS ifTrue:[^ 'bad system call']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3008 |
aSignalNumber == self sigPIPE ifTrue:[^ 'broken pipe']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3009 |
aSignalNumber == self sigALRM ifTrue:[^ 'alarm timer']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3010 |
aSignalNumber == self sigTERM ifTrue:[^ 'termination']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3011 |
aSignalNumber == self sigSTOP ifTrue:[^ 'stop']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3012 |
aSignalNumber == self sigTSTP ifTrue:[^ 'tty stop']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3013 |
aSignalNumber == self sigCONT ifTrue:[^ 'continue']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3014 |
aSignalNumber == self sigCHLD ifTrue:[^ 'child death']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3015 |
aSignalNumber == self sigTTIN ifTrue:[^ 'background tty input']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3016 |
aSignalNumber == self sigTTOU ifTrue:[^ 'background tty output']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3017 |
aSignalNumber == self sigIO ifTrue:[^ 'io available']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3018 |
aSignalNumber == self sigXCPU ifTrue:[^ 'cpu time expired']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3019 |
aSignalNumber == self sigXFSZ ifTrue:[^ 'file size limit']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3020 |
aSignalNumber == self sigVTALRM ifTrue:[^ 'virtual alarm timer']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3021 |
aSignalNumber == self sigPROF ifTrue:[^ 'profiling timer']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3022 |
aSignalNumber == self sigWINCH ifTrue:[^ 'winsize changed']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3023 |
aSignalNumber == self sigLOST ifTrue:[^ 'resource lost']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3024 |
aSignalNumber == self sigUSR1 ifTrue:[^ 'user signal 1']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3025 |
aSignalNumber == self sigUSR2 ifTrue:[^ 'user signal 2']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3026 |
aSignalNumber == self sigMSG ifTrue:[^ 'HFT message']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3027 |
aSignalNumber == self sigPWR ifTrue:[^ 'power-fail']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3028 |
aSignalNumber == self sigPRE ifTrue:[^ 'programming exception']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3029 |
aSignalNumber == self sigGRANT ifTrue:[^ 'HFT access wanted']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3030 |
aSignalNumber == self sigRETRACT ifTrue:[^ 'HFT access relinquish']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3031 |
aSignalNumber == self sigSOUND ifTrue:[^ 'HFT sound complete']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3032 |
aSignalNumber == self sigDANGER ifTrue:[^ 'low on paging space']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3033 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3034 |
"notice: many systems map SIGPOLL and/or SIGUSR onto SIGIO |
17910 | 3035 |
therefore, keep SIGIO always above the two below" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3036 |
aSignalNumber == self sigPOLL ifTrue:[^ 'io available']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3037 |
aSignalNumber == self sigURG ifTrue:[^ 'urgent']. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3038 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3039 |
^ 'unknown signal' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3040 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3041 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3042 |
OperatingSystem nameForSignal:9 |
8669 | 3043 |
OperatingSystem nameForSignal:(OperatingSystem sigPOLL) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3044 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3045 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3046 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3047 |
operatingSystemSignal:signalNumber |
8669 | 3048 |
"return the signal to be raised when an |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3049 |
operatingSystem-signal occurs, or nil" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3050 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3051 |
OSSignals notNil ifTrue:[ |
17910 | 3052 |
^ OSSignals at:signalNumber ifAbsent:[nil] |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3053 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3054 |
^ nil |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3055 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3056 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3057 |
operatingSystemSignal:signalNumber install:aSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3058 |
"install a signal to be raised when an operatingSystem-signal occurs" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3059 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3060 |
OSSignals isNil ifTrue:[ |
17910 | 3061 |
OSSignals := Array new:32 |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3062 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3063 |
OSSignals at:signalNumber put:aSignal |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3064 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3065 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3066 |
sendSignal:signalNumber to:processId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3067 |
"send a unix signal to some process (maybe myself). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3068 |
Returns false if any error occurred, true otherwise. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3069 |
|
8587 | 3070 |
Do not confuse UNIX signals with Smalltalk-Signals." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3071 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3072 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3073 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3074 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3075 |
startSpyTimer |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3076 |
"trigger a spyInterrupt, to be signalled after some short (virtual) time. |
4200 | 3077 |
Return true, if the spy-timerInterrupt was enabled. |
3078 |
This was used by the old MessageTally for profiling. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3079 |
On systems, where no virtual timer is available, use the real timer |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3080 |
(which is of course less correct). |
8669 | 3081 |
OBSOLETE: the new messageTally runs as a high prio process, not using |
17910 | 3082 |
spy interrupts." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3083 |
|
4200 | 3084 |
^ false |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3085 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3086 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3087 |
stopSpyTimer |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3088 |
"stop spy timing - disable spy timer. |
8669 | 3089 |
OBSOLETE: the new messageTally runs as a high prio process, not using |
17910 | 3090 |
spy interrupts." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3091 |
|
4200 | 3092 |
^ false |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3093 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3094 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3095 |
terminateProcess:processId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3096 |
"terminate a unix process. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3097 |
The process has a chance to do some cleanup. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3098 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3099 |
WARNING: in order to avoid zombie processes (on unix), |
17910 | 3100 |
you may have to fetch the processes exitstatus with |
3101 |
OperatingSystem>>getStatusOfProcess:aProcessId." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3102 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3103 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3104 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3105 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3106 |
terminateProcessGroup:processGroupId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3107 |
"terminate a unix process group. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3108 |
The process has a chance to do some cleanup. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3109 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3110 |
WARNING: in order to avoid zombie processes (on unix), |
17910 | 3111 |
you may have to fetch the processes exitstatus with |
3112 |
OperatingSystem>>getStatusOfProcess:aProcessId." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3113 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3114 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3115 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3116 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3117 |
unblockInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3118 |
"enable interrupt processing - if any interrupts are pending, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3119 |
these will be handled immediately. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3120 |
When unblocking interrupts, take care of nested block/unblock |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3121 |
calls - you must only unblock after a blockcall if they where |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3122 |
really not blocked before. See OperatingSystemclass>>blockInterrupts." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3123 |
%{ |
8505
4456ffd20005
#unblockInterrupts returns the prvious blocking state
Stefan Vogel <sv@exept.de>
parents:
8497
diff
changeset
|
3124 |
RETURN(__UNBLOCKINTERRUPTS()); |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3125 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3126 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3127 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3128 |
!AbstractOperatingSystem class methodsFor:'misc'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3129 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3130 |
closePid:pid |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3131 |
"free pid resource" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3132 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3133 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3134 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3135 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3136 |
exit |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3137 |
"shutdown smalltalk immediately - this method does not return. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3138 |
Return 'good'-status (0) to the parent unix process." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3139 |
|
5429 | 3140 |
self exit:0. |
3141 |
||
8804 | 3142 |
"OperatingSystem exit - don't evaluate this" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3143 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3144 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3145 |
exit:exitCode |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3146 |
"shutdown smalltalk immediately - |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3147 |
returning an exit-code to the parent unix process." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3148 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3149 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3150 |
int code = 1; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3151 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3152 |
if (__isSmallInteger(exitCode)) { |
17910 | 3153 |
code = __intVal(exitCode); |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3154 |
} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3155 |
__mainExit(code); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3156 |
%} |
8804 | 3157 |
"OperatingSystem exit:1 - don't evaluate this" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3158 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3159 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3160 |
exitWithCoreDump |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3161 |
"shutdown smalltalk immediately - dumping core. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3162 |
This always returns 'bad'-status to the parent unix process. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3163 |
Notice, that no cleanup is performed at all - you may have to |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3164 |
manually remove any tempfiles. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3165 |
Use this only for debugging ST/X itself" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3166 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3167 |
%{ /* NOCONTEXT */ |
10293 | 3168 |
extern void abort(); |
3169 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3170 |
abort(); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3171 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3172 |
" |
8804 | 3173 |
OperatingSystem exitWithCoreDump - don't evaluate this |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3174 |
" |
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3175 |
! |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3176 |
|
17834 | 3177 |
getAllProcesses |
3178 |
"get a list of the running OS processes. |
|
3179 |
Some OperatingSystems (Windows) support this. |
|
3180 |
The default is to answer an empty list." |
|
3181 |
||
3182 |
^ #(). |
|
3183 |
! |
|
3184 |
||
7170
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3185 |
getVMSSymbol:aSymbolString |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3186 |
"get a symbols value, or nil if there is none" |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3187 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3188 |
^ nil |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3189 |
|
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3190 |
"Created: / 5.6.1998 / 19:02:50 / cg" |
19558aa463e0
Environment in #executeCommand:...
Stefan Vogel <sv@exept.de>
parents:
7135
diff
changeset
|
3191 |
"Modified: / 5.6.1998 / 19:03:15 / cg" |
11768 | 3192 |
! |
3193 |
||
3194 |
playSound:fileName |
|
3195 |
"unsupported - simply stay silent" |
|
3196 |
||
3197 |
^ self. |
|
3198 |
! |
|
3199 |
||
3200 |
playSound:fileName mode:modeInteger |
|
3201 |
"unsupported - simply stay silent" |
|
3202 |
||
3203 |
^ self. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3204 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3205 |
|
7289
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3206 |
!AbstractOperatingSystem class methodsFor:'obsolete'! |
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3207 |
|
8236 | 3208 |
baseNameOf:aPath |
3209 |
<resource:#obsolete> |
|
3210 |
||
3211 |
self obsoleteMethodWarning:'use asFilename baseName'. |
|
3212 |
^ aPath asFilename baseName |
|
7289
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3213 |
! ! |
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3214 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3215 |
!AbstractOperatingSystem class methodsFor:'os queries'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3216 |
|
3806 | 3217 |
getCCDefine |
3218 |
"return a string which was used to identify the C-Compiler used |
|
3219 |
when STX was compiled, and which should be passed down when compiling methods. |
|
8669 | 3220 |
For example, on linux, this is '__GNUC__'; |
3806 | 3221 |
on windows, this is either '__MSC__' or '__BORLANDC__'" |
3222 |
||
3223 |
%{ /* NOCONTEXT */ |
|
3224 |
#ifndef CC_DEFINE |
|
3225 |
# ifdef WIN32 |
|
3226 |
# ifdef __BORLANDC__ |
|
3829 | 3227 |
# define CC_DEFINE "__BORLANDC__" |
3806 | 3228 |
# else |
3229 |
# define CC_DEFINE "__MSC__" |
|
3230 |
# endif |
|
3231 |
# else |
|
3232 |
# ifdef __GNUC__ |
|
3233 |
# define CC_DEFINE "__GNUC__" |
|
3234 |
# else |
|
3235 |
# define CC_DEFINE "__CC__" |
|
3236 |
# endif |
|
3237 |
# endif |
|
3238 |
#endif |
|
3239 |
RETURN ( __MKSTRING(CC_DEFINE)); |
|
3240 |
%} |
|
3241 |
" |
|
3242 |
OperatingSystem getCCDefine |
|
3243 |
" |
|
3244 |
! |
|
3245 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3246 |
getCPUDefine |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3247 |
"return a string which was used to identify this CPU type when STX was |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3248 |
compiled, and which should be passed down when compiling methods. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3249 |
For example, on linux, this may be '-Di386'; on a vax, this would be '-Dvax'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3250 |
This is normally not of interest to 'normal' users; however, it is passed |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3251 |
down to the c-compiler when methods are incrementally compiled to machine code." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3252 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3253 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3254 |
# ifndef CPU_DEFINE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3255 |
# define CPU_DEFINE "-DunknownCPU" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3256 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3257 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3258 |
RETURN ( __MKSTRING(CPU_DEFINE)); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3259 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3260 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3261 |
OperatingSystem getCPUDefine |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3262 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3263 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3264 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3265 |
getCPUType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3266 |
"return a string giving the type of machine we're running on. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3267 |
Here, the machine for which ST/X was compiled is returned |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3268 |
(i.e. for all x86's, the same i386 is returned). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3269 |
This may normally not be of any interest to you ..." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3270 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3271 |
|cpu| |
8669 | 3272 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3273 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3274 |
|
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3275 |
# ifdef __vax__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3276 |
# define CPU_SYMBOL @symbol(vax) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3277 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3278 |
# ifdef __mips__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3279 |
# define CPU_SYMBOL @symbol(mips) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3280 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3281 |
# ifdef __i386__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3282 |
# define CPU_SYMBOL @symbol(i386) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3283 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3284 |
# ifdef __i860__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3285 |
# define CPU_SYMBOL @symbol(i860) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3286 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3287 |
# ifdef __ns32k__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3288 |
# define CPU_SYMBOL @symbol(ns32k) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3289 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3290 |
# ifdef __mc68k__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3291 |
# define CPU_SYMBOL @symbol(mc68k) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3292 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3293 |
# ifdef __mc88k__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3294 |
# define CPU_SYMBOL @symbol(mc88k) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3295 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3296 |
# ifdef __sparc__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3297 |
# define CPU_SYMBOL @symbol(sparc) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3298 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3299 |
# ifdef __hppa__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3300 |
# define CPU_SYMBOL @symbol(hppa) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3301 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3302 |
# ifdef __rs6000__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3303 |
# define CPU_SYMBOL @symbol(rs6000) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3304 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3305 |
# ifdef __powerPC__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3306 |
# define CPU_SYMBOL @symbol(powerPC) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3307 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3308 |
# ifdef __alpha__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3309 |
# define CPU_SYMBOL @symbol(alpha) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3310 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3311 |
# ifdef __transputer__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3312 |
# define CPU_SYMBOL @symbol(transputer) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3313 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3314 |
# ifdef __ibm370__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3315 |
# define CPU_SYMBOL @symbol(ibm370) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3316 |
# endif |
8901
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3317 |
# ifdef __s390__ |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3318 |
# define CPU_SYMBOL @symbol(s390) |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3319 |
# endif |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3320 |
# ifdef __arm__ |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3321 |
# define CPU_SYMBOL @symbol(arm) |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3322 |
# endif |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3323 |
# ifdef __ia64__ |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3324 |
# define CPU_SYMBOL @symbol(ia64) |
824a89d0b5c7
alpha64 vs. POINTER_SIZE cleanup
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
3325 |
# endif |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3326 |
|
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3327 |
# ifndef CPU_SYMBOL |
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3328 |
# define CPU_SYMBOL @symbol(unknown) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3329 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3330 |
|
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3331 |
cpu = CPU_SYMBOL; |
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3332 |
# undef CPU_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3333 |
%}. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3334 |
^ cpu |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3335 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3336 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3337 |
OperatingSystem getCPUType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3338 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3339 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3340 |
"examples: are we running on a ss-10/solaris ?" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3341 |
" |
8669 | 3342 |
(OperatingSystem getCPUType = 'sparc') |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3343 |
and:[OperatingSystem getOSType = 'solaris'] |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3344 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3345 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3346 |
"or on a pc/solaris ?" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3347 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3348 |
(OperatingSystem getCPUType = 'i386') |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3349 |
and:[OperatingSystem getOSType = 'solaris'] |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3350 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3351 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3352 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3353 |
getDomainName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3354 |
"return the domain this host is in. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3355 |
Notice: |
17910 | 3356 |
not all systems support this; on some, 'unknown' is returned." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3357 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3358 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3359 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3360 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3361 |
getEnvironment:aStringOrSymbol |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3362 |
"get an environment string" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3363 |
|
5407 | 3364 |
^ self subclassResponsibility |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3365 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3366 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3367 |
getHostName |
17910 | 3368 |
"return the hostname we are running on - |
17795 | 3369 |
a fully qalified hostname at best. |
3370 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3371 |
Notice: |
17910 | 3372 |
not all systems support this; on some, 'unknown' is returned." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3373 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3374 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3375 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3376 |
|
7778
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3377 |
getLanguage |
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3378 |
"get the LANGUAGE setting (example: de_DE.iso8859-15@euro)" |
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3379 |
|
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3380 |
^ self getEnvironment:'LANG'. |
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3381 |
! |
cbbd8c2faccc
Language stuff: define #getLanguage
Stefan Vogel <sv@exept.de>
parents:
7770
diff
changeset
|
3382 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3383 |
getLocaleInfo |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3384 |
"return a dictionary filled with values from the locale information; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3385 |
Not all fields may be present, depending on the OS's setup and capabilities. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3386 |
Possible fields are: |
17910 | 3387 |
decimalPoint <String> |
3388 |
||
3389 |
thousandsSep <String> |
|
3390 |
||
3391 |
internationalCurrencySymbol <String> |
|
3392 |
||
3393 |
currencySymbol <String> |
|
3394 |
||
3395 |
monetaryDecimalPoint <String> |
|
3396 |
||
3397 |
monetaryThousandsSeparator <String> |
|
3398 |
||
3399 |
positiveSign <String> |
|
3400 |
||
3401 |
negativeSign <String> |
|
3402 |
||
3403 |
internationalFractionalDigits <Integer> |
|
3404 |
||
3405 |
fractionalDigits <Integer> |
|
3406 |
||
3407 |
positiveSignPrecedesCurrencySymbol <Boolean> |
|
3408 |
||
3409 |
negativeSignPrecedesCurrencySymbol <Boolean> |
|
3410 |
||
3411 |
positiveSignSeparatedBySpaceFromCurrencySymbol <Boolean> |
|
3412 |
||
3413 |
negativeSignSeparatedBySpaceFromCurrencySymbol <Boolean> |
|
3414 |
||
3415 |
positiveSignPosition <Symbol> |
|
3416 |
one of: #parenthesesAround, |
|
3417 |
#signPrecedes, |
|
3418 |
#signSuceeds, |
|
3419 |
#signPrecedesCurrencySymbol, |
|
3420 |
#signSuceedsCurrencySymbol |
|
3421 |
||
3422 |
negativeSignPosition <like above> |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3423 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3424 |
it is up to the application to deal with undefined values. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3425 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3426 |
Notice, that (for now), the system does not use this information; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3427 |
it should be used by applications as required. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3428 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3429 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3430 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3431 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3432 |
|
8997 | 3433 |
getNetworkAddresses |
3434 |
"return a dictionary with key:name of interface and |
|
17910 | 3435 |
value:the network address for each interface" |
8997 | 3436 |
|
3437 |
self subclassResponsibility |
|
3438 |
! |
|
3439 |
||
7289
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3440 |
getNetworkMACAddresses |
8669 | 3441 |
"return a dictionary with key:name of interface and |
17910 | 3442 |
value:the MAC adress for each interface" |
6363 | 3443 |
|
3444 |
self subclassResponsibility |
|
3445 |
! |
|
3446 |
||
7289
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3447 |
getNetworkMACAddressesForIf:ifName |
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3448 |
"return the MAC adress for interface ifName" |
ae352d72ec31
Spelling (#getNetworkMACAddresses).
Stefan Vogel <sv@exept.de>
parents:
7258
diff
changeset
|
3449 |
|
8641
1b45626f0e50
noMacAddress fallBack (NT4.0)
Claus Gittinger <cg@exept.de>
parents:
8587
diff
changeset
|
3450 |
self getNetworkMACAddresses at:ifName ifAbsent:nil |
1b45626f0e50
noMacAddress fallBack (NT4.0)
Claus Gittinger <cg@exept.de>
parents:
8587
diff
changeset
|
3451 |
|
1b45626f0e50
noMacAddress fallBack (NT4.0)
Claus Gittinger <cg@exept.de>
parents:
8587
diff
changeset
|
3452 |
"Modified: / 17-11-2004 / 01:43:35 / cg" |
6363 | 3453 |
! |
3454 |
||
10684 | 3455 |
getNumberOfProcessors |
17746 | 3456 |
"answer the number of physical processors in the system" |
3457 |
||
10684 | 3458 |
self subclassResponsibility |
3459 |
! |
|
3460 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3461 |
getOSDefine |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3462 |
"return a string which was used to identify this machine when stx was |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3463 |
compiled, and which should be passed down when compiling methods. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3464 |
For example, on linux, this is '-DLINUX'." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3465 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3466 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3467 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3468 |
#ifndef OS_DEFINE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3469 |
# ifdef WIN32 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3470 |
# define OS_DEFINE "-DWIN32" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3471 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3472 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3473 |
# ifndef OS_DEFINE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3474 |
# define OS_DEFINE "-DunknownOS" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3475 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3476 |
#endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3477 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3478 |
RETURN ( __MKSTRING(OS_DEFINE)); |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3479 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3480 |
#undef OS_DEFINE |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3481 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3482 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3483 |
OperatingSystem getOSDefine |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3484 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3485 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3486 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3487 |
getOSType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3488 |
"return a string giving the type of OS we're running on. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3489 |
This can be used to adapt programs to certain environment |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3490 |
differences (for example: mail-lock strategy ...)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3491 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3492 |
|os| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3493 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3494 |
%{ /* NOCONTEXT */ |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3495 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3496 |
# ifdef MSDOS |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3497 |
# define OS_SYMBOL @symbol(msdos) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3498 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3499 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3500 |
# ifdef WIN32 |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3501 |
# define OS_SYMBOL @symbol(win32) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3502 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3503 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3504 |
# ifdef MSWINDOWS |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3505 |
# define OS_SYMBOL @symbol(mswindows) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3506 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3507 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3508 |
# ifdef VMS |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3509 |
# ifdef __openVMS__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3510 |
# define OS_SYMBOL @symbol(openVMS) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3511 |
# else |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3512 |
# define OS_SYMBOL @symbol(VMS) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3513 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3514 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3515 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3516 |
# ifdef MVS /* ;-) */ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3517 |
# define OS_SYMBOL @symbol(mvs) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3518 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3519 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3520 |
# ifdef OS2 |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3521 |
# define OS_SYMBOL @symbol(os2) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3522 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3523 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3524 |
# ifdef sinix |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3525 |
# define OS_SYMBOL @symbol(sinix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3526 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3527 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3528 |
# ifdef ultrix |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3529 |
# define OS_SYMBOL @symbol(ultrix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3530 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3531 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3532 |
# ifdef sco |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3533 |
# define OS_SYMBOL @symbol(sco) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3534 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3535 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3536 |
# ifdef hpux |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3537 |
# define OS_SYMBOL @symbol(hpux) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3538 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3539 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3540 |
# ifdef LINUX |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3541 |
# define OS_SYMBOL @symbol(linux) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3542 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3543 |
|
6651 | 3544 |
# ifdef FREEBSD |
3545 |
# define OS_SYMBOL @symbol(freeBSD) |
|
3546 |
# endif |
|
3547 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3548 |
# ifdef sunos |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3549 |
# define OS_SYMBOL @symbol(sunos) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3550 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3551 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3552 |
# ifdef solaris |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3553 |
# define OS_SYMBOL @symbol(solaris) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3554 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3555 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3556 |
# ifdef IRIS |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3557 |
# define OS_SYMBOL @symbol(irix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3558 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3559 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3560 |
# ifdef aix |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3561 |
# define OS_SYMBOL @symbol(aix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3562 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3563 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3564 |
# ifdef realIX |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3565 |
# define OS_SYMBOL @symbol(realIX) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3566 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3567 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3568 |
# ifdef __osf__ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3569 |
# define OS_SYMBOL @symbol(osf) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3570 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3571 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3572 |
/* |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3573 |
* no concrete info; become somewhat vague ... |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3574 |
*/ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3575 |
# ifndef OS_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3576 |
# ifdef MACH |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3577 |
# define OS_SYMBOL @symbol(mach) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3578 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3579 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3580 |
|
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3581 |
# ifndef OS_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3582 |
# ifdef BSD |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3583 |
# define OS_SYMBOL @symbol(bsd) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3584 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3585 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3586 |
# ifdef SYSV |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3587 |
# ifdef SYSV3 |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3588 |
# define OS_SYMBOL @symbol(sys5_3) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3589 |
# else |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3590 |
# ifdef SYSV4 |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3591 |
# define OS_SYMBOL @symbol(sys5_4) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3592 |
# else |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3593 |
# define OS_SYMBOL @symbol(sys5) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3594 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3595 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3596 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3597 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3598 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3599 |
/* |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3600 |
* become very vague ... |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3601 |
*/ |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3602 |
# ifndef OS_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3603 |
# ifdef POSIX |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3604 |
# define OS_SYMBOL @symbol(posix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3605 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3606 |
# endif |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3607 |
# ifndef OS_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3608 |
# ifdef UNIX |
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3609 |
# define OS_SYMBOL @symbol(unix) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3610 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3611 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3612 |
|
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3613 |
# ifndef OS_SYMBOL |
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3614 |
# define OS_SYMBOL @symbol(unknown) |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3615 |
# endif |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3616 |
|
6530
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3617 |
os = OS_SYMBOL; |
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3618 |
|
fb683e5bfe04
Return cpu and os type as symbols
Stefan Vogel <sv@exept.de>
parents:
6421
diff
changeset
|
3619 |
# undef OS_SYMBOL |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3620 |
%}. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3621 |
^ os |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3622 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3623 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3624 |
OperatingSystem getOSType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3625 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3626 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3627 |
|
9698
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3628 |
getPlatformDefine |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3629 |
"return a string which defines the platform, |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3630 |
and which should be passed down when compiling methods. |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3631 |
For example, on all unices, this is '-DUNIX'." |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3632 |
|
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3633 |
%{ /* NOCONTEXT */ |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3634 |
|
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3635 |
#ifndef PLATFORM_DEFINE |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3636 |
# ifdef WIN32 |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3637 |
# define PLATFORM_DEFINE "-DWIN32" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3638 |
# endif |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3639 |
# ifdef OS2 |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3640 |
# define PLATFORM_DEFINE "-DOS2" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3641 |
# endif |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3642 |
# ifdef BEOS |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3643 |
# define PLATFORM_DEFINE "-DBEOS" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3644 |
# endif |
9699 | 3645 |
# ifdef MACOS |
3646 |
# define PLATFORM_DEFINE "-DMACOS" |
|
3647 |
# endif |
|
3648 |
# ifdef VMS |
|
3649 |
# define PLATFORM_DEFINE "-DVMS" |
|
3650 |
# endif |
|
9698
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3651 |
# ifndef PLATFORM_DEFINE |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3652 |
# define PLATFORM_DEFINE "-DUNIX" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3653 |
# endif |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3654 |
#endif |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3655 |
|
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3656 |
RETURN ( __MKSTRING(PLATFORM_DEFINE)); |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3657 |
%} |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3658 |
" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3659 |
OperatingSystem getPlatformDefine |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3660 |
" |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3661 |
! |
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3662 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3663 |
getProcessId |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3664 |
"return the (unix-)processId" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3665 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3666 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3667 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3668 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3669 |
getSystemID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3670 |
"if supported by the OS, return the systemID; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3671 |
a unique per machine identification. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3672 |
WARNING: |
17910 | 3673 |
not all systems support this; on some, 'unknown' is returned." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3674 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3675 |
^ 'unknown' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3676 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3677 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3678 |
OperatingSystem getSystemID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3679 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3680 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3681 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3682 |
getSystemInfo |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3683 |
"return info on the system weare running on. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3684 |
If the system supports the uname system call, that info is returned; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3685 |
otherwise, some simulated info is returned. |
8669 | 3686 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3687 |
WARNING: |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3688 |
Do not depend on the amount and contents of the returned information, some |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3689 |
systems may return more/less than others. Also, the contents depends on the |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3690 |
OS, for example, linux returns 'ix86', while WIN32 returns 'x86'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3691 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3692 |
This method is mainly provided to augment error reports with some system |
8669 | 3693 |
information. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3694 |
(in case of system/version specific OS errors, conditional workarounds and patches |
17910 | 3695 |
may be based upon this info). |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3696 |
Your application should NOT depend upon this in any way. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3697 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3698 |
The returned info may (or may not) contain: |
17910 | 3699 |
#system -> some operating system identification (irix, Linux, nt, win32s ...) |
3700 |
#version -> OS version (some os version identification) |
|
3701 |
#release -> OS release (3.5, 1.2.1 ...) |
|
3702 |
#node -> some host identification (hostname) |
|
3703 |
#domain -> domain name (hosts domain) |
|
3704 |
#machine -> type of machine (i586, mips ...) |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3705 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3706 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3707 |
|info| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3708 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3709 |
info := IdentityDictionary new. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3710 |
info at:#system put:(self getSystemType). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3711 |
info at:#node put:(self getHostName). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3712 |
info at:#machine put:(self getCPUType). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3713 |
info at:#architecture put:'unknown'. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3714 |
info at:#domain put:self getDomainName. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3715 |
info at:#osType put:(self getOSType). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3716 |
^ info |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3717 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3718 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3719 |
OperatingSystem getSystemInfo |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3720 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3721 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3722 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3723 |
getSystemType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3724 |
"return a string giving the type of system we're running on. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3725 |
This is almost the same as getOSType, but the returned string |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3726 |
is slightly different for some systems (i.e. iris vs. irix). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3727 |
Dont depend on this - use getOSType. I dont really see a point |
8669 | 3728 |
here ... |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3729 |
(except for slight differences between next/mach and other machs)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3730 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3731 |
^ self getOSType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3732 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3733 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3734 |
OperatingSystem getSystemType |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3735 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3736 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3737 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3738 |
getWindowsDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3739 |
"internal interface - only for Windows based systems. |
9699 | 3740 |
Return the windows directory, which, depending on the system, |
3741 |
may be |
|
17910 | 3742 |
'\WINNT', '\WINDOWS' |
9699 | 3743 |
or whatever. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3744 |
On non-windows systems, nil is returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3745 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3746 |
^ nil |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3747 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3748 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3749 |
OperatingSystem getWindowsDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3750 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3751 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3752 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3753 |
getWindowsSystemDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3754 |
"internal interface - only for Windows based systems. |
9699 | 3755 |
Return the windows system directory, which, depending on the system, |
17910 | 3756 |
may be |
3757 |
'\WINNT\SYSTEM32', '\WINDOWS\SYSTEM' |
|
9699 | 3758 |
or whatever. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3759 |
On non-windows systems, nil is returned." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3760 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3761 |
^ nil |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3762 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3763 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3764 |
OperatingSystem getWindowsSystemDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3765 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3766 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3767 |
|
4207 | 3768 |
hasConsole |
3769 |
"return true, if there is some kind of console available |
|
3770 |
(i.e. for proper stdIn, stdOut and stdErr handling). |
|
5918 | 3771 |
This only returns false when running under windows, and |
4207 | 3772 |
the system is running as a pure windows application. |
3773 |
If false, the miniDebugger is useless and not used." |
|
3774 |
||
3775 |
^ true |
|
3776 |
! |
|
3777 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3778 |
isBSDlike |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3779 |
"return true, if the OS we're running on is a 'real' unix." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3780 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3781 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3782 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3783 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3784 |
isMAClike |
9699 | 3785 |
"return true, if running on a macOS (but not on A/UX or OS/X)" |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3786 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3787 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3788 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3789 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3790 |
isMSDOSlike |
9699 | 3791 |
"return true, if the OS we're running on is msdos like (in contrast to unix-like). |
3792 |
This returns true for any of msdos, win32s, win95, winNT and os/2." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3793 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3794 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3795 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3796 |
|
3901 | 3797 |
isMSWINDOWSNTlike |
3798 |
"This returns true if running in a Windows-NT system." |
|
3799 |
||
3800 |
^ false. |
|
3801 |
! |
|
3802 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3803 |
isMSWINDOWSlike |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3804 |
"return true, if running on a MS-Windows like system. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3805 |
This returns true for any of win32s, win95 and winNT." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3806 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3807 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3808 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3809 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3810 |
isOS2like |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3811 |
"return true, if the OS we're running on is OS2 like. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3812 |
Only returns true for a plain OS/2 system." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3813 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3814 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3815 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3816 |
|
17746 | 3817 |
isProcessIdPresent:pid |
3818 |
"answer true, if a process with process id pid is present, false if not. |
|
3819 |
Raise an error, if an exception occures" |
|
3820 |
||
3821 |
^ self subclassResponsibility |
|
3822 |
! |
|
3823 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3824 |
isUNIXlike |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3825 |
"return true, if the OS we're running on is a unix like." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3826 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3827 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3828 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3829 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3830 |
isVMSlike |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3831 |
"return true, if the OS we're running in is VMS (or openVMS)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3832 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3833 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3834 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3835 |
|
9697 | 3836 |
knownPlatformNames |
3837 |
"return a collection of strings as possibly returned by getPlatformName. |
|
3838 |
Should be used instead of getOSType or getSystemType if multiple choice |
|
3839 |
dialogs are presented to the user." |
|
3840 |
||
3841 |
^#( |
|
17910 | 3842 |
win32 |
3843 |
os2 "/ actually - this is no longer true |
|
3844 |
macos "/ actually - this is no longer true |
|
3845 |
vms "/ actually - this is no longer true |
|
3846 |
beos "/ actually - this was never true |
|
3847 |
unix |
|
9697 | 3848 |
) |
3849 |
||
3850 |
" |
|
3851 |
OperatingSystem knownPlatformNames |
|
3852 |
OperatingSystem platformName |
|
9698
e8e27fbaa232
+getPlatformDefine; knownPlatformNames
Claus Gittinger <cg@exept.de>
parents:
9697
diff
changeset
|
3853 |
OperatingSystem getPlatformDefine |
9697 | 3854 |
" |
3855 |
||
3856 |
"Modified: 20.6.1997 / 17:37:26 / cg" |
|
3857 |
! |
|
3858 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3859 |
maxFileNameLength |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3860 |
"return the max number of characters in a filename. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3861 |
CAVEAT: |
17910 | 3862 |
Actually, the following is somewhat wrong - some systems |
3863 |
support different sizes, depending on the volume. |
|
3864 |
We return a somewhat conservative number here. |
|
3865 |
Another entry, to query for volume specific max |
|
3866 |
will be added in the future." |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3867 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3868 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3869 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3870 |
|
6578 | 3871 |
maxNumberOfOpenFiles |
3872 |
"answer the maximum number of open files for this process" |
|
3873 |
||
3874 |
^ self subclassResponsibility |
|
3875 |
! |
|
3876 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3877 |
maxPathLength |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3878 |
"return the max number of characters in a pathName." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3879 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3880 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3881 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3882 |
|
17847 | 3883 |
osName |
3884 |
"return a string describing the OS platform very we're running on. |
|
3885 |
This returns #unix for all unix derivatives. |
|
3886 |
I.e. it is much less specific than getOSType or getSystemType." |
|
3887 |
||
3888 |
|info| |
|
3889 |
||
3890 |
info := self getSystemInfo. |
|
3891 |
^ ((info at:#system) ? '?') |
|
3892 |
, |
|
3893 |
((info at:#version) ? '?') |
|
3894 |
||
3895 |
" |
|
3896 |
OperatingSystem getSystemInfo |
|
3897 |
OperatingSystem osName |
|
3898 |
" |
|
3899 |
||
3900 |
"Modified: / 20-06-1997 / 17:37:26 / cg" |
|
3901 |
"Created: / 05-08-2011 / 18:18:53 / cg" |
|
3902 |
! |
|
3903 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3904 |
pathSeparator |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3905 |
"return the character which separates items in the PATH variable" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3906 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3907 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3908 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3909 |
|
9700 | 3910 |
platformDefineForPlatformName:osID |
9699 | 3911 |
"return a c-define for a particular platform (use only for makefile generation etc.)" |
3912 |
||
17735 | 3913 |
osID = #win32 ifTrue:[ ^ '-DWIN32']. |
3914 |
osID = #os2 ifTrue:[ ^ '-DOS2']. |
|
3915 |
osID = #macos ifTrue:[ ^ '-DMACOS']. |
|
3916 |
osID = #beos ifTrue:[ ^ '-DBEOS']. |
|
3917 |
osID = #vms ifTrue:[ ^ '-DVMS']. |
|
3918 |
osID = #unix ifTrue:[ ^ '-DUNIX']. |
|
9699 | 3919 |
self error:'unknown os'. |
3920 |
||
3921 |
" |
|
3922 |
OperatingSystem platformDefineForName:(OperatingSystem platformName) |
|
3923 |
" |
|
3924 |
||
3925 |
"Modified: 20.6.1997 / 17:37:26 / cg" |
|
3926 |
! |
|
3927 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3928 |
platformName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3929 |
"return a string describing the OS platform very we're running on. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3930 |
This returns #unix for all unix derivatives. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3931 |
I.e. it is much less specific than getOSType or getSystemType." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3932 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3933 |
|os| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3934 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3935 |
os := self getSystemType. |
11170
ced52c04b215
#platformName - answer symbols
Stefan Vogel <sv@exept.de>
parents:
11166
diff
changeset
|
3936 |
os = #win32 ifTrue:[ ^ #win32]. |
ced52c04b215
#platformName - answer symbols
Stefan Vogel <sv@exept.de>
parents:
11166
diff
changeset
|
3937 |
os = #os2 ifTrue:[ ^ #os2]. |
ced52c04b215
#platformName - answer symbols
Stefan Vogel <sv@exept.de>
parents:
11166
diff
changeset
|
3938 |
os = #macos ifTrue:[ ^ #macos]. |
ced52c04b215
#platformName - answer symbols
Stefan Vogel <sv@exept.de>
parents:
11166
diff
changeset
|
3939 |
os = #VMS ifTrue:[ ^ #vms]. |
ced52c04b215
#platformName - answer symbols
Stefan Vogel <sv@exept.de>
parents:
11166
diff
changeset
|
3940 |
os = #openVMS ifTrue:[ ^ #vms]. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3941 |
^ #unix |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3942 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3943 |
" |
9697 | 3944 |
OperatingSystem knownPlatformNames |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3945 |
OperatingSystem platformName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3946 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3947 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3948 |
"Modified: 20.6.1997 / 17:37:26 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3949 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3950 |
|
17910 | 3951 |
randomBytesInto:bufferOrInteger |
17757 | 3952 |
"If bufferOrInteger is a String or a ByteArray, |
17910 | 3953 |
fill a given buffer with random bytes from the RtlGenRandom function |
3954 |
and nswer the buffer. |
|
17757 | 3955 |
|
3956 |
If bufferOrInteger is a SmallInteger, |
|
17910 | 3957 |
return this many bytes (max 4) as a SmallInteger. |
3958 |
||
3959 |
Return nil on error (may raise PrimitiveFailure, too). |
|
17757 | 3960 |
|
3961 |
NOTE: This is a private interface, please use RandomGenerator!! |
|
3962 |
||
3963 |
Subclasses should implement this, if the OperatingSystem supports a random generator." |
|
3964 |
||
17910 | 3965 |
^ nil "not implemented" |
17757 | 3966 |
! |
3967 |
||
17742 | 3968 |
setEnvironment:aStringOrSymbol to:newValueString |
3969 |
"set an environment variable" |
|
3970 |
||
3971 |
^ self subclassResponsibility |
|
3972 |
! |
|
3973 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3974 |
setLocaleInfo:anInfoDictionary |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3975 |
"set the locale information; if set, this oerrides the OS's settings. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3976 |
(internal in ST/X only - the OS's settings remain unaffected) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3977 |
See description of fields in #getLocaleInfo. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3978 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3979 |
Notice, that (for now), the system does not use this information; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3980 |
it should be used by applications as required." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3981 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3982 |
LocaleInfo := anInfoDictionary |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3983 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3984 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3985 |
|d| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3986 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3987 |
d := IdentityDictionary new. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3988 |
d at:#decimalPoint put:'.' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3989 |
d at:#thousandsSeparator put:',' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3990 |
d at:#currencySymbol put:'USD' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3991 |
d at:#monetaryDecimalPoint put:'.' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3992 |
d at:#monetaryThousandsSeparator put:'.' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3993 |
d at:#fractionalDigits put:2 . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3994 |
d at:#positiveSign put:'+' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3995 |
d at:#negativeSign put:'-' . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3996 |
d at:#positiveSignPrecedesCurrencySymbol put:true . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3997 |
d at:#negativeSignPrecedesCurrencySymbol put:false . |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3998 |
OperatingSystem setLocaleInfo:d |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3999 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4000 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4001 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4002 |
supportsChildInterrupts |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4003 |
"return true, if the OS supports childProcess termination signalling |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4004 |
through interrupts (i.e. SIGCHILD)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4005 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4006 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4007 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4008 |
" |
8669 | 4009 |
OperatingSystem supportsChildInterrupts |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4010 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4011 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4012 |
|
3826 | 4013 |
supportsFileOwnerGroups |
4014 |
"return true, if the OS's file system supports file |
|
4015 |
group ownership - here, we are optimistic assuming that |
|
4016 |
we are running under a real OS. |
|
4017 |
Redefined in Win32OS to return false." |
|
4018 |
||
4019 |
^ true |
|
4020 |
||
4021 |
"Modified: / 10.9.1998 / 17:48:20 / cg" |
|
4022 |
"Created: / 10.9.1998 / 17:56:28 / cg" |
|
4023 |
! |
|
4024 |
||
4025 |
supportsFileOwners |
|
4026 |
"return true, if the OS's file system supports file |
|
4027 |
ownership - here, we are optimistic assuming that |
|
4028 |
we are running under a real OS. |
|
4029 |
Redefined in Win32OS to return false." |
|
4030 |
||
4031 |
^ true |
|
4032 |
||
4033 |
"Modified: / 10.9.1998 / 17:48:20 / cg" |
|
4034 |
"Created: / 10.9.1998 / 17:56:11 / cg" |
|
4035 |
! |
|
4036 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4037 |
supportsIOInterrupts |
8669 | 4038 |
"return true, if the OS supports IO availability interrupts |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4039 |
(i.e. SIGPOLL/SIGIO)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4040 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4041 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4042 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4043 |
" |
8669 | 4044 |
OperatingSystem supportsIOInterrupts |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4045 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4046 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4047 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4048 |
supportsNonBlockingIO |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4049 |
"return true, if the OS supports nonblocking IO." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4050 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4051 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4052 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4053 |
" |
8669 | 4054 |
OperatingSystem supportsNonBlockingIO |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4055 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4056 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4057 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4058 |
supportsSelect |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4059 |
"return true, if the OS supports selecting on multiple |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4060 |
filedescriptors via select. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4061 |
If false is returned, ProcessorScheduler will poll in 50ms |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4062 |
intervals for I/O becoming ready." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4063 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4064 |
^ true |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4065 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4066 |
" |
8669 | 4067 |
OperatingSystem supportsSelect |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4068 |
" |
3901 | 4069 |
! |
4070 |
||
5099 | 4071 |
supportsSelectOnPipes |
4072 |
"return true, if the OS supports selecting on pipe |
|
4073 |
filedescriptors via select. |
|
4074 |
If false is returned, ProcessorScheduler will poll in 50ms |
|
4075 |
intervals for I/O becoming ready." |
|
4076 |
||
4077 |
^ true |
|
4078 |
||
4079 |
" |
|
8669 | 4080 |
OperatingSystem supportsSelectOnPipes |
5099 | 4081 |
" |
4082 |
||
4083 |
"Modified: / 14.12.1999 / 19:40:32 / cg" |
|
4084 |
"Created: / 14.12.1999 / 19:43:43 / cg" |
|
4085 |
! |
|
4086 |
||
4087 |
supportsSelectOnSockets |
|
4088 |
"return true, if the OS supports selecting on socket |
|
4089 |
filedescriptors via select. |
|
4090 |
If false is returned, ProcessorScheduler will poll in 50ms |
|
4091 |
intervals for I/O becoming ready." |
|
4092 |
||
4093 |
^ true |
|
4094 |
||
4095 |
" |
|
8669 | 4096 |
OperatingSystem supportsSelectOnSockets |
5099 | 4097 |
" |
4098 |
||
4099 |
"Modified: / 14.12.1999 / 19:40:32 / cg" |
|
4100 |
! |
|
4101 |
||
3901 | 4102 |
supportsVolumes |
4103 |
"return true, if the OS supports disk volumes. |
|
4104 |
False is returned for UNIX, true for MSDOS and VMS" |
|
4105 |
||
4106 |
^ false |
|
4107 |
||
4108 |
"Created: / 29.10.1998 / 13:20:37 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4109 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4110 |
|
4146 | 4111 |
!AbstractOperatingSystem class methodsFor:'path queries'! |
4112 |
||
5143 | 4113 |
defaultPackagePath |
4114 |
"return a default packagePath - thats a collection of |
|
4115 |
dirnames, where ST/X searches for its package subdirs. |
|
5159
ca0524ab2576
defaultPackagePath initialization fixed
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
4116 |
This method might be redefined in concrete OS's to add |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4117 |
OS-specific directory names." |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4118 |
|
17834 | 4119 |
|packagePath dirName homeDirName priv userPrivateSTXDir appDirName appDir topDirName| |
5143 | 4120 |
|
4121 |
" |
|
4122 |
the path is set to search files first locally |
|
4123 |
- this allows private stuff to override global stuff |
|
4124 |
" |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4125 |
packagePath := OrderedCollection new. |
5143 | 4126 |
|
4127 |
"/ |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4128 |
"/ the current (default) directory: |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4129 |
"/ ./packages |
5143 | 4130 |
"/ |
17807 | 4131 |
packagePath add:('.' "Filename currentDirectory pathName"). |
5143 | 4132 |
|
4133 |
"/ |
|
17834 | 4134 |
"/ the executable's directory: |
4135 |
"/ (/opt/stx/bin/stx -> /opt/stx/bin) |
|
4136 |
"/ |
|
4137 |
appDirName := self pathOfSTXExecutable asFilename directory. |
|
4138 |
(packagePath includes:appDirName) ifFalse:[ |
|
17910 | 4139 |
packagePath add:appDirName. |
17834 | 4140 |
]. |
4141 |
||
4142 |
"/ |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4143 |
"/ the executable's parent directory: |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4144 |
"/ (/opt/stx/bin/stx -> /opt/stx/packages) |
5143 | 4145 |
"/ |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4146 |
appDir := self pathOfSTXExecutable asFilename directory directory. |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4147 |
dirName := appDir pathName. |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4148 |
(packagePath includes:dirName) ifFalse:[ |
17910 | 4149 |
packagePath add:dirName. |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4150 |
]. |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4151 |
|
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4152 |
homeDirName := OperatingSystem getHomeDirectory. |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4153 |
homeDirName notNil ifTrue:[ |
17910 | 4154 |
"/ |
4155 |
"/ a users private smalltalk directory in its home (login) directory: |
|
4156 |
"/ $HOME/.smalltalk/packages or $HOME\smalltalk\packages |
|
4157 |
"/ |
|
4158 |
OperatingSystem isUNIXlike ifTrue:[ |
|
4159 |
priv := '.smalltalk'. |
|
4160 |
] ifFalse:[ |
|
4161 |
priv := 'smalltalk'. |
|
4162 |
]. |
|
4163 |
userPrivateSTXDir := homeDirName asFilename / priv. |
|
4164 |
(userPrivateSTXDir isDirectory) ifTrue:[ |
|
4165 |
dirName := userPrivateSTXDir pathName. |
|
4166 |
(packagePath includes:dirName) ifFalse:[ |
|
4167 |
packagePath add:dirName |
|
4168 |
] |
|
4169 |
]. |
|
8669 | 4170 |
]. |
5143 | 4171 |
|
4172 |
"/ |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4173 |
"/ STX_TOPDIR from the environment: |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4174 |
"/ $STX_TOPDIR/packages |
5143 | 4175 |
"/ |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4176 |
topDirName := OperatingSystem getEnvironment:'STX_TOPDIR'. |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4177 |
topDirName notNil ifTrue:[ |
17910 | 4178 |
(packagePath includes:topDirName) ifFalse:[ |
4179 |
packagePath add:topDirName |
|
4180 |
]. |
|
5143 | 4181 |
]. |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4182 |
|
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4183 |
packagePath := packagePath select:[:each | (each asFilename / 'packages') exists] |
17910 | 4184 |
thenCollect:[:each | (each asFilename constructString:'packages')]. |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4185 |
|
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4186 |
" |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4187 |
unconditionally prepend all directories from $STX_PACKAGEPATH |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4188 |
" |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4189 |
(dirName := OperatingSystem getEnvironment:'STX_PACKAGEPATH') notNil ifTrue:[ |
17910 | 4190 |
dirName := dirName asCollectionOfSubstringsSeparatedBy:$:. |
4191 |
dirName reverseDo:[:eachDirectoryName| |
|
4192 |
(packagePath includes:eachDirectoryName) ifFalse:[ |
|
4193 |
packagePath addFirst:eachDirectoryName. |
|
4194 |
]. |
|
4195 |
]. |
|
5654 | 4196 |
]. |
4197 |
||
17814 | 4198 |
"maybe the sources are kept in a central place..." |
4199 |
(appDir / 'source') isDirectory ifTrue:[ |
|
17910 | 4200 |
packagePath add:(appDir / 'source') pathName. |
17814 | 4201 |
]. |
4202 |
||
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4203 |
"maybe we are running in the build environment: XXX/stx /projects /smalltalk |
17910 | 4204 |
or: XXX/exept /expecco /application |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4205 |
- if XXX/stx/libbasic exists, add XXX to the package path" |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4206 |
|
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4207 |
topDirName isNil ifTrue:[ |
17910 | 4208 |
"appdir is now: projects" |
4209 |
appDir := appDir directory directory. |
|
4210 |
(appDir / 'stx' / 'libbasic') isDirectory ifTrue:[ |
|
4211 |
packagePath add:appDir pathName. |
|
4212 |
]. |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4213 |
]. |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4214 |
|
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4215 |
^ packagePath |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4216 |
|
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4217 |
" |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4218 |
OperatingSystem defaultPackagePath |
5143 | 4219 |
" |
4220 |
||
17834 | 4221 |
"Modified: / 04-02-2011 / 16:27:15 / cg" |
5143 | 4222 |
! |
4223 |
||
4146 | 4224 |
defaultSystemPath |
4225 |
"return a default systemPath - thats a collection of |
|
4226 |
dirnames, where ST/X searches for its files. |
|
4227 |
This method is redefined in concrete OS's to add |
|
4228 |
OS-specific directory names." |
|
4229 |
||
17754 | 4230 |
|sysPath p appDir homePath priv userPrivateSTXDir appPath| |
4146 | 4231 |
|
4232 |
" |
|
4233 |
the path is set to search files first locally |
|
4234 |
- this allows private stuff to override global stuff |
|
4235 |
" |
|
4236 |
sysPath := OrderedCollection new. |
|
4237 |
||
4238 |
"/ |
|
4239 |
"/ the current (default) directory |
|
4240 |
"/ |
|
17807 | 4241 |
sysPath add:('.' "Filename currentDirectory pathName"). |
4146 | 4242 |
|
4243 |
"/ |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4244 |
"/ the executable's directory |
17814 | 4245 |
"/ and the executables parent directory (if it is an installed version) |
9021 | 4246 |
"/ |
17754 | 4247 |
appPath := self pathOfSTXExecutable. |
4248 |
appPath notNil ifTrue:[ |
|
17910 | 4249 |
appDir := appPath asFilename directory. |
4250 |
appPath := appDir pathName. |
|
4251 |
(sysPath includes:appPath) ifFalse:[ |
|
4252 |
sysPath add:appPath. |
|
4253 |
]. |
|
4254 |
appDir baseName = 'bin' ifTrue:[ |
|
4255 |
appPath := appDir directory pathName. |
|
4256 |
(sysPath includes:appPath) ifFalse:[ |
|
4257 |
sysPath add:appPath. |
|
4258 |
]. |
|
4259 |
]. |
|
9021 | 4260 |
]. |
4261 |
||
4262 |
"/ |
|
4146 | 4263 |
"/ the users home (login) directory |
4264 |
"/ |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4265 |
homePath := self getHomeDirectory. |
4146 | 4266 |
homePath notNil ifTrue:[ |
17910 | 4267 |
"/ |
4268 |
"/ a users private smalltalk directory in its home (login) directory |
|
4269 |
"/ |
|
4270 |
OperatingSystem isUNIXlike ifTrue:[ |
|
4271 |
priv := '.smalltalk'. |
|
4272 |
] ifFalse:[ |
|
4273 |
priv := 'smalltalk'. |
|
4274 |
]. |
|
4275 |
userPrivateSTXDir := homePath asFilename construct:priv. |
|
4276 |
(userPrivateSTXDir isDirectory) ifTrue:[ |
|
4277 |
userPrivateSTXDir := userPrivateSTXDir pathName. |
|
4278 |
(sysPath includes:userPrivateSTXDir) ifFalse:[ |
|
4279 |
sysPath add:userPrivateSTXDir |
|
4280 |
] |
|
4281 |
]. |
|
4146 | 4282 |
]. |
4283 |
||
4284 |
"/ |
|
5036 | 4285 |
"/ SMALLTALK_LIBDIR, STX_LIBDIR and STX_TOPDIR from the environment |
4146 | 4286 |
"/ |
17910 | 4287 |
#( |
4288 |
'SMALLTALK_LIBDIR' |
|
4289 |
'STX_LIBDIR' |
|
4290 |
'STX_TOPDIR' |
|
5646
5dfccce8e880
no longer automatically add the home-dir to the systemPath
Claus Gittinger <cg@exept.de>
parents:
5486
diff
changeset
|
4291 |
) do:[:each | |
17910 | 4292 |
p := OperatingSystem getEnvironment:each. |
4293 |
p notNil ifTrue:[ |
|
4294 |
p := p asFilename pathName. |
|
4295 |
(p asFilename isDirectory) ifTrue:[ |
|
4296 |
(sysPath includes:p) ifFalse:[ |
|
4297 |
sysPath add:p |
|
4298 |
] |
|
4299 |
] |
|
4300 |
]. |
|
5036 | 4301 |
]. |
4146 | 4302 |
^ sysPath |
5148 | 4303 |
|
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4304 |
" |
17910 | 4305 |
OperatingSystem defaultSystemPath |
11680
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4306 |
" |
8616f1b36b4d
Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents:
11548
diff
changeset
|
4307 |
|
5148 | 4308 |
"Modified: / 24.12.1999 / 00:30:27 / cg" |
4146 | 4309 |
! ! |
4310 |
||
9476 | 4311 |
!AbstractOperatingSystem class methodsFor:'printing support'! |
4312 |
||
4313 |
getPrinters |
|
4314 |
"return a collection of PrinterInfos" |
|
4315 |
||
4316 |
self subclassResponsibility |
|
4317 |
||
4318 |
"Created: / 27-07-2006 / 12:17:31 / fm" |
|
4319 |
! ! |
|
4320 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4321 |
!AbstractOperatingSystem class methodsFor:'private'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4322 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4323 |
osProcessStatusClass |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4324 |
^ self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4325 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4326 |
"Created: / 12.6.1998 / 16:30:29 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4327 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4328 |
|
7656 | 4329 |
!AbstractOperatingSystem class methodsFor:'queries-sockets'! |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4330 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4331 |
domainCodeOf:aSymbolOrInteger |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4332 |
"return the numeric AF_xxx code of a given symbolic domain name. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4333 |
Return nil for invalid or unsupported domains. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4334 |
For backward compatibility, the obsolete (non-AF-prefixed) names |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4335 |
are still supported for a while - this support will vanish." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4336 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4337 |
|domainCode| |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4338 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4339 |
%{ /*NOCONTEXT*/ |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4340 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4341 |
if (__isSmallInteger(aSymbolOrInteger) || aSymbolOrInteger == nil) { |
17910 | 4342 |
RETURN (aSymbolOrInteger); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4343 |
} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4344 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4345 |
#ifdef AF_INET |
8669 | 4346 |
else if ((aSymbolOrInteger == @symbol(AF_INET)) || (aSymbolOrInteger == @symbol(inet))) |
8913 | 4347 |
domainCode = __mkSmallInteger(AF_INET); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4348 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4349 |
#ifdef AF_INET6 |
8669 | 4350 |
else if ((aSymbolOrInteger == @symbol(AF_INET6)) || (aSymbolOrInteger == @symbol(inet6))) |
8913 | 4351 |
domainCode = __mkSmallInteger(AF_INET6); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4352 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4353 |
#ifdef AF_UNIX |
8669 | 4354 |
else if ((aSymbolOrInteger == @symbol(AF_UNIX)) || (aSymbolOrInteger == @symbol(unix))) |
8913 | 4355 |
domainCode = __mkSmallInteger(AF_UNIX); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4356 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4357 |
#ifdef AF_APPLETALK |
8669 | 4358 |
else if ((aSymbolOrInteger == @symbol(AF_APPLETALK)) || (aSymbolOrInteger == @symbol(appletalk))) |
8913 | 4359 |
domainCode = __mkSmallInteger(AF_APPLETALK); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4360 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4361 |
#ifdef AF_DECnet |
8669 | 4362 |
else if ((aSymbolOrInteger == @symbol(AF_DECnet)) || (aSymbolOrInteger == @symbol(decnet))) |
8913 | 4363 |
domainCode = __mkSmallInteger(AF_DECnet); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4364 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4365 |
#ifdef AF_NS |
8669 | 4366 |
else if ((aSymbolOrInteger == @symbol(AF_NS)) || (aSymbolOrInteger == @symbol(ns))) |
8913 | 4367 |
domainCode = __mkSmallInteger(AF_NS); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4368 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4369 |
#ifdef AF_X25 |
8669 | 4370 |
else if ((aSymbolOrInteger == @symbol(AF_X25)) || (aSymbolOrInteger == @symbol(x25))) |
8913 | 4371 |
domainCode = __mkSmallInteger(AF_X25); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4372 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4373 |
#ifdef AF_SNA |
8669 | 4374 |
else if (aSymbolOrInteger == @symbol(AF_SNA)) |
8913 | 4375 |
domainCode = __mkSmallInteger(AF_SNA); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4376 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4377 |
#ifdef AF_RAW |
8669 | 4378 |
else if ((aSymbolOrInteger == @symbol(AF_RAW)) || (aSymbolOrInteger == @symbol(raw))) |
8913 | 4379 |
domainCode = __mkSmallInteger(AF_RAW); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4380 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4381 |
#ifdef AF_ISO |
8669 | 4382 |
else if ((aSymbolOrInteger == @symbol(AF_ISO)) || (aSymbolOrInteger == @symbol(iso))) |
8913 | 4383 |
domainCode = __mkSmallInteger(AF_ISO); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4384 |
#endif |
8784 | 4385 |
#ifdef AF_ECMA |
4386 |
else if (aSymbolOrInteger == @symbol(AF_ECMA)) |
|
8913 | 4387 |
domainCode = __mkSmallInteger(AF_ECMA); |
8784 | 4388 |
#endif |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4389 |
#ifdef AF_NETBIOS |
8669 | 4390 |
else if ((aSymbolOrInteger == @symbol(AF_NETBIOS)) || (aSymbolOrInteger == @symbol(netbios))) |
8913 | 4391 |
domainCode = __mkSmallInteger(AF_NETBIOS); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4392 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4393 |
#ifdef AF_NETBEUI |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4394 |
else if (aSymbolOrInteger == @symbol(AF_NETBEUI)) |
8913 | 4395 |
domainCode = __mkSmallInteger(AF_NETBEUI); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4396 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4397 |
#ifdef AF_IPX |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4398 |
else if (aSymbolOrInteger == @symbol(AF_IPX)) |
8913 | 4399 |
domainCode = __mkSmallInteger(AF_IPX); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4400 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4401 |
#ifdef AF_AX25 |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4402 |
else if (aSymbolOrInteger == @symbol(AF_AX25)) |
8913 | 4403 |
domainCode = __mkSmallInteger(AF_AX25); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4404 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4405 |
#ifdef AF_NETROM |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4406 |
else if (aSymbolOrInteger == @symbol(AF_NETROM)) |
8913 | 4407 |
domainCode = __mkSmallInteger(AF_NETROM); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4408 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4409 |
#ifdef AF_BRIDGE |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4410 |
else if (aSymbolOrInteger == @symbol(AF_BRIDGE)) |
8913 | 4411 |
domainCode = __mkSmallInteger(AF_BRIDGE); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4412 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4413 |
#ifdef AF_BSC |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4414 |
else if (aSymbolOrInteger == @symbol(AF_BSC)) |
8913 | 4415 |
domainCode = __mkSmallInteger(AF_BSC); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4416 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4417 |
#ifdef AF_ROSE |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4418 |
else if (aSymbolOrInteger == @symbol(AF_ROSE)) |
8913 | 4419 |
domainCode = __mkSmallInteger(AF_ROSE); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4420 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4421 |
#ifdef AF_IRDA |
8669 | 4422 |
else if ((aSymbolOrInteger == @symbol(AF_IRDA)) || (aSymbolOrInteger == @symbol(irda))) |
8913 | 4423 |
domainCode = __mkSmallInteger(AF_IRDA); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4424 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4425 |
#ifdef AF_BAN |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4426 |
else if (aSymbolOrInteger == @symbol(AF_BAN)) |
8913 | 4427 |
domainCode = __mkSmallInteger(AF_BAN); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4428 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4429 |
#ifdef AF_VOICEVIEW |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4430 |
else if (aSymbolOrInteger == @symbol(AF_VOICEVIEW)) |
8913 | 4431 |
domainCode = __mkSmallInteger(AF_VOICEVIEW); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4432 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4433 |
#ifdef AF_ATM |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4434 |
else if (aSymbolOrInteger == @symbol(AF_ATM)) |
8913 | 4435 |
domainCode = __mkSmallInteger(AF_ATM); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4436 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4437 |
#ifdef AF_ATMPVC |
8669 | 4438 |
else if (aSymbolOrInteger == @symbol(AF_ATMPVC)) |
8913 | 4439 |
domainCode = __mkSmallInteger(AF_ATMPVC); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4440 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4441 |
#ifdef AF_ATMSVC |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4442 |
else if (aSymbolOrInteger == @symbol(AF_ATMSVC)) |
8913 | 4443 |
domainCode = __mkSmallInteger(AF_ATMSVC); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4444 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4445 |
#ifdef AF_SECURITY |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4446 |
else if (aSymbolOrInteger == @symbol(AF_SECURITY)) |
8913 | 4447 |
domainCode = __mkSmallInteger(AF_SECURITY); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4448 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4449 |
#ifdef AF_KEY |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4450 |
else if (aSymbolOrInteger == @symbol(AF_KEY)) |
8913 | 4451 |
domainCode = __mkSmallInteger(AF_KEY); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4452 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4453 |
#ifdef AF_NETLINK |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4454 |
else if (aSymbolOrInteger == @symbol(AF_NETLINK)) |
8913 | 4455 |
domainCode = __mkSmallInteger(AF_NETLINK); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4456 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4457 |
#ifdef AF_PACKET |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4458 |
else if (aSymbolOrInteger == @symbol(AF_PACKET)) |
8913 | 4459 |
domainCode = __mkSmallInteger(AF_PACKET); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4460 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4461 |
#ifdef AF_ASH |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4462 |
else if (aSymbolOrInteger == @symbol(AF_ASH)) |
8913 | 4463 |
domainCode = __mkSmallInteger(AF_ASH); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4464 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4465 |
#ifdef AF_ECONET |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4466 |
else if (aSymbolOrInteger == @symbol(AF_ECONET)) |
8913 | 4467 |
domainCode = __mkSmallInteger(AF_ECONET); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4468 |
#endif |
7716 | 4469 |
#ifdef AF_IMPLINK |
4470 |
else if (aSymbolOrInteger == @symbol(AF_IMPLINK)) |
|
8913 | 4471 |
domainCode = __mkSmallInteger(AF_IMPLINK); |
7716 | 4472 |
#endif |
8784 | 4473 |
#ifdef AF_PUP |
4474 |
else if (aSymbolOrInteger == @symbol(AF_PUP)) |
|
8913 | 4475 |
domainCode = __mkSmallInteger(AF_PUP); |
8784 | 4476 |
#endif |
7716 | 4477 |
#ifdef AF_CHAOS |
4478 |
else if (aSymbolOrInteger == @symbol(AF_CHAOS)) |
|
8913 | 4479 |
domainCode = __mkSmallInteger(AF_CHAOS); |
7716 | 4480 |
#endif |
4481 |
#ifdef AF_DLI |
|
4482 |
else if (aSymbolOrInteger == @symbol(AF_DLI)) |
|
8913 | 4483 |
domainCode = __mkSmallInteger(AF_DLI); |
7716 | 4484 |
#endif |
4485 |
#ifdef AF_LAT |
|
4486 |
else if (aSymbolOrInteger == @symbol(AF_LAT)) |
|
8913 | 4487 |
domainCode = __mkSmallInteger(AF_LAT); |
7716 | 4488 |
#endif |
4489 |
#ifdef AF_HYLINK |
|
4490 |
else if (aSymbolOrInteger == @symbol(AF_HYLINK)) |
|
8913 | 4491 |
domainCode = __mkSmallInteger(AF_HYLINK); |
7716 | 4492 |
#endif |
4493 |
#ifdef AF_FIREFOX |
|
4494 |
else if (aSymbolOrInteger == @symbol(AF_FIREFOX)) |
|
8913 | 4495 |
domainCode = __mkSmallInteger(AF_FIREFOX); |
7716 | 4496 |
#endif |
4497 |
#ifdef AF_CLUSTER |
|
4498 |
else if (aSymbolOrInteger == @symbol(AF_CLUSTER)) |
|
8913 | 4499 |
domainCode = __mkSmallInteger(AF_CLUSTER); |
7716 | 4500 |
#endif |
4501 |
#ifdef AF_12844 |
|
4502 |
else if (aSymbolOrInteger == @symbol(AF_12844)) |
|
8913 | 4503 |
domainCode = __mkSmallInteger(AF_12844); |
7716 | 4504 |
#endif |
4505 |
#ifdef AF_NETDES |
|
4506 |
else if (aSymbolOrInteger == @symbol(AF_NETDES)) |
|
8913 | 4507 |
domainCode = __mkSmallInteger(AF_NETDES); |
7716 | 4508 |
#endif |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4509 |
%}. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4510 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4511 |
^ domainCode. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4512 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4513 |
" |
8669 | 4514 |
self domainCodeOf:#AF_INET |
4515 |
self domainCodeOf:#AF_INET6 |
|
4516 |
self domainCodeOf:#AF_UNIX |
|
4517 |
self domainCodeOf:#AF_APPLETALK |
|
4518 |
self domainCodeOf:#AF_DECNET |
|
4519 |
" |
|
4520 |
"for backward compatibility only: |
|
4521 |
self domainCodeOf:#inet |
|
4522 |
self domainCodeOf:#inet6 |
|
4523 |
self domainCodeOf:#unix |
|
4524 |
self domainCodeOf:#appletalk |
|
4525 |
self domainCodeOf:#decnet |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4526 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4527 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4528 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4529 |
domainSymbolOf:anInteger |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4530 |
"return the symbolic domainName of a given numeric AF_xxx code. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4531 |
Return nil for invalid or unsupported domains." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4532 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4533 |
|domainSymbol| |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4534 |
|
8669 | 4535 |
%{ /*NOCONTEXT*/ |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4536 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4537 |
if (__isSmallInteger(anInteger)) { |
17910 | 4538 |
switch(__intVal(anInteger)) { |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4539 |
#ifdef AF_INET |
17910 | 4540 |
case AF_INET: |
4541 |
domainSymbol = @symbol(AF_INET); |
|
4542 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4543 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4544 |
#ifdef AF_INET6 |
17910 | 4545 |
case AF_INET6: |
4546 |
domainSymbol = @symbol(AF_INET6); |
|
4547 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4548 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4549 |
#ifdef AF_UNIX |
17910 | 4550 |
case AF_UNIX: |
4551 |
domainSymbol = @symbol(AF_UNIX); |
|
4552 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4553 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4554 |
#ifdef AF_APPLETALK |
17910 | 4555 |
case AF_APPLETALK: |
4556 |
domainSymbol = @symbol(AF_APPLETALK); |
|
4557 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4558 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4559 |
#ifdef AF_DECnet |
17910 | 4560 |
case AF_DECnet: |
4561 |
domainSymbol = @symbol(AF_DECnet); |
|
4562 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4563 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4564 |
#ifdef AF_NS |
17910 | 4565 |
case AF_NS: |
4566 |
domainSymbol = @symbol(AF_NS); |
|
4567 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4568 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4569 |
#ifdef AF_X25 |
17910 | 4570 |
case AF_X25: |
4571 |
domainSymbol = @symbol(AF_X25); |
|
4572 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4573 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4574 |
#ifdef AF_SNA |
17910 | 4575 |
case AF_SNA: |
4576 |
domainSymbol = @symbol(AF_SNA); |
|
4577 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4578 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4579 |
#ifdef AF_RAW |
17910 | 4580 |
case AF_RAW: |
4581 |
domainSymbol = @symbol(AF_RAW); |
|
4582 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4583 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4584 |
#ifdef AF_ISO |
17910 | 4585 |
case AF_ISO: |
4586 |
domainSymbol = @symbol(AF_ISO); |
|
4587 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4588 |
#endif |
8784 | 4589 |
#ifdef AF_ECMA |
17910 | 4590 |
case AF_ECMA: |
4591 |
domainSymbol = @symbol(AF_ECMA); |
|
4592 |
break; |
|
8784 | 4593 |
#endif |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4594 |
#ifdef AF_NETBIOS |
17910 | 4595 |
case AF_NETBIOS: |
4596 |
domainSymbol = @symbol(AF_NETBIOS); |
|
4597 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4598 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4599 |
#ifdef AF_IPX |
17910 | 4600 |
case AF_IPX: |
4601 |
domainSymbol = @symbol(AF_IPX); |
|
4602 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4603 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4604 |
#ifdef AF_AX25 |
17910 | 4605 |
case AF_AX25: |
4606 |
domainSymbol = @symbol(AF_AX25); |
|
4607 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4608 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4609 |
#ifdef AF_NETROM |
17910 | 4610 |
case AF_NETROM: |
4611 |
domainSymbol = @symbol(AF_NETROM); |
|
4612 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4613 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4614 |
#ifdef AF_BRIDGE |
17910 | 4615 |
case AF_BRIDGE: |
4616 |
domainSymbol = @symbol(AF_BRIDGE); |
|
4617 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4618 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4619 |
#ifdef AF_BSC |
17910 | 4620 |
case AF_BSC: |
4621 |
domainSymbol = @symbol(AF_BSC); |
|
4622 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4623 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4624 |
#ifdef AF_ROSE |
17910 | 4625 |
case AF_ROSE: |
4626 |
domainSymbol = @symbol(AF_ROSE); |
|
4627 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4628 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4629 |
#ifdef AF_IRDA |
17910 | 4630 |
case AF_IRDA: |
4631 |
domainSymbol = @symbol(AF_IRDA); |
|
4632 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4633 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4634 |
#ifdef AF_BAN |
17910 | 4635 |
case AF_BAN: |
4636 |
domainSymbol = @symbol(AF_BAN); |
|
4637 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4638 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4639 |
#ifdef AF_VOICEVIEW |
17910 | 4640 |
case AF_VOICEVIEW: |
4641 |
domainSymbol = @symbol(AF_VOICEVIEW); |
|
4642 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4643 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4644 |
#ifdef AF_ATM |
17910 | 4645 |
case AF_ATM: |
4646 |
domainSymbol = @symbol(AF_ATM); |
|
4647 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4648 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4649 |
#ifdef AF_ATMPVC |
17910 | 4650 |
case AF_ATMPVC: |
4651 |
domainSymbol = @symbol(AF_ATMPVC); |
|
4652 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4653 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4654 |
#ifdef AF_ATMSVC |
17910 | 4655 |
case AF_ATMSVC: |
4656 |
domainSymbol = @symbol(AF_ATMSVC); |
|
4657 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4658 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4659 |
#ifdef AF_SECURITY |
17910 | 4660 |
case AF_SECURITY: |
4661 |
domainSymbol = @symbol(AF_SECURITY); |
|
4662 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4663 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4664 |
#ifdef AF_KEY |
17910 | 4665 |
case AF_KEY: |
4666 |
domainSymbol = @symbol(AF_KEY); |
|
4667 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4668 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4669 |
#ifdef AF_NETLINK |
17910 | 4670 |
case AF_NETLINK: |
4671 |
domainSymbol = @symbol(AF_NETLINK); |
|
4672 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4673 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4674 |
#ifdef AF_PACKET |
17910 | 4675 |
case AF_PACKET: |
4676 |
domainSymbol = @symbol(AF_PACKET); |
|
4677 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4678 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4679 |
#ifdef AF_ASH |
17910 | 4680 |
case AF_ASH: |
4681 |
domainSymbol = @symbol(AF_ASH); |
|
4682 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4683 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4684 |
#ifdef AF_ECONET |
17910 | 4685 |
case AF_ECONET: |
4686 |
domainSymbol = @symbol(AF_ECONET); |
|
4687 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4688 |
#endif |
7716 | 4689 |
#ifdef AF_IMPLINK |
17910 | 4690 |
case AF_IMPLINK: |
4691 |
domainSymbol = @symbol(AF_IMPLINK); |
|
4692 |
break; |
|
7716 | 4693 |
#endif |
8784 | 4694 |
#ifdef AF_PUP |
17910 | 4695 |
case AF_PUP: |
4696 |
domainSymbol = @symbol(AF_PUP); |
|
4697 |
break; |
|
8784 | 4698 |
#endif |
7716 | 4699 |
#ifdef AF_CHAOS |
17910 | 4700 |
case AF_CHAOS: |
4701 |
domainSymbol = @symbol(AF_CHAOS); |
|
4702 |
break; |
|
7716 | 4703 |
#endif |
4704 |
#ifdef AF_DLI |
|
17910 | 4705 |
case AF_DLI: |
4706 |
domainSymbol = @symbol(AF_DLI); |
|
4707 |
break; |
|
7716 | 4708 |
#endif |
4709 |
#ifdef AF_LAT |
|
17910 | 4710 |
case AF_LAT: |
4711 |
domainSymbol = @symbol(AF_LAT); |
|
4712 |
break; |
|
7716 | 4713 |
#endif |
4714 |
#ifdef AF_HYLINK |
|
17910 | 4715 |
case AF_HYLINK: |
4716 |
domainSymbol = @symbol(AF_HYLINK); |
|
4717 |
break; |
|
7716 | 4718 |
#endif |
4719 |
#ifdef AF_FIREFOX |
|
17910 | 4720 |
case AF_FIREFOX: |
4721 |
domainSymbol = @symbol(AF_FIREFOX); |
|
4722 |
break; |
|
7716 | 4723 |
#endif |
4724 |
#ifdef AF_CLUSTER |
|
17910 | 4725 |
case AF_CLUSTER: |
4726 |
domainSymbol = @symbol(AF_CLUSTER); |
|
4727 |
break; |
|
7716 | 4728 |
#endif |
4729 |
#ifdef AF_12844 |
|
17910 | 4730 |
case AF_12844: |
4731 |
domainSymbol = @symbol(AF_12844); |
|
4732 |
break; |
|
7716 | 4733 |
#endif |
4734 |
#ifdef AF_NETDES |
|
17910 | 4735 |
case AF_NETDES: |
4736 |
domainSymbol = @symbol(AF_NETDES); |
|
4737 |
break; |
|
4738 |
#endif |
|
4739 |
} |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4740 |
} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4741 |
%}. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4742 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4743 |
^ domainSymbol. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4744 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4745 |
" |
8669 | 4746 |
self domainSymbolOf:(self domainCodeOf:#inet) |
4747 |
self domainSymbolOf:(self domainCodeOf:#inet6) |
|
4748 |
self domainSymbolOf:(self domainCodeOf:#unix) |
|
4749 |
self domainSymbolOf:(self domainCodeOf:#appletalk) |
|
4750 |
self domainSymbolOf:(self domainCodeOf:#decnet) |
|
4751 |
self domainSymbolOf:(self domainCodeOf:#raw) |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4752 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4753 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4754 |
|
8784 | 4755 |
protocolCodeOf:aSymbolOrInteger |
4756 |
"return the numeric IPPROTO_xxx code of a given symbolic protocol name. |
|
4757 |
Return nil for invalid or unsupported protocols. |
|
4758 |
For backward compatibility, the obsolete (non-IPPROTO-prefixed) names |
|
4759 |
are still supported for a while - this support will vanish." |
|
4760 |
||
4761 |
|protocolCode| |
|
4762 |
||
4763 |
%{ /*NOCONTEXT*/ |
|
4764 |
||
4765 |
if (__isSmallInteger(aSymbolOrInteger) || aSymbolOrInteger == nil) { |
|
17910 | 4766 |
RETURN (aSymbolOrInteger); |
8784 | 4767 |
} |
4768 |
||
4769 |
#ifdef IPPROTO_IP |
|
4770 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_IP)) || (aSymbolOrInteger == @symbol(ip))) |
|
8913 | 4771 |
protocolCode = __mkSmallInteger(IPPROTO_IP); |
8784 | 4772 |
#endif |
4773 |
#ifdef IPPROTO_ICMP |
|
4774 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_ICMP)) || (aSymbolOrInteger == @symbol(icmp))) |
|
8913 | 4775 |
protocolCode = __mkSmallInteger(IPPROTO_ICMP); |
8784 | 4776 |
#endif |
4777 |
#ifdef IPPROTO_IGMP |
|
4778 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_IGMP)) || (aSymbolOrInteger == @symbol(igmp))) |
|
8913 | 4779 |
protocolCode = __mkSmallInteger(IPPROTO_IGMP); |
8784 | 4780 |
#endif |
4781 |
#ifdef IPPROTO_GGP |
|
4782 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_GGP)) || (aSymbolOrInteger == @symbol(ggp))) |
|
8913 | 4783 |
protocolCode = __mkSmallInteger(IPPROTO_GGP); |
8784 | 4784 |
#endif |
4785 |
#ifdef IPPROTO_TCP |
|
4786 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_TCP)) || (aSymbolOrInteger == @symbol(tcp))) |
|
8913 | 4787 |
protocolCode = __mkSmallInteger(IPPROTO_TCP); |
8784 | 4788 |
#endif |
4789 |
#ifdef IPPROTO_UDP |
|
4790 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_UDP)) || (aSymbolOrInteger == @symbol(udp))) |
|
8913 | 4791 |
protocolCode = __mkSmallInteger(IPPROTO_UDP); |
8784 | 4792 |
#endif |
4793 |
#ifdef IPPROTO_IDP |
|
4794 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_IDP)) || (aSymbolOrInteger == @symbol(idp))) |
|
8913 | 4795 |
protocolCode = __mkSmallInteger(IPPROTO_IDP); |
8784 | 4796 |
#endif |
4797 |
#ifdef IPPROTO_ND |
|
4798 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_ND)) || (aSymbolOrInteger == @symbol(nd))) |
|
8913 | 4799 |
protocolCode = __mkSmallInteger(IPPROTO_ND); |
8784 | 4800 |
#endif |
4801 |
#ifdef IPPROTO_RAW |
|
4802 |
else if ((aSymbolOrInteger == @symbol(IPPROTO_RAW)) || (aSymbolOrInteger == @symbol(raw))) |
|
8913 | 4803 |
protocolCode = __mkSmallInteger(IPPROTO_RAW); |
8784 | 4804 |
#endif |
4805 |
%}. |
|
4806 |
||
4807 |
^ protocolCode. |
|
4808 |
||
4809 |
" |
|
4810 |
self protocolCodeOf:#IPPROTO_UDP |
|
4811 |
self protocolCodeOf:#IPPROTO_TCP |
|
4812 |
" |
|
4813 |
"for backward compatibility only: |
|
4814 |
self protocolCodeOf:#udp |
|
4815 |
self protocolCodeOf:#tcp |
|
4816 |
" |
|
4817 |
! |
|
4818 |
||
4819 |
protocolSymbolOf:anInteger |
|
4820 |
"return the symbolic protocolName of a given numeric IPPROTO_xxx code. |
|
4821 |
Return nil for invalid or unsupported protocols." |
|
4822 |
||
4823 |
|protocolSymbol| |
|
4824 |
||
4825 |
%{ /*NOCONTEXT*/ |
|
4826 |
||
4827 |
if (__isSmallInteger(anInteger)) { |
|
17910 | 4828 |
switch(__intVal(anInteger)) { |
8784 | 4829 |
#ifdef IPPROTO_IP |
17910 | 4830 |
case IPPROTO_IP: |
4831 |
// protocolSymbol = @symbol(IPPROTO_IP); |
|
4832 |
protocolSymbol = @symbol(ip); |
|
4833 |
break; |
|
8784 | 4834 |
#endif |
4835 |
#ifdef IPPROTO_ICMP |
|
17910 | 4836 |
case IPPROTO_ICMP: |
4837 |
// protocolSymbol = @symbol(IPPROTO_ICMP); |
|
4838 |
protocolSymbol = @symbol(icmp); |
|
4839 |
break; |
|
8784 | 4840 |
#endif |
4841 |
#ifdef IPPROTO_IGMP |
|
17910 | 4842 |
case IPPROTO_IGMP: |
4843 |
// protocolSymbol = @symbol(IPPROTO_IGMP); |
|
4844 |
protocolSymbol = @symbol(igmp); |
|
4845 |
break; |
|
8784 | 4846 |
#endif |
4847 |
#ifdef IPPROTO_GGP |
|
17910 | 4848 |
case IPPROTO_GGP: |
4849 |
// protocolSymbol = @symbol(IPPROTO_GGP); |
|
4850 |
protocolSymbol = @symbol(ggp); |
|
4851 |
break; |
|
8784 | 4852 |
#endif |
4853 |
#ifdef IPPROTO_TCP |
|
17910 | 4854 |
case IPPROTO_TCP: |
4855 |
// protocolSymbol = @symbol(IPPROTO_TCP); |
|
4856 |
protocolSymbol = @symbol(tcp); |
|
4857 |
break; |
|
8784 | 4858 |
#endif |
4859 |
#ifdef IPPROTO_PUP |
|
17910 | 4860 |
case IPPROTO_PUP: |
4861 |
// protocolSymbol = @symbol(IPPROTO_PUP); |
|
4862 |
protocolSymbol = @symbol(pup); |
|
4863 |
break; |
|
8784 | 4864 |
#endif |
4865 |
#ifdef IPPROTO_UDP |
|
17910 | 4866 |
case IPPROTO_UDP: |
4867 |
// protocolSymbol = @symbol(IPPROTO_UDP); |
|
4868 |
protocolSymbol = @symbol(udp); |
|
4869 |
break; |
|
8784 | 4870 |
#endif |
4871 |
#ifdef IPPROTO_IDP |
|
17910 | 4872 |
case IPPROTO_IDP: |
4873 |
// protocolSymbol = @symbol(IPPROTO_IDP); |
|
4874 |
protocolSymbol = @symbol(idp); |
|
4875 |
break; |
|
8784 | 4876 |
#endif |
4877 |
#ifdef IPPROTO_ND |
|
17910 | 4878 |
case IPPROTO_ND: |
4879 |
// protocolSymbol = @symbol(IPPROTO_ND); |
|
4880 |
protocolSymbol = @symbol(nd); |
|
4881 |
break; |
|
8784 | 4882 |
#endif |
4883 |
#ifdef IPPROTO_RAW |
|
17910 | 4884 |
case IPPROTO_RAW: |
4885 |
// protocolSymbol = @symbol(IPPROTO_RAW); |
|
4886 |
protocolSymbol = @symbol(raw); |
|
4887 |
break; |
|
4888 |
#endif |
|
4889 |
} |
|
8784 | 4890 |
} |
4891 |
%}. |
|
4892 |
||
4893 |
^ protocolSymbol. |
|
4894 |
||
4895 |
" |
|
4896 |
self protocolSymbolOf:(self protocolCodeOf:#tcp) |
|
4897 |
self protocolSymbolOf:(self protocolCodeOf:#udp) |
|
4898 |
self protocolSymbolOf:(self protocolCodeOf:#raw) |
|
4899 |
" |
|
4900 |
! |
|
4901 |
||
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4902 |
socketAddressSizeOfDomain:aSymbolOrInteger |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4903 |
"Return the os-specific size of a socket address for a domain aSymbolOrInteger. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4904 |
Return nil, if unknown or unsupported." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4905 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4906 |
|socketSize domainCode| |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4907 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4908 |
domainCode := OperatingSystem domainCodeOf:aSymbolOrInteger. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4909 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4910 |
%{ |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4911 |
if (__isSmallInteger(domainCode)) { |
17910 | 4912 |
switch (__intVal(domainCode)) { |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4913 |
#ifdef AF_INET |
17910 | 4914 |
case AF_INET: |
4915 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_in) ); |
|
4916 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4917 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4918 |
#ifdef AF_INET6 |
17910 | 4919 |
case AF_INET6: |
4920 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_in6) ); |
|
4921 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4922 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4923 |
#ifdef AF_UNIX |
17910 | 4924 |
case AF_UNIX: |
4925 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_un) ); |
|
4926 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4927 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4928 |
#ifdef AF_APPLETALK |
17910 | 4929 |
case AF_APPLETALK: |
4930 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_at) ); |
|
4931 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4932 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4933 |
#ifdef AF_DECnet |
17910 | 4934 |
case AF_DECnet: |
4935 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_dn) ); |
|
4936 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4937 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4938 |
#ifdef AF_NS |
17910 | 4939 |
case AF_NS: |
4940 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ns) ); |
|
4941 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4942 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4943 |
#ifdef AF_X25 |
17910 | 4944 |
case AF_X25: |
4945 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_x25) ); |
|
4946 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4947 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4948 |
#ifdef AF_SNA |
17910 | 4949 |
case AF_SNA: |
4950 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_sna) ); |
|
4951 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4952 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4953 |
#ifdef AF_RAW |
17910 | 4954 |
case AF_RAW: |
4955 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_raw) ); |
|
4956 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4957 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4958 |
#ifdef AF_ISO |
17910 | 4959 |
case AF_ISO: |
4960 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_iso) ); |
|
4961 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4962 |
#endif |
8784 | 4963 |
#ifdef AF_ECMA |
4964 |
# if 0 |
|
17910 | 4965 |
case AF_ECMA: |
4966 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ecma) ); |
|
4967 |
break; |
|
8784 | 4968 |
# endif |
4969 |
#endif |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4970 |
#ifdef AF_NETBIOS |
17910 | 4971 |
case AF_NETBIOS: |
4972 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_netbios) ); |
|
4973 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4974 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4975 |
#ifdef AF_NETBEUI |
17910 | 4976 |
case AF_NETBEUI: |
4977 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_netbeui) ); |
|
4978 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4979 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4980 |
#ifdef AF_IPX |
17910 | 4981 |
case AF_IPX: |
4982 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ipx) ); |
|
4983 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4984 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4985 |
#ifdef AF_AX25 |
17910 | 4986 |
case AF_AX25: |
4987 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ax25) ); |
|
4988 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4989 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4990 |
#ifdef AF_NETROM |
17910 | 4991 |
case AF_NETROM: |
4992 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_netrom) ); |
|
4993 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4994 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4995 |
#ifdef AF_BRIDGE |
17910 | 4996 |
case AF_BRIDGE: |
4997 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_bridge) ); |
|
4998 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
4999 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5000 |
#ifdef AF_BSC |
17910 | 5001 |
case AF_BSC: |
5002 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_bsc) ); |
|
5003 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5004 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5005 |
#ifdef AF_ROSE |
17910 | 5006 |
case AF_ROSE: |
5007 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_rose) ); |
|
5008 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5009 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5010 |
#ifdef AF_IRDA |
17910 | 5011 |
case AF_IRDA: |
5012 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_irda) ); |
|
5013 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5014 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5015 |
#ifdef AF_BAN |
17910 | 5016 |
case AF_BAN: |
5017 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ban) ); |
|
5018 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5019 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5020 |
#ifdef AF_VOICEVIEW |
17910 | 5021 |
case AF_VOICEVIEW: |
5022 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_voiceview) ); |
|
5023 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5024 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5025 |
#ifdef AF_ATM |
17910 | 5026 |
case AF_ATM: |
5027 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_atm) ); |
|
5028 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5029 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5030 |
#ifdef AF_ATMPVC |
17910 | 5031 |
case AF_ATMPVC: |
5032 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_atmpvc) ); |
|
5033 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5034 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5035 |
#ifdef AF_ATMSVC |
17910 | 5036 |
case AF_ATMSVC: |
5037 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_atmsvc) ); |
|
5038 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5039 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5040 |
#ifdef AF_NETLINK |
17910 | 5041 |
case AF_NETLINK: |
5042 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_netlink) ); |
|
5043 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5044 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5045 |
#ifdef AF_PACKET |
17910 | 5046 |
case AF_PACKET: |
5047 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_packet) ); |
|
5048 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5049 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5050 |
#ifdef AF_ASH |
17910 | 5051 |
case AF_ASH: |
5052 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_ash) ); |
|
5053 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5054 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5055 |
#ifdef AF_ECONET |
17910 | 5056 |
case AF_ECONET: |
5057 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_eco) ); |
|
5058 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5059 |
#endif |
7716 | 5060 |
#ifdef AF_IMPLINK |
17910 | 5061 |
case AF_IMPLINK: |
5062 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_implink) ); |
|
5063 |
break; |
|
7716 | 5064 |
#endif |
8784 | 5065 |
#ifdef AF_PUP |
5066 |
# if 0 |
|
17910 | 5067 |
case AF_PUP: |
5068 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_pup) ); |
|
5069 |
break; |
|
8784 | 5070 |
# endif |
5071 |
#endif |
|
7716 | 5072 |
#ifdef AF_CHAOS |
17910 | 5073 |
case AF_CHAOS: |
5074 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_chaos) ); |
|
5075 |
break; |
|
7716 | 5076 |
#endif |
5077 |
#ifdef AF_DLI |
|
17910 | 5078 |
case AF_DLI: |
5079 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_dli) ); |
|
5080 |
break; |
|
7716 | 5081 |
#endif |
5082 |
#ifdef AF_LAT |
|
17910 | 5083 |
case AF_LAT: |
5084 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_lat) ); |
|
5085 |
break; |
|
7716 | 5086 |
#endif |
5087 |
#ifdef AF_HYLINK |
|
17910 | 5088 |
case AF_HYLINK: |
5089 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_hylink) ); |
|
5090 |
break; |
|
7716 | 5091 |
#endif |
5092 |
#ifdef AF_FIREFOX |
|
17910 | 5093 |
case AF_FIREFOX: |
5094 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_firefox) ); |
|
5095 |
break; |
|
7716 | 5096 |
#endif |
5097 |
#ifdef AF_CLUSTER |
|
17910 | 5098 |
case AF_CLUSTER: |
5099 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_cluster) ); |
|
5100 |
break; |
|
7716 | 5101 |
#endif |
5102 |
#ifdef AF_12844 |
|
17910 | 5103 |
case AF_12844: |
5104 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_12844) ); |
|
5105 |
break; |
|
7716 | 5106 |
#endif |
5107 |
#ifdef AF_NETDES |
|
17910 | 5108 |
case AF_NETDES: |
5109 |
socketSize = __mkSmallInteger( sizeof(struct sockaddr_netdes) ); |
|
5110 |
break; |
|
5111 |
#endif |
|
5112 |
} |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5113 |
} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5114 |
%}. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5115 |
^ socketSize |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5116 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5117 |
" |
8669 | 5118 |
self socketAddressSizeOfDomain:#'AF_INET' |
5119 |
self socketAddressSizeOfDomain:#'AF_UNIX' |
|
5120 |
self socketAddressSizeOfDomain:#'Foo' |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5121 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5122 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5123 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5124 |
socketTypeCodeOf:aSymbolOrInteger |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5125 |
"return the numeric SOCK_xxx code of a given symbolic socket type name. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5126 |
Return nil for invalid or unsupported socket types." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5127 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5128 |
|typeCode| |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5129 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5130 |
%{ /*NOCONTEXT*/ |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5131 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5132 |
if (__isSmallInteger(aSymbolOrInteger) || aSymbolOrInteger == nil) { |
17910 | 5133 |
typeCode = aSymbolOrInteger; |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5134 |
} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5135 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5136 |
#ifdef SOCK_STREAM |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5137 |
else if ((aSymbolOrInteger == @symbol(stream)) || (aSymbolOrInteger == @symbol(SOCK_STREAM))) |
17910 | 5138 |
typeCode = __mkSmallInteger(SOCK_STREAM); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5139 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5140 |
#ifdef SOCK_DGRAM |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5141 |
else if ((aSymbolOrInteger == @symbol(datagram)) || (aSymbolOrInteger == @symbol(SOCK_DGRAM))) |
17910 | 5142 |
typeCode = __mkSmallInteger(SOCK_DGRAM); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5143 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5144 |
#ifdef SOCK_RAW |
8669 | 5145 |
else if ((aSymbolOrInteger == @symbol(raw)) || (aSymbolOrInteger == @symbol(SOCK_RAW))) |
17910 | 5146 |
typeCode = __mkSmallInteger(SOCK_RAW); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5147 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5148 |
#ifdef SOCK_RDM |
8669 | 5149 |
else if ((aSymbolOrInteger == @symbol(rdm)) || (aSymbolOrInteger == @symbol(SOCK_RDM))) |
17910 | 5150 |
typeCode = __mkSmallInteger(SOCK_RDM); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5151 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5152 |
#ifdef SOCK_SEQPACKET |
8669 | 5153 |
else if ((aSymbolOrInteger == @symbol(seqpacket)) || (aSymbolOrInteger == @symbol(SOCK_SEQPACKET))) |
17910 | 5154 |
typeCode = __mkSmallInteger(SOCK_SEQPACKET); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5155 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5156 |
#ifdef SOCK_PACKET |
8669 | 5157 |
else if ((aSymbolOrInteger == @symbol(packet)) || (aSymbolOrInteger == @symbol(SOCK_PACKET))) |
17910 | 5158 |
typeCode = __mkSmallInteger(SOCK_PACKET); |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5159 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5160 |
%}. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5161 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5162 |
^ typeCode. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5163 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5164 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5165 |
self socketTypeCodeOf:#stream |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5166 |
self socketTypeCodeOf:#datagram |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5167 |
self socketTypeCodeOf:#raw |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5168 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5169 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5170 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5171 |
socketTypeSymbolOf:anInteger |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5172 |
"return the symbolic typeName of a given numeric SOCK_xxx socket type code. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5173 |
Return nil for invalid or unsupported socket types." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5174 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5175 |
|socketTypeSymbol| |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5176 |
|
8669 | 5177 |
%{ /*NOCONTEXT*/ |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5178 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5179 |
if (__isSmallInteger(anInteger)) { |
17910 | 5180 |
switch(__intVal(anInteger)) { |
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5181 |
#ifdef SOCK_STREAM |
17910 | 5182 |
case SOCK_STREAM: |
5183 |
socketTypeSymbol = @symbol(SOCK_STREAM); |
|
5184 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5185 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5186 |
#ifdef SOCK_DGRAM |
17910 | 5187 |
case SOCK_DGRAM: |
5188 |
socketTypeSymbol = @symbol(SOCK_DGRAM); |
|
5189 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5190 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5191 |
#ifdef SOCK_RAW |
17910 | 5192 |
case SOCK_RAW: |
5193 |
socketTypeSymbol = @symbol(SOCK_RAW); |
|
5194 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5195 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5196 |
#ifdef SOCK_RDM |
17910 | 5197 |
case SOCK_RDM: |
5198 |
socketTypeSymbol = @symbol(SOCK_RDM); |
|
5199 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5200 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5201 |
#ifdef SOCK_SEQPACKET |
17910 | 5202 |
case SOCK_SEQPACKET: |
5203 |
socketTypeSymbol = @symbol(SOCK_SEQPACKET); |
|
5204 |
break; |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5205 |
#endif |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5206 |
#ifdef SOCK_PACKET |
17910 | 5207 |
case SOCK_PACKET: |
5208 |
socketTypeSymbol = @symbol(SOCK_PACKET); |
|
5209 |
break; |
|
5210 |
#endif |
|
5211 |
} |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5212 |
} |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5213 |
%}. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5214 |
^ socketTypeSymbol. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5215 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5216 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5217 |
supportedProtocolFamilies |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5218 |
"return a collection of supported protocol families. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5219 |
This list specifies what the Socket class supports - |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5220 |
socket creation may still fail, if your system was built without it. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5221 |
For backward compatibility, the returned list includes the old |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5222 |
(non-AF-prefixed) symbols; these will vanish." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5223 |
|
7713 | 5224 |
^ #( |
17910 | 5225 |
#AF_INET #inet |
5226 |
#AF_UNIX #unix |
|
5227 |
#AF_INET6 #inet6 |
|
5228 |
#AF_APPLETALK #appletalk |
|
5229 |
#AF_DECnet #decnet |
|
5230 |
#AF_NS #ns |
|
5231 |
#AF_X25 #x25 |
|
5232 |
#AF_SNA |
|
5233 |
#AF_RAW |
|
5234 |
#AF_ISO |
|
5235 |
#AF_ECMA |
|
5236 |
#AF_NETBIOS #netbios |
|
5237 |
#AF_IPX |
|
5238 |
#AF_AX25 |
|
5239 |
#AF_NETROM |
|
5240 |
#AF_BRIDGE |
|
5241 |
#AF_BSC |
|
5242 |
#AF_ROSE |
|
5243 |
#AF_IRDA #irda |
|
5244 |
#AF_NETLINK |
|
5245 |
#AF_NETLINK |
|
5246 |
#AF_NETBEUI |
|
5247 |
#AF_ATM |
|
5248 |
#AF_ATMPVC |
|
5249 |
#AF_ATMSVC |
|
5250 |
#AF_BAN |
|
5251 |
#AF_VOICEVIEW |
|
5252 |
#AF_ECONET |
|
5253 |
#AF_IMPLINK |
|
5254 |
#AF_PUP |
|
5255 |
#AF_CHAOS |
|
5256 |
#AF_DLI |
|
5257 |
#AF_LAT |
|
5258 |
#AF_HYLINK |
|
5259 |
#AF_FIREFOX |
|
5260 |
#AF_CLUSTER |
|
5261 |
#AF_12844 |
|
5262 |
#AF_NETDES |
|
8669 | 5263 |
) select:[:sym | (AbstractOperatingSystem domainCodeOf:sym) isNumber ] |
5264 |
||
5265 |
" |
|
5266 |
AbstractOperatingSystem supportedProtocolFamilies |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5267 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5268 |
! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5269 |
|
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5270 |
supportedSocketTypes |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5271 |
"return the symbolic typeName of a given numeric SOCK_xxx socket type code. |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5272 |
Return nil for invalid or unsupported socket types." |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5273 |
|
7713 | 5274 |
^ #( |
17910 | 5275 |
#SOCK_STREAM |
5276 |
#SOCK_DGRAM |
|
5277 |
#SOCK_RAW |
|
5278 |
#SOCK_RDM |
|
5279 |
#SOCK_SEQPACKET |
|
5280 |
#SOCK_PACKET |
|
8669 | 5281 |
) select:[:sym | (AbstractOperatingSystem socketTypeCodeOf:sym) isNumber ] |
7713 | 5282 |
|
5283 |
" |
|
5284 |
AbstractOperatingSystem supportedSocketTypes |
|
7509
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5285 |
" |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5286 |
! ! |
c8964822d8fd
moved all socket constant queries from SocketHandle
Claus Gittinger <cg@exept.de>
parents:
7507
diff
changeset
|
5287 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5288 |
!AbstractOperatingSystem class methodsFor:'shared memory access'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5289 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5290 |
shmAttach:id address:addr flags:flags |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5291 |
"low level entry to shmat()-system call. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5292 |
Not supported on all operatingSystems" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5293 |
|
4204 | 5294 |
^ UnsupportedOperationSignal raise |
5295 |
||
5296 |
"Modified: / 19.5.1999 / 14:21:35 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5297 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5298 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5299 |
shmDetach:addr |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5300 |
"low level entry to shmdt()-system call. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5301 |
Not supported on all operatingSystems" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5302 |
|
4204 | 5303 |
^ UnsupportedOperationSignal raise |
5304 |
||
5305 |
"Modified: / 19.5.1999 / 14:21:37 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5306 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5307 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5308 |
shmGet:key size:size flags:flags |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5309 |
"low level entry to shmget()-system call. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5310 |
This is not for public use and not supported with all operatingSystems. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5311 |
- use the provided wrapper class SharedExternalBytes instead." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5312 |
|
4204 | 5313 |
^ UnsupportedOperationSignal raise |
5314 |
||
5315 |
"Modified: / 19.5.1999 / 14:21:41 / cg" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5316 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5317 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5318 |
!AbstractOperatingSystem class methodsFor:'time and date'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5319 |
|
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5320 |
computeDatePartsOf:osTime for:aBlock |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5321 |
"compute year, month and day from the OS time, osTime |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5322 |
and evaluate the argument, a 3-arg block with these. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5323 |
Conversion is to localtime including any daylight saving adjustments." |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5324 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5325 |
<resource:#obsolete> |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5326 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5327 |
|i| |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5328 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5329 |
self obsoleteMethodWarning:'use #computeTimeAndDateFrom:osTime'. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5330 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5331 |
i := self computeTimeAndDateFrom:osTime. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5332 |
aBlock value:i year value:i month value:i day |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5333 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5334 |
" |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5335 |
OperatingSystem computeDatePartsOf:0 for:[:y :m :d | |
17910 | 5336 |
y printCR. m printCR. d printCR |
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5337 |
] |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5338 |
" |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5339 |
! |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5340 |
|
4377
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5341 |
computeOSTimeFromUTCYear:y month:m day:d hour:h minute:min second:s millisecond:millis |
8669 | 5342 |
"return the OS-dependent time for the given time and day. |
4377
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5343 |
The arguments are assumed to be in UTC Time" |
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5344 |
|
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5345 |
self subclassResponsibility |
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5346 |
|
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5347 |
"Created: / 13.7.1999 / 12:44:03 / stefan" |
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5348 |
! |
59bb21ad2839
New method to compute Time form UTC.
Stefan Vogel <sv@exept.de>
parents:
4240
diff
changeset
|
5349 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5350 |
computeOSTimeFromYear:y month:m day:d hour:h minute:min seconds:s millis:millis |
8669 | 5351 |
"return the OS-dependent time for the given time and day. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5352 |
The arguments are assumed to be in localtime including |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5353 |
any daylight saving adjustings." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5354 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5355 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5356 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5357 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5358 |
computeTimeAndDateFrom:osTime |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5359 |
"given an OS-dependent time in osTime, return an Array |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5360 |
containing (full-) year, month, day, hour, minute and seconds, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5361 |
offset to UTC, daylight savings time flag, milliseconds, |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5362 |
dayInYear (1..) and dayInWeek (1..). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5363 |
Conversion is to localtime including any daylight saving adjustments." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5364 |
|
7733 | 5365 |
|divMod ret| |
5366 |
||
5367 |
divMod := osTime divMod:1000. |
|
7739
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5368 |
ret := self timeInfoFromSeconds:(divMod at:1) milliseconds:(divMod at:2) localTime:true. |
7514 | 5369 |
^ ret |
5370 |
||
5371 |
" |
|
5372 |
OperatingSystem computeTimeAndDateFrom:0 |
|
5373 |
OperatingSystem computeTimeAndDateFrom:1011 |
|
5374 |
" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5375 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5376 |
|
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5377 |
computeTimePartsOf:osTime for:aBlock |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5378 |
"compute hours, minutes, seconds and milliseconds from the local osTime |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5379 |
and evaluate the argument, a 4-arg block with these. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5380 |
Conversion is to localtime including any daylight saving adjustments." |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5381 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5382 |
<resource:#obsolete> |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5383 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5384 |
|hours minutes seconds millis i| |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5385 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5386 |
self obsoleteMethodWarning:'use #computeTimeAndDateFrom:osTime'. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5387 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5388 |
i := self computeTimeAndDateFrom:osTime. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5389 |
hours := i hours. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5390 |
minutes := i minutes. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5391 |
seconds := i seconds. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5392 |
millis := i milliseconds. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5393 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5394 |
aBlock value:hours value:minutes value:seconds value:millis |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5395 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5396 |
" |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5397 |
OperatingSystem computeTimePartsOf:100 for:[:h :m :s :milli | |
17910 | 5398 |
Transcript show:h; space; show:m; space; show:s; space; showCR:milli. |
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5399 |
] |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5400 |
" |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5401 |
! |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5402 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5403 |
computeUTCTimeAndDateFrom:osTime |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5404 |
"given an OS-dependent time in osTime, return an Array |
7514 | 5405 |
containing: |
17910 | 5406 |
(full-) year, |
5407 |
month, (1..) |
|
5408 |
day, (1..) |
|
5409 |
hour, (0..23) |
|
5410 |
minute (0..59) |
|
5411 |
seconds, (0..59) |
|
5412 |
offset to UTC, (seconds) |
|
5413 |
daylight savings time flag, |
|
5414 |
milliseconds, (0..999) |
|
5415 |
dayInYear (1..) |
|
5416 |
dayInWeek (1..). |
|
7514 | 5417 |
Conversion is to utc." |
5418 |
||
7733 | 5419 |
|divMod ret| |
5420 |
||
5421 |
divMod := osTime divMod:1000. |
|
7739
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5422 |
ret := self timeInfoFromSeconds:(divMod at:1) milliseconds:(divMod at:2) localTime:false. |
7514 | 5423 |
^ ret |
5424 |
||
5425 |
" |
|
8669 | 5426 |
OperatingSystem computeUTCTimeAndDateFrom:0 |
7514 | 5427 |
OperatingSystem computeUTCTimeAndDateFrom:1011 |
5428 |
" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5429 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5430 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5431 |
computeUTCTimePartsOf:osTime for:aBlock |
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5432 |
"compute hours, minutes, seconds and milliseconds from the osTime |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5433 |
and evaluate the argument, a 4-arg block with these. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5434 |
Conversion is to UTC." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5435 |
|
8565
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5436 |
<resource:#obsolete> |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5437 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5438 |
|hours minutes seconds millis i| |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5439 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5440 |
self obsoleteMethodWarning:'use #computeTimeAndDateFrom:osTime'. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5441 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5442 |
i := self computeUTCTimeAndDateFrom:osTime. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5443 |
hours := i hours. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5444 |
minutes := i minutes. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5445 |
seconds := i seconds. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5446 |
millis := i milliseconds. |
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5447 |
|
6c5af0dd0269
Moved OS-independent obsolete methods from UnixOperatingSystem
Stefan Vogel <sv@exept.de>
parents:
8505
diff
changeset
|
5448 |
aBlock value:hours value:minutes value:seconds value:millis |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5449 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5450 |
|
17909 | 5451 |
getCPUCycleCount |
5452 |
"get a CPU specific cycle counter value. |
|
5453 |
Can be used for exact timing & performance measurements. |
|
5454 |
Notice, that the # of cycles has to be multiplied by the cycle time (1/cpu-frequency). |
|
5455 |
||
5456 |
For x86: |
|
17910 | 5457 |
the CPU cycle count register value is returned (RDTSC instruction). |
5458 |
Fails if RDTSC instruction is not supported (which is unlikely, nowadays). |
|
17909 | 5459 |
For others: |
17910 | 5460 |
currently fails" |
17909 | 5461 |
|
5462 |
%{ /* NOCONTEXT */ |
|
5463 |
unsigned int low, high; |
|
5464 |
||
5465 |
#ifdef i386 |
|
5466 |
// use RDTSC instruction (retrieves 64bit cycle count; hi in EDX, lo in EAX) |
|
5467 |
||
5468 |
# if defined(__BORLANDC__) |
|
5469 |
_asm { push edx }; |
|
5470 |
__emit__(0x0F,0x31); /* RDTSC instruction */ |
|
17910 | 5471 |
_asm { mov low,eax }; |
17909 | 5472 |
_asm { mov high,edx }; |
5473 |
_asm { pop edx }; |
|
5474 |
# elif defined(__MINGW_H) || defined(__GNUC__) |
|
5475 |
asm volatile("rdtsc" : "=a"(low), "=d"(high)); |
|
5476 |
# else |
|
5477 |
goto unsupported; |
|
5478 |
# endif |
|
5479 |
#endif /* i386 */ |
|
5480 |
||
5481 |
RETURN ( __MKLARGEINT64(1, low, high) ); |
|
5482 |
unsupported: ; |
|
5483 |
%}. |
|
5484 |
self primitiveFailed:'no CPU cycle register on this architecture' |
|
5485 |
||
5486 |
"Created: / 05-01-2012 / 13:23:31 / cg" |
|
5487 |
! |
|
5488 |
||
3689
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5489 |
getMicrosecondTime |
8669 | 5490 |
"This returns the microsecond timers value - if available. |
3689
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5491 |
On some machines, times with this precision may not be available, |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5492 |
on those, the returned value may be rounded towards some internal |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5493 |
clock resolution value." |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5494 |
|
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5495 |
"/ fallBack - use getMillisecondTime, which must be implemented |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5496 |
"/ for all OS's |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5497 |
|
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5498 |
^ self getMillisecondTime * 1000 |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5499 |
|
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5500 |
"Created: / 30.7.1998 / 16:38:26 / cg" |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5501 |
! |
f3351f92641e
added abstract for getMicrosecondTime
Claus Gittinger <cg@exept.de>
parents:
3576
diff
changeset
|
5502 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5503 |
getMillisecondTime |
8669 | 5504 |
"This returns the millisecond timers value. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5505 |
The range is limited to 0..1fffffff (i.e. the SmallInteger range) to avoid |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5506 |
LargeInteger arithmetic when doing timeouts and delays. |
8669 | 5507 |
Since this value is wrapping around in regular intervals, this can only be used for |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5508 |
short relative time deltas. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5509 |
Use the millisecondTimeXXX:-methods to compare and add time deltas - these know about the wrap. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5510 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5511 |
BAD DESIGN: |
17910 | 5512 |
This should be changed to return some instance of RelativeTime, |
5513 |
and these computations moved there. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5514 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5515 |
Dont use this method in application code since it is an internal (private) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5516 |
interface. For compatibility with ST-80, use Time millisecondClockValue. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5517 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5518 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5519 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5520 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5521 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5522 |
getOSTime |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5523 |
"This returns the OS time. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5524 |
The base of the returned value is not consistent across |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5525 |
different OS's - some return the number of millis since jan, 1st 1970; |
8669 | 5526 |
others since 1900. The Time classes are prepared for this, and |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5527 |
converts as appropriate (by using my fromOSTime: conversion methods). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5528 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5529 |
Dont use this method in application code since it is an internal (private) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5530 |
interface. For compatibility with ST-80, use Time>>millisecondClockValue. |
8250
83c16e036200
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8236
diff
changeset
|
5531 |
or use instances of Time, Date or Timestamp to work with. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5532 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5533 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5534 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5535 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5536 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5537 |
maximumMillisecondTimeDelta |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5538 |
"this returns the maximum delta supported by millisecondCounter |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5539 |
based methods. The returned value is half the value at which the |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5540 |
timer wraps." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5541 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5542 |
%{ /* NOCONTEXT */ |
8913 | 5543 |
RETURN ( __mkSmallInteger(0x0FFFFFFF) ); |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5544 |
%} |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5545 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5546 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5547 |
millisecondDelay:millis |
7681
7c63f0b47f0d
oops: millisecondDelay: was duplicated
Claus Gittinger <cg@exept.de>
parents:
7656
diff
changeset
|
5548 |
"delay execution for millis milliseconds or until the next event arrives. |
8669 | 5549 |
All other threads proceed as usual. |
7849 | 5550 |
Better use a Delay, however, a delay cannot be used in the event handler or scheduler." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5551 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5552 |
|now then delta| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5553 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5554 |
now := self getMillisecondTime. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5555 |
then := self millisecondTimeAdd:now and:millis. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5556 |
|
11163
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
5557 |
[(delta := self millisecondTimeDeltaBetween:then and:now) > 0] whileTrue:[ |
17910 | 5558 |
self selectOnAnyReadable:nil writable:nil exception:nil withTimeOut:delta. |
5559 |
now := self getMillisecondTime. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5560 |
] |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5561 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5562 |
" |
7849 | 5563 |
OperatingSystem millisecondDelay:5000 |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5564 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5565 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5566 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5567 |
millisecondTime:msTime1 isAfter:msTime2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5568 |
"return true if msTime1 is after msTime2, false if not. |
8669 | 5569 |
The two arguments are supposed to be millisecond times |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5570 |
(such as returned getMillisecondTime) which wrap at 16r1FFFFFFF. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5571 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5572 |
This should really be moved to some RelativeTime class." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5573 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5574 |
(msTime1 > msTime2) ifTrue:[ |
17910 | 5575 |
((msTime1 - msTime2) < 16r10000000) ifTrue:[ |
5576 |
^ true |
|
5577 |
]. |
|
11163
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
5578 |
] ifFalse:[ |
17910 | 5579 |
((msTime2 - msTime1) > 16r10000000) ifTrue:[ |
5580 |
^ true |
|
5581 |
]. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5582 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5583 |
^ false |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5584 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5585 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5586 |
millisecondTimeAdd:msTime1 and:msTime2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5587 |
"Add two millisecond times (such as returned getMillisecondTime). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5588 |
The returned value is msTime1 + msTime2 where a wrap occurs at:16r1FFFFFFF. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5589 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5590 |
This should really be moved to some RelativeTime class." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5591 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5592 |
|sum| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5593 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5594 |
sum := msTime1 + msTime2. |
17892 | 5595 |
(sum > 16r1FFFFFFF) ifTrue:[ |
17910 | 5596 |
self assert:(sum <= 16r3FFFFFFF) message:'overflow in timer computation'. |
5597 |
^ sum - 16r20000000. |
|
17892 | 5598 |
]. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5599 |
(sum < 0) ifTrue:[^ sum + 16r20000000]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5600 |
^ sum |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5601 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5602 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5603 |
millisecondTimeDeltaBetween:msTime1 and:msTime2 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5604 |
"subtract two millisecond times (such as returned getMillisecondTime) |
8669 | 5605 |
and return the difference. Since milli-times wrap (at 16r01FFFFFFF), |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5606 |
some special handling is built-in here. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5607 |
The returned value is msTime1 - msTime2. The returned value is invalid |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5608 |
if the delta is >= 0x10000000. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5609 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5610 |
This should really be moved to some RelativeTime class; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5611 |
better yet: create a subclass of Integer named LimitedRangeInteger." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5612 |
|
11163
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
5613 |
|diff| |
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
5614 |
|
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
5615 |
diff := msTime1 - msTime2. |
11166
52c2ccfc0d4c
Make last change better looking
Stefan Vogel <sv@exept.de>
parents:
11165
diff
changeset
|
5616 |
diff > 16r-10000000 ifTrue:[ |
17910 | 5617 |
(diff < 16r10000000) ifTrue:[ |
5618 |
^ diff. |
|
5619 |
] ifFalse:[ |
|
5620 |
^ diff - 16r20000000. |
|
5621 |
]. |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5622 |
]. |
11163
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
5623 |
^ diff + 16r20000000 |
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
5624 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5625 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5626 |
" |
8669 | 5627 |
OperatingSystem millisecondTimeAdd:16r0FFFFFFF and:1 |
5628 |
OperatingSystem millisecondTimeAdd:16r0FFFFFFF and:(16 / 3) |
|
5629 |
OperatingSystem millisecondTimeAdd:16r0FFFFFFF and:1000 |
|
5630 |
||
5631 |
OperatingSystem millisecondTimeDeltaBetween:0 and:16r0FFFFFFF |
|
11163
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
5632 |
OperatingSystem millisecondTimeDeltaBetween:0 and:16r1FFFFFFF |
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
5633 |
OperatingSystem millisecondTimeDeltaBetween:16r1FFFFFFF and:0 |
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
5634 |
|
8669 | 5635 |
OperatingSystem millisecondTimeDeltaBetween:(13/3) and:16r0FFFFFFF |
5636 |
OperatingSystem millisecondTimeDeltaBetween:999 and:16r0FFFFFFF |
|
5637 |
||
5638 |
OperatingSystem millisecondTime:0 isAfter:16r0FFFFFFF |
|
11163
be8400d459aa
#milliSecondsTimeDeltaBetween:and:
Stefan Vogel <sv@exept.de>
parents:
10734
diff
changeset
|
5639 |
OperatingSystem millisecondTime:0 isAfter:16r1FFFFFFF |
8669 | 5640 |
OperatingSystem millisecondTime:(13/3) isAfter:16r0FFFFFFF |
5641 |
OperatingSystem millisecondTime:999 isAfter:16r0FFFFFFF |
|
5642 |
||
5643 |
OperatingSystem millisecondTime:0 isAfter:0 |
|
5644 |
OperatingSystem millisecondTime:(13/3) isAfter:0 |
|
5645 |
OperatingSystem millisecondTime:999 isAfter:0 |
|
5646 |
||
5647 |
OperatingSystem millisecondTime:1 isAfter:0 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5648 |
OperatingSystem millisecondTime:(13/3) isAfter:2 |
8669 | 5649 |
OperatingSystem millisecondTime:999 isAfter:900 |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5650 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5651 |
|t1 t2| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5652 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5653 |
t1 := Time millisecondClockValue. |
8669 | 5654 |
(Delay forMilliseconds:1) wait. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5655 |
t2 := Time millisecondClockValue. |
8669 | 5656 |
OperatingSystem millisecondTimeDeltaBetween:t2 and:t1 |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5657 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5658 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5659 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5660 |
sleep:numberOfSeconds |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5661 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5662 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5663 |
"cease ANY action for some time. This suspends the whole smalltalk |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5664 |
(unix-) process for some time. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5665 |
Not really useful since not even low-prio processes and interrupt |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5666 |
handling will run during the sleep. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5667 |
Use either OperatingSystem>>millisecondDelay: (which makes all |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5668 |
threads sleep, but handles interrupts) or use a Delay (which makes |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5669 |
only the calling thread sleep)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5670 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5671 |
self subclassResponsibility |
7514 | 5672 |
! |
5673 |
||
5674 |
timeInfoClass |
|
5675 |
^ TimeInfo |
|
5676 |
! |
|
5677 |
||
5678 |
timeInfoFromSeconds:osSeconds localTime:isLocalTime |
|
5679 |
"return a timeInfo structure containing values for the given OS-second value. |
|
5680 |
An internal helper" |
|
5681 |
||
7739
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5682 |
^ self timeInfoFromSeconds:osSeconds milliseconds:0 localTime:isLocalTime |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5683 |
! |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5684 |
|
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5685 |
timeInfoFromSeconds:osSeconds milliseconds:osMilliSeconds localTime:isLocalTime |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5686 |
"return a timeInfo structure containing values for the given OS-second value. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5687 |
An internal helper" |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
5688 |
|
7514 | 5689 |
self subclassResponsibility |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5690 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5691 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5692 |
!AbstractOperatingSystem class methodsFor:'users & groups'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5693 |
|
17795 | 5694 |
getApplicationDataDirectoryFor:appName |
5695 |
"return the directory, where user-and-application-specific private files are to be |
|
5696 |
located (ini-files, preferences etc.). |
|
5697 |
Under windows, something like 'C:\Users\Administrator\AppData\Roaming\<appName>' |
|
5698 |
is returned, here, the fallback ~/.<appName> is returned. |
|
5699 |
Notice that only the name is returned; the directory is not guaranteed to exist." |
|
5700 |
||
5701 |
"{ Pragma: +optSpace }" |
|
5702 |
||
5703 |
^ self getHomeDirectory asFilename constructString:('.',appName) |
|
5704 |
||
5705 |
" |
|
17910 | 5706 |
OperatingSystem getApplicationDataDirectoryFor:'expecco' |
17795 | 5707 |
" |
5708 |
||
5709 |
"Created: / 29-07-2010 / 12:07:25 / sr" |
|
5710 |
! |
|
5711 |
||
10544 | 5712 |
getDesktopDirectory |
5713 |
"{ Pragma: +optSpace }" |
|
5714 |
||
5715 |
"return the name of the users desktop directory. |
|
5716 |
The fallback here returns the users home directory." |
|
5717 |
||
10545 | 5718 |
^ self getHomeDirectory |
5719 |
||
5720 |
" |
|
17910 | 5721 |
OperatingSystem getDesktopDirectory |
10544 | 5722 |
" |
5723 |
||
5724 |
"Created: / 16-05-2007 / 13:20:53 / cg" |
|
5725 |
! |
|
5726 |
||
11760 | 5727 |
getDocumentsDirectory |
5728 |
"return your documents directory. |
|
5729 |
Under windows, thats the real 'Documents' or 'My Documents'. |
|
5730 |
The fallback here returns the users home directory." |
|
5731 |
||
5732 |
"{ Pragma: +optSpace }" |
|
5733 |
||
5734 |
^ self getHomeDirectory |
|
5735 |
||
5736 |
" |
|
17910 | 5737 |
OperatingSystem getDocumentsDirectory |
11760 | 5738 |
" |
5739 |
! |
|
5740 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5741 |
getEffectiveGroupID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5742 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5743 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5744 |
"return the current users (thats you) effective numeric group id. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5745 |
This is only different from getGroupID, if you have ST/X running |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5746 |
as a setuid program (of which you should think about twice)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5747 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5748 |
^ self getGroupID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5749 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5750 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5751 |
OperatingSystem getEffectiveGroupID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5752 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5753 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5754 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5755 |
getEffectiveUserID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5756 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5757 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5758 |
"return the current users (thats you) effective numeric user id. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5759 |
This is only different from getUserID, if you have ST/X running |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5760 |
as a setuid program (of which you should think about twice)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5761 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5762 |
^ self getUserID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5763 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5764 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5765 |
OperatingSystem getEffectiveUserID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5766 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5767 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5768 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5769 |
getFullUserName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5770 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5771 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5772 |
"return a string with the users full name (thats you) - if available. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5773 |
If not, return the login name as a fallBack." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5774 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5775 |
^ self getFullUserNameFromID:(self getUserID) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5776 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5777 |
" |
8669 | 5778 |
OperatingSystem getFullUserName |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5779 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5780 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5781 |
"Modified: 24.1.1997 / 11:31:55 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5782 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5783 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5784 |
getFullUserNameFromID:userID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5785 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5786 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5787 |
"return a string with the users full name - if available. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5788 |
If not, return the login name as a fallBack." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5789 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5790 |
^ self getUserNameFromID:userID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5791 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5792 |
" |
8669 | 5793 |
OperatingSystem getFullUserNameFromID:0 |
5794 |
OperatingSystem getFullUserNameFromID:(OperatingSystem getUserID) |
|
5795 |
||
5796 |
OperatingSystem getUserNameFromID:(OperatingSystem getUserID) |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5797 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5798 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5799 |
"Modified: 15.7.1996 / 12:44:21 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5800 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5801 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5802 |
getGroupID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5803 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5804 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5805 |
"return the current users (thats you) numeric group id" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5806 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5807 |
^ 1 "/ just a dummy for systems which do not have userIDs |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5808 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5809 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5810 |
OperatingSystem getGroupID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5811 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5812 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5813 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5814 |
getGroupNameFromID:aNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5815 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5816 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5817 |
"return the group-name-string for a given numeric group-id" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5818 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5819 |
^ '???' "/ just a dummy for systems which do not have groups |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5820 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5821 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5822 |
OperatingSystem getGroupNameFromID:0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5823 |
OperatingSystem getGroupNameFromID:10 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5824 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5825 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5826 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5827 |
getHomeDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5828 |
"return the name of the users home directory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5829 |
(i.e. yours)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5830 |
|
11760 | 5831 |
^ self subclassResponsibility |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5832 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5833 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5834 |
OperatingSystem getHomeDirectory |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5835 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5836 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5837 |
"Modified: 24.1.1997 / 11:32:13 / cg" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5838 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5839 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5840 |
getLoginName |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5841 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5842 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5843 |
"return a string with the users login name (thats yours)" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5844 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5845 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5846 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5847 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5848 |
getUserID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5849 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5850 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5851 |
"return the current users (thats you) numeric user id" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5852 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5853 |
^ 1 "just a dummy for systems which do not have userIDs" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5854 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5855 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5856 |
OperatingSystem getUserID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5857 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5858 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5859 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5860 |
getUserNameFromID:aNumber |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5861 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5862 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5863 |
"return the user-name-string for a given numeric user-id. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5864 |
This is the login name, not the fullName." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5865 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5866 |
"/ fallBack dummy |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5867 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5868 |
aNumber == self getUserID ifTrue:[ |
17910 | 5869 |
^ self getLoginName |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5870 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5871 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5872 |
^ '? (' , aNumber printString , ')' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5873 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5874 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5875 |
OperatingSystem getUserNameFromID:0 |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5876 |
OperatingSystem getUserNameFromID:100 |
8669 | 5877 |
OperatingSystem getUserNameFromID:9991 |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5878 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5879 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5880 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5881 |
userInfoOf:aNameOrID |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5882 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5883 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5884 |
"return a dictionary filled with userinfo. The argument can be either |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5885 |
a string with the users name or its numeric id. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5886 |
Notice, that not all systems provide (all of) this info; |
8669 | 5887 |
DOS systems return nothing; |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5888 |
non-SYSV4 systems have no age/comment. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5889 |
Portable applications may want to check the systemType and NOT depend |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5890 |
on all keys to be present in the returned dictionary. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5891 |
Another notice: on some systems (SYSV4), the gecos field includes multiple |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5892 |
entries (i.e. not just the name), separated by commas. You may want to |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5893 |
extract any substring, up to the first comma to get the real life name." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5894 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5895 |
|info| |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5896 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5897 |
"/ fallBack dummy |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5898 |
info := IdentityDictionary new. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5899 |
info at:#name put:(self getLoginName). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5900 |
info at:#dir put:(self getHomeDirectory). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5901 |
^ info |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5902 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5903 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5904 |
OperatingSystem userInfoOf:'root' |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5905 |
OperatingSystem userInfoOf:1 |
8669 | 5906 |
OperatingSystem userInfoOf:'claus' |
5907 |
OperatingSystem userInfoOf:'fooBar' |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5908 |
OperatingSystem userInfoOf:(OperatingSystem getUserID) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5909 |
" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5910 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5911 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5912 |
!AbstractOperatingSystem class methodsFor:'waiting for events'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5913 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5914 |
blockingChildProcessWait |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5915 |
"return true, if childProcessWait: blocks, if no children are ready. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5916 |
On those systems, we must be somewhat careful when looking out for |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5917 |
a subprocesses status (to avoid blocking)." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5918 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5919 |
^ true |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5920 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5921 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5922 |
childProcessWait:blocking pid:pidToWait |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5923 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5924 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5925 |
"get status changes from child processes. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5926 |
Return an OSProcessStatus or nil, if no process has terminated. |
8669 | 5927 |
If blocking is true, we wait until a process changed state, |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5928 |
otherwise we return immediately. |
8669 | 5929 |
Note that win32 needs to know the HANDLE of the process on which |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5930 |
it waits. In case of an error, THIS ALWAYS WAITS and then times out." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5931 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5932 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5933 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5934 |
|
7802 | 5935 |
isBlockingOn:fd |
5936 |
"{ Pragma: +optSpace }" |
|
5937 |
||
5938 |
"return the blocking attribute - if set (which is the default) |
|
5939 |
a read on the fileDescriptor will block until data is available. |
|
5940 |
If clear, a read operation will immediately return with a value nil. |
|
5941 |
Also affects write operations, which may perform partial writes when |
|
5942 |
blocking is off" |
|
5943 |
||
5944 |
self subclassResponsibility |
|
5945 |
! |
|
5946 |
||
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5947 |
numAvailableForReadOn:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5948 |
"return the number of bytes available for reading, without blocking." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5949 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5950 |
"/ fallBack for systems which do not provide this info |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5951 |
^ (self readCheck:fd) ifTrue:[1] ifFalse:[0] |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5952 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5953 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5954 |
readCheck:fd |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
5955 |
"return true, if a read is possible without blocking. |
17910 | 5956 |
This is the case if data is available on a filedescriptor |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
5957 |
or the read would return an error. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5958 |
This depends on a working select or FIONREAD to be provided by the OS." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5959 |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
5960 |
|result| |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
5961 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5962 |
self supportsSelect ifFalse:[ |
17910 | 5963 |
"/ mhmh - what should we do then ? |
5964 |
"/ For now, return true as if data was present, |
|
5965 |
"/ and let the thread fall into the read. |
|
5966 |
"/ It will then (hopefully) be descheduled there and |
|
5967 |
"/ effectively polling for input. |
|
5968 |
||
5969 |
^ true |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5970 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5971 |
|
17910 | 5972 |
result := self |
5973 |
selectOnAnyReadable:(Array with:fd) |
|
5974 |
writable:nil |
|
5975 |
exception:nil |
|
5976 |
withTimeOut:0. |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
5977 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
5978 |
"on select error, a read will immediately return, so answer true" |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
5979 |
^ result == fd or:[result == #error]. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5980 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5981 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5982 |
readWriteCheck:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5983 |
"return true, if filedescriptor can be read or written without blocking. |
17910 | 5984 |
This is the case if data is available on a filedescriptor |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
5985 |
or the read or write would return an error. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5986 |
This is actually only used with sockets, to wait for a connect to |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5987 |
be finished." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5988 |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
5989 |
|result| |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
5990 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5991 |
self supportsSelect ifFalse:[ |
17910 | 5992 |
"/ mhmh - what should we do then ? |
5993 |
"/ For now, return true as if data was present, |
|
5994 |
"/ and let the thread fall into the write. |
|
5995 |
"/ It will then (hopefully) be desceduled there and |
|
5996 |
"/ effectively polling for output. |
|
5997 |
^ true |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5998 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5999 |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6000 |
result := self selectOnAnyReadable:(Array with:fd) |
17910 | 6001 |
writable:(Array with:fd) |
6002 |
exception:nil |
|
6003 |
withTimeOut:0. |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6004 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6005 |
^ result == fd or:[result == #error]. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6006 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6007 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6008 |
selectOn:fd1 and:fd2 withTimeOut:millis |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6009 |
<resource: #obsolete> |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6010 |
"wait for any fd to become ready; timeout after t milliseconds. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6011 |
A zero timeout-time will immediately return (i.e. poll). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6012 |
Return fd if i/o ok, nil if timed-out or interrupted. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6013 |
Obsolete: |
17910 | 6014 |
This is a leftover method and will vanish." |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6015 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6016 |
^ self selectOnAnyReadable:(Array with:fd1 with:fd2) |
17910 | 6017 |
writable:(Array with:fd1 with:fd2) |
6018 |
exception:nil |
|
6019 |
withTimeOut:millis |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6020 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6021 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6022 |
selectOn:fd withTimeOut:millis |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6023 |
"wait for aFileDesriptor to become ready; timeout after t milliseconds. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6024 |
Return true, if i/o ok, false if timed-out or interrupted. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6025 |
With 0 as timeout argument, this can be used to check for availability |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6026 |
of read-data. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6027 |
Experimental." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6028 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6029 |
^ self selectOnAnyReadable:(Array with:fd) |
17910 | 6030 |
writable:(Array with:fd) |
6031 |
exception:nil |
|
6032 |
withTimeOut:millis |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6033 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6034 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6035 |
selectOnAny:fdArray withTimeOut:millis |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6036 |
"wait for any fd in fdArray (an Array of integers) to become ready; |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6037 |
timeout after t milliseconds. An empty set will always wait. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6038 |
Return first ready fd if i/o ok, nil if timed-out or interrupted. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6039 |
Experimental." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6040 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6041 |
^ self selectOnAnyReadable:fdArray |
17910 | 6042 |
writable:fdArray |
6043 |
exception:nil |
|
6044 |
withTimeOut:millis |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6045 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6046 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6047 |
selectOnAnyReadable:fdArray withTimeOut:millis |
8669 | 6048 |
"wait for any fd in fdArray (an Array of integers) to become ready for |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6049 |
reading. Timeout after t milliseconds. An empty set will always wait. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6050 |
A zero timeout-time will immediately return (i.e. poll). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6051 |
Return first ready fd if i/o ok, nil if timed-out or interrupted. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6052 |
Experimental." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6053 |
|
8669 | 6054 |
^ self selectOnAnyReadable:fdArray |
17910 | 6055 |
writable:nil |
6056 |
exception:nil |
|
6057 |
withTimeOut:millis |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6058 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6059 |
|
8669 | 6060 |
selectOnAnyReadable:readFdArray writable:writeFdArray exception:exceptFdArray |
17910 | 6061 |
readableInto:readableResultFdArray writableInto:writableResultFdArray |
6062 |
exceptionInto:exceptionResultFdArray |
|
6063 |
withTimeOut:millis |
|
7510
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6064 |
|
8669 | 6065 |
"wait for any fd in readFdArray (an Array of integers) to become ready for reading, |
6066 |
writeFdArray to become ready for writing, |
|
7510
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6067 |
or exceptFdArray to arrive exceptional data (i.e. out-of-band data). |
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6068 |
Timeout after t milliseconds or - if the timeout time is 0 - immediately.. |
7492
f2bf4935e7eb
New select for fair scheduling (not giving low filedescriptors
Stefan Vogel <sv@exept.de>
parents:
7488
diff
changeset
|
6069 |
Empty fd-sets will always wait. Zero time can be used to poll file- |
f2bf4935e7eb
New select for fair scheduling (not giving low filedescriptors
Stefan Vogel <sv@exept.de>
parents:
7488
diff
changeset
|
6070 |
descriptors (i.e. to check if I/O possible without blocking). |
7510
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6071 |
The corresponding filedescriptors which are ready are returned in readableResultFdArray, |
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6072 |
writableResultFdArray and exceptionResultFdArray respectively. |
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6073 |
|
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6074 |
Return the (overall) number of selected filedescriptors. |
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6075 |
readableResultFdArray, writableResultFdArray and exceptionResultFdArray will |
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6076 |
get a nil-value stored into the slot after the last valid fileDescriptor; |
46a848d466b5
select: wake up readFDs if readable only;
Claus Gittinger <cg@exept.de>
parents:
7509
diff
changeset
|
6077 |
Thus, the caller can simply scan these arrays upTo the end or a nil value." |
7492
f2bf4935e7eb
New select for fair scheduling (not giving low filedescriptors
Stefan Vogel <sv@exept.de>
parents:
7488
diff
changeset
|
6078 |
|
f2bf4935e7eb
New select for fair scheduling (not giving low filedescriptors
Stefan Vogel <sv@exept.de>
parents:
7488
diff
changeset
|
6079 |
self subclassResponsibility |
f2bf4935e7eb
New select for fair scheduling (not giving low filedescriptors
Stefan Vogel <sv@exept.de>
parents:
7488
diff
changeset
|
6080 |
! |
f2bf4935e7eb
New select for fair scheduling (not giving low filedescriptors
Stefan Vogel <sv@exept.de>
parents:
7488
diff
changeset
|
6081 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6082 |
selectOnAnyReadable:readFdArray writable:writeFdArray exception:exceptFdArray withTimeOut:millis |
8669 | 6083 |
"wait for any fd in readFdArray (an Array of integers) to become ready for |
6084 |
reading, writeFdArray to become ready for writing, or exceptFdArray to |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6085 |
arrive exceptional data (i.e. out-of-band data). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6086 |
Timeout after t milliseconds or, if the timeout time is 0, immediately.. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6087 |
Empty fd-sets will always wait. Zero time can be used to poll file- |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6088 |
descriptors (i.e. to check if I/O possible without blocking). |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6089 |
Return first ready fd if I/O ok, nil if timed-out or interrupted." |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6090 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6091 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6092 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6093 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6094 |
setBlocking:aBoolean on:fd |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6095 |
"{ Pragma: +optSpace }" |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6096 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6097 |
"set/clear the blocking attribute - if set (which is the default) |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6098 |
a read on the fileDescriptor will block until data is available. |
7803 | 6099 |
If cleared, a read operation will immediately return with a value of nil. |
6100 |
Also affects write operations, which may perform partial writes when |
|
6101 |
blocking is off" |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6102 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6103 |
self subclassResponsibility |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6104 |
! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6105 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6106 |
writeCheck:fd |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6107 |
"return true, if filedescriptor can be written without blocking. |
17910 | 6108 |
This is the case if data can be written to a filedescriptor |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6109 |
or the write would return an error." |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6110 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6111 |
|result| |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6112 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6113 |
self supportsSelect ifFalse:[ |
17910 | 6114 |
"/ mhmh - what should we do then ? |
6115 |
"/ For now, return true as if data was present, |
|
6116 |
"/ and let the thread fall into the write. |
|
6117 |
"/ It will then (hopefully) be desceduled there and |
|
6118 |
"/ effectively polling for output. |
|
6119 |
^ true |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6120 |
]. |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6121 |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6122 |
result := self selectOnAnyReadable:nil |
17910 | 6123 |
writable:(Array with:fd) |
6124 |
exception:nil |
|
6125 |
withTimeOut:0. |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6126 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6127 |
^ result == fd or:[result == #error]. |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6128 |
! ! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6129 |
|
9476 | 6130 |
!AbstractOperatingSystem::PrinterInfo class methodsFor:'constants'! |
6131 |
||
6132 |
paperSizeNameForNumber:aNumber |
|
6133 |
^ self paperSizeNumberToNameMapping at:aNumber |
|
6134 |
||
6135 |
" |
|
6136 |
self paperSizeNameForNumber:1 |
|
6137 |
" |
|
6138 |
||
6139 |
"Created: / 31-07-2006 / 15:35:36 / fm" |
|
6140 |
! |
|
6141 |
||
6142 |
paperSizeNameForNumber:aNumber ifAbsent: aBlock |
|
6143 |
^ self paperSizeNumberToNameMapping at:aNumber ifAbsent: aBlock |
|
6144 |
||
6145 |
" |
|
6146 |
self paperSizeNameForNumber:11212 ifAbsent: [nil] |
|
6147 |
" |
|
6148 |
||
6149 |
"Created: / 31-07-2006 / 15:35:36 / fm" |
|
6150 |
! |
|
6151 |
||
6152 |
paperSizeNames |
|
6153 |
|codes| |
|
10510 | 6154 |
codes := self paperSizeNumberToNameTable values asSortedCollection:[:a :b | a < b]. |
6155 |
^codes collect:[:each | self paperSizeNameForNumber: each] |
|
9476 | 6156 |
|
6157 |
"Created: / 31-07-2006 / 15:35:36 / fm" |
|
10510 | 6158 |
"Modified: / 16-04-2007 / 12:03:55 / cg" |
9476 | 6159 |
! |
6160 |
||
6161 |
paperSizeNumberForName:aName |
|
6162 |
^ self paperSizeNumberToNameMapping at:aName |
|
6163 |
||
6164 |
" |
|
6165 |
self paperSizeNumberForName:'Letter, 8 1/2- by 11-inches' |
|
6166 |
" |
|
6167 |
||
6168 |
"Created: / 31-07-2006 / 15:35:37 / fm" |
|
6169 |
! |
|
6170 |
||
6171 |
paperSizeNumberToNameMapping |
|
6172 |
|d| |
|
6173 |
||
6174 |
d := self paperSizeNumberToNameTable. |
|
6175 |
||
6176 |
d keys copy do:[:k | d at:(d at:k) put:k]. |
|
6177 |
^ d. |
|
6178 |
||
6179 |
"Created: / 31-07-2006 / 15:35:37 / fm" |
|
6180 |
! |
|
6181 |
||
17910 | 6182 |
paperSizeNumberToNameTable |
9476 | 6183 |
|
6184 |
^Dictionary withKeysAndValues: |
|
17910 | 6185 |
#( |
6186 |
'Letter, 8 1/2- by 11-inches' 1 "/ Letter |
|
6187 |
'Legal 8 1/2- by 14-inches' 5 "/ Legal |
|
6188 |
'10- by 14-inch sheet' 16 "/ 10x14 |
|
6189 |
'11- by 17-inch sheet' 17 "/ 11x17 |
|
6190 |
"/ '12X11' "/ Windows 98/Me, Windows NT 4.0 and later: 12- by 11-inch sheet |
|
6191 |
'A3 sheet, 297- by 420-millimeters' 8 "/ A3 |
|
6192 |
'A3 rotated sheet, 420- by 297-millimeters' 67 "/ A3_rotated |
|
6193 |
'A4 sheet, 210- by 297-millimeters' 9 "/ A4 |
|
6194 |
'A4 rotated sheet, 297- by 210-millimeters' 55 "/ A4_rotated |
|
6195 |
'A4 small sheet, 210- by 297-millimeters' 10 "/ A4 small |
|
6196 |
'A5 sheet, 148- by 210-millimeters' 11 "/ A5 |
|
6197 |
'A5 rotated sheet, 210- by 148-millimeters' 61 "/ A5 rotated |
|
9476 | 6198 |
"/ 'a6' "/ Windows 98/Me, Windows NT 4.0 and later: A6 sheet, 105- by 148-millimeters |
6199 |
"/ 'a6_rotated' "/ Windows 98/Me, Windows NT 4.0 and later: A6 rotated sheet, 148- by 105-millimeters |
|
17910 | 6200 |
'B4 sheet, 250- by 354-millimeters' 12 "/ B4 |
9476 | 6201 |
"/ b4_jis_rotated Windows 98/Me, Windows NT 4.0 and later: B4 (JIS) rotated sheet, 364- by 257-millimeters |
17910 | 6202 |
'B5 sheet, 182- by 257-millimeter paper' 13 "/ B5 |
9476 | 6203 |
"/ b5_jis_rotated Windows 98/Me, Windows NT 4.0 and later: B5 (JIS) rotated sheet, 257- by 182-millimeters |
6204 |
"/ b6_jis Windows 98/Me, Windows NT 4.0 and later: B6 (JIS) sheet, 128- by 182-millimeters |
|
6205 |
"/ b6_jis_rotated Windows 98/Me, Windows NT 4.0 and later: B6 (JIS) rotated sheet, 182- by 128-millimeters |
|
6206 |
"/ csheet C Sheet, 17- by 22-inches |
|
6207 |
"/ dbl_japanese_postcard Windows 98/Me, Windows NT 4.0 and later: Double Japanese Postcard, 200- by 148-millimeters |
|
6208 |
"/ dbl_japanese_postcard_rotated Windows 98/Me, Windows NT 4.0 and later: Double Japanese Postcard Rotated, 148- by 200-millimeters |
|
6209 |
"/ dsheet D Sheet, 22- by 34-inches |
|
17910 | 6210 |
'#9 Envelope, 3 7/8- by 8 7/8-inches' 19 "/ env_9 |
6211 |
'#10 Envelope, 4 1/8- by 9 1/2-inches' 20 "/ env_10 |
|
6212 |
'#11 Envelope, 4 1/2- by 10 3/8-inches' 21 "/ env_11 |
|
6213 |
'#12 Envelope, 4 3/4- by 11-inches' 22 "/ env_12 |
|
6214 |
'#14 Envelope, 5- by 11 1/2-inches' 23 "/ env_15 |
|
6215 |
'C5 Envelope, 162- by 229-millimeters' 28 "/ env_c5 |
|
6216 |
'C3 Envelope, 324- by 458-millimeters' 29 "/ env_c3 |
|
6217 |
'C4 Envelope, 229- by 324-millimeters' 30 "/ env_c4 |
|
6218 |
'C6 Envelope, 114- by 162-millimeters' 31 "/ env_c6 |
|
6219 |
'C65 Envelope, 114- by 229-millimeters' 32 "/ env_c65 |
|
6220 |
'B4 Envelope, 250- by 353-millimeters' 33 "/ env_b4 |
|
6221 |
'B5 Envelope, 176- by 250-millimeters' 34 "/ env_b5 |
|
6222 |
'B6 Envelope, 176- by 125-millimeters' 35 "/ env_b6 |
|
6223 |
'DL Envelope, 110- by 220-millimeters' 27 "/ env_dl |
|
6224 |
'Italy Envelope, 110- by 230-millimeters' 36 "/ env_italy |
|
6225 |
'Monarch Envelope, 3 7/8- by 7 1/2-inches' 37 "/ env_monarch |
|
9476 | 6226 |
"/ env_personal 6 3/4 Envelope, 3 5/8- by 6 1/2-inches |
6227 |
"/ esheet E Sheet, 34- by 44-inches |
|
6228 |
"/ executive Executive, 7 1/4- by 10 1/2-inches |
|
6229 |
"/ fanfold_us US Std Fanfold, 14 7/8- by 11-inches |
|
6230 |
"/ fanfold_std_german German Std Fanfold, 8 1/2- by 12-inches |
|
6231 |
"/ fanfold_lgl_german German Legal Fanfold, 8 - by 13-inches |
|
6232 |
"/ folio Folio, 8 1/2- by 13-inch paper |
|
6233 |
"/ japanese_postcard_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Postcard Rotated, 148- by 100-millimeters |
|
6234 |
"/ jenv_chou3 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #3 |
|
6235 |
"/ jenv_chou3_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #3 Rotated |
|
6236 |
"/ jenv_chou4 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #4 |
|
6237 |
"/ jenv_chou4_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Chou #4 Rotated |
|
6238 |
"/ jenv_kaku2 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #2 |
|
6239 |
"/ jenv_kaku2_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #2 Rotated |
|
6240 |
"/ jenv_kaku3 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #3 |
|
6241 |
"/ jenv_kaku3_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope Kaku #3 Rotated |
|
6242 |
"/ jenv_you4 Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope You #4 |
|
6243 |
"/ jenv_you4_rotated Windows 98/Me, Windows NT 4.0 and later: Japanese Envelope You #4 Rotated |
|
6244 |
"/ last Windows 2000/XP: PENV_10_ROTATED |
|
17910 | 6245 |
'Ledger, 17- by 11-inches' 4 "/ ledger |
6246 |
'Letter Rotated 11 by 8 1/2 11 inches' 54 "/ letter_rotated |
|
9476 | 6247 |
"/ lettersmall Letter Small, 8 1/2- by 11-inches |
6248 |
"/ note Note, 8 1/2- by 11-inches |
|
6249 |
"/ p16k Windows 98/Me, Windows NT 4.0 and later: PRC 16K, 146- by 215-millimeters |
|
6250 |
"/ p16k_rotated Windows 98/Me, Windows NT 4.0 and later: PRC 16K Rotated, 215- by 146-millimeters |
|
6251 |
"/ p32k Windows 98/Me, Windows NT 4.0 and later: PRC 32K, 97- by 151-millimeters |
|
6252 |
"/ p32k_rotated Windows 98/Me, Windows NT 4.0 and later: PRC 32K Rotated, 151- by 97-millimeters |
|
6253 |
"/ p32kbig Windows 98/Me, Windows NT 4.0 and later: PRC 32K(Big) 97- by 151-millimeters |
|
6254 |
"/ p32kbig_rotated Windows 98/Me, Windows NT 4.0 and later: PRC 32K(Big) Rotated, 151- by 97-millimeters |
|
6255 |
"/ penv_1 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #1, 102- by 165-millimeters |
|
6256 |
"/ penv_1_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #1 Rotated, 165- by 102-millimeters |
|
6257 |
"/ penv_2 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #2, 102- by 176-millimeters |
|
6258 |
"/ penv_2_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #2 Rotated, 176- by 102-millimeters |
|
6259 |
"/ penv_3 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #3, 125- by 176-millimeters |
|
6260 |
"/ penv_3_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #3 Rotated, 176- by 125-millimeters |
|
6261 |
"/ penv_4 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #4, 110- by 208-millimeters |
|
6262 |
"/ penv_4_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #4 Rotated, 208- by 110-millimeters |
|
6263 |
"/ penv_5 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #5, 110- by 220-millimeters |
|
6264 |
"/ penv_5_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #5 Rotated, 220- by 110-millimeters |
|
6265 |
"/ penv_6 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #6, 120- by 230-millimeters |
|
6266 |
"/ penv_6_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #6 Rotated, 230- by 120-millimeters |
|
6267 |
"/ penv_7 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #7, 160- by 230-millimeters |
|
6268 |
"/ penv_7_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #7 Rotated, 230- by 160-millimeters |
|
6269 |
"/ penv_8 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #8, 120- by 309-millimeters |
|
6270 |
"/ penv_8_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #8 Rotated, 309- by 120-millimeters |
|
6271 |
"/ penv_9 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #9, 229- by 324-millimeters |
|
6272 |
"/ penv_9_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #9 Rotated, 324- by 229-millimeters |
|
6273 |
"/ penv_10 Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #10, 324- by 458-millimeters |
|
6274 |
"/ penv_10_rotated Windows 98/Me, Windows NT 4.0 and later: PRC Envelope #10 Rotated, 458- by 324-millimeters |
|
6275 |
"/ quarto Quarto, 215- by 275-millimeter paper |
|
6276 |
"/ statement Statement, 5 1/2- by 8 1/2-inches |
|
6277 |
"/ tabloid Tabloid, 11- by 17-inches |
|
17910 | 6278 |
). |
9476 | 6279 |
|
6280 |
"Created: / 31-07-2006 / 15:35:37 / fm" |
|
6281 |
! |
|
6282 |
||
17910 | 6283 |
statusNumberToDescriptionForNumber:aNumber |
11403 | 6284 |
^ self statusNumberToDescriptionMapping at:aNumber ifAbsent:[('Unknown (%1)' bindWith:aNumber printString)] |
9476 | 6285 |
|
6286 |
" |
|
6287 |
self statusNumberToDescriptionForNumber:1 |
|
6288 |
" |
|
6289 |
||
6290 |
"Created: / 01-08-2006 / 14:31:18 / fm" |
|
6291 |
! |
|
6292 |
||
6293 |
statusNumberToDescriptionMapping |
|
6294 |
|d| |
|
6295 |
||
6296 |
d := self statusNumberToDescriptionTable. |
|
6297 |
||
6298 |
d keys copy do:[:k | d at:(d at:k) put:k]. |
|
6299 |
^ d. |
|
6300 |
||
6301 |
"Created: / 01-08-2006 / 14:31:05 / fm" |
|
6302 |
! |
|
6303 |
||
17910 | 6304 |
statusNumberToDescriptionTable |
9476 | 6305 |
|
6306 |
^Dictionary withKeysAndValues: |
|
17910 | 6307 |
#( 'Ready' 0 "/ PRINTER_STATUS_READY |
6308 |
'Paused' 1 "/ PRINTER_STATUS_PAUSED |
|
6309 |
'Error' 2 "/ PRINTER_STATUS_ERROR |
|
6310 |
'Deleting...' 4 "/ PRINTER_STATUS_PENDING_DELETION |
|
6311 |
'Paper Jam' 8 "/ PRINTER_STATUS_PAPER_JAM |
|
6312 |
'Paper Out' 16 "/ PRINTER_STATUS_PAPER_OUT |
|
6313 |
'Manual Feed Required' 32 "/ PRINTER_STATUS_MANUAL_FEED |
|
6314 |
'Paper Problem' 64 "/ PRINTER_STATUS_PAPER_PROBLEM |
|
6315 |
'Offline' 128 "/ PRINTER_STATUS_OFFLINE |
|
6316 |
'Downloading Job' 256 "/ PRINTER_STATUS_IO_ACTIVE |
|
6317 |
'Busy' 512 "/ PRINTER_STATUS_BUSY |
|
6318 |
'Printing' 1024 "/ PRINTER_STATUS_PRINTING |
|
6319 |
'Output Bill Full' 2048 "/ PRINTER_STATUS_OUTPUT_BIN_FULL |
|
6320 |
'Not Available' 4096 "/ PRINTER_STATUS_NOT_AVAILABLE |
|
6321 |
'Waiting' 8192 "/ PRINTER_STATUS_WAITING |
|
6322 |
'Processing Job' 16384 "/ PRINTER_STATUS_PROCESSING |
|
6323 |
'Initializing' 32768 "/ PRINTER_STATUS_INITIALIZING |
|
6324 |
'Warming Up' 65536 "/ PRINTER_STATUS_WARMING_UP |
|
6325 |
'Toner Low' 131072 "/ PRINTER_STATUS_TONER_LOW |
|
6326 |
'Toner Out' 262144 "/ PRINTER_STATUS_NO_TONER |
|
6327 |
'Page too Complex' 524288 "/ PRINTER_STATUS_PAGE_PUNT |
|
6328 |
'User Intervention Required'1048576 "/ PRINTER_STATUS_USER_INTERVENTION |
|
6329 |
'Out of Memory' 2097152 "/ PRINTER_STATUS_OUT_OF_MEMORY |
|
6330 |
'Door Open' 4194304 "/ PRINTER_STATUS_DOOR_OPEN |
|
6331 |
'Unable to connect' 8388608 "/ PRINTER_STATUS_SERVER_UNKNOWN |
|
6332 |
'Power Save Mode' 16777216 "/ PRINTER_STATUS_POWER_SAVE |
|
6333 |
). |
|
9476 | 6334 |
|
6335 |
"Created: / 01-08-2006 / 14:23:33 / fm" |
|
6336 |
! ! |
|
6337 |
||
6338 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'accessing'! |
|
6339 |
||
6340 |
attributes |
|
6341 |
^ attributes |
|
6342 |
||
6343 |
"Created: / 27-07-2006 / 12:16:59 / fm" |
|
6344 |
! |
|
6345 |
||
6346 |
collate |
|
10096 | 6347 |
|properties| |
6348 |
||
6349 |
properties := self documentProperties. |
|
6350 |
^ properties isNil ifTrue:[ nil ] ifFalse:[ properties collate = 1 ] |
|
9476 | 6351 |
|
6352 |
"Created: / 01-08-2006 / 09:56:14 / fm" |
|
6353 |
"Modified: / 01-08-2006 / 11:49:18 / fm" |
|
10096 | 6354 |
"Modified: / 18-10-2006 / 12:02:29 / User" |
9476 | 6355 |
! |
6356 |
||
6357 |
collate: aBoolean |
|
10510 | 6358 |
|integer| |
6359 |
||
17910 | 6360 |
integer:= aBoolean |
6361 |
ifTrue:[1] "DMCOLLATE_TRUE" |
|
6362 |
ifFalse:[0]. "DMCOLLATE_FALSE" |
|
10510 | 6363 |
self documentProperties collate: integer |
9476 | 6364 |
|
6365 |
"Created: / 01-08-2006 / 09:56:01 / fm" |
|
10510 | 6366 |
"Modified: / 16-04-2007 / 12:01:30 / cg" |
9476 | 6367 |
! |
6368 |
||
6369 |
comment |
|
10510 | 6370 |
^self printerInfo2 pComment |
9476 | 6371 |
|
6372 |
"Created: / 01-08-2006 / 15:06:20 / fm" |
|
10510 | 6373 |
"Modified: / 16-04-2007 / 12:01:42 / cg" |
9476 | 6374 |
! |
6375 |
||
6376 |
copies |
|
10096 | 6377 |
|properties| |
6378 |
||
6379 |
properties := self documentProperties. |
|
6380 |
^ properties isNil ifTrue:[ nil ] ifFalse:[ properties copies ] |
|
9476 | 6381 |
|
6382 |
"Created: / 31-07-2006 / 13:46:53 / fm" |
|
10096 | 6383 |
"Modified: / 18-10-2006 / 12:02:14 / User" |
9476 | 6384 |
! |
6385 |
||
6386 |
copies: anInteger |
|
10510 | 6387 |
self documentProperties copies: anInteger |
9476 | 6388 |
|
6389 |
"Created: / 31-07-2006 / 13:54:55 / fm" |
|
10510 | 6390 |
"Modified: / 16-04-2007 / 12:01:48 / cg" |
9476 | 6391 |
! |
6392 |
||
6393 |
documentProperties |
|
6394 |
||
6395 |
^documentProperties |
|
6396 |
||
6397 |
"Created: / 28-07-2006 / 11:50:04 / fm" |
|
6398 |
"Modified: / 31-07-2006 / 13:06:24 / fm" |
|
6399 |
! |
|
6400 |
||
17910 | 6401 |
documentProperties: aDevModeStructure |
9476 | 6402 |
|
6403 |
documentProperties := aDevModeStructure. |
|
6404 |
||
6405 |
"Created: / 28-07-2006 / 11:47:31 / fm" |
|
6406 |
! |
|
6407 |
||
6408 |
driverName |
|
6409 |
||
10510 | 6410 |
^self attributes at:#driverName |
9476 | 6411 |
|
6412 |
"Created: / 01-08-2006 / 15:33:08 / fm" |
|
10510 | 6413 |
"Modified: / 16-04-2007 / 12:01:53 / cg" |
9476 | 6414 |
! |
6415 |
||
6416 |
location |
|
6417 |
||
10510 | 6418 |
^self printerInfo2 pLocation |
9476 | 6419 |
|
6420 |
"Created: / 01-08-2006 / 15:06:28 / fm" |
|
10510 | 6421 |
"Modified: / 16-04-2007 / 12:02:07 / cg" |
9476 | 6422 |
! |
6423 |
||
6424 |
longName |
|
10510 | 6425 |
^attributes at:#longName ifAbsent:[''] |
9476 | 6426 |
|
6427 |
"Created: / 28-07-2006 / 12:06:32 / fm" |
|
10510 | 6428 |
"Modified: / 16-04-2007 / 12:02:11 / cg" |
9476 | 6429 |
! |
6430 |
||
6431 |
medium |
|
6432 |
||
10510 | 6433 |
^self attributes at:#medium |
9476 | 6434 |
|
6435 |
"Created: / 01-08-2006 / 15:34:26 / fm" |
|
10510 | 6436 |
"Modified: / 16-04-2007 / 12:02:14 / cg" |
9476 | 6437 |
! |
6438 |
||
6439 |
orientation |
|
10096 | 6440 |
|properties| |
6441 |
||
6442 |
properties := self documentProperties. |
|
6443 |
^ properties isNil ifTrue:[ nil ] ifFalse:[ properties orientation ] |
|
9476 | 6444 |
|
6445 |
"Created: / 28-07-2006 / 16:44:26 / fm" |
|
10096 | 6446 |
"Modified: / 18-10-2006 / 12:01:36 / User" |
6447 |
! |
|
6448 |
||
17910 | 6449 |
orientation:anInteger |
10096 | 6450 |
|properties| |
6451 |
||
6452 |
properties := self documentProperties. |
|
6453 |
properties notNil ifTrue:[ |
|
17910 | 6454 |
properties orientation:anInteger |
10096 | 6455 |
] |
9476 | 6456 |
|
6457 |
"Created: / 28-07-2006 / 17:22:44 / fm" |
|
10096 | 6458 |
"Modified: / 18-10-2006 / 12:01:40 / User" |
9476 | 6459 |
! |
6460 |
||
6461 |
pDriverName |
|
6462 |
||
10510 | 6463 |
^self printerInfo2 pDriverName |
9476 | 6464 |
|
6465 |
"Created: / 01-08-2006 / 15:33:08 / fm" |
|
10510 | 6466 |
"Modified: / 16-04-2007 / 12:02:21 / cg" |
9476 | 6467 |
! |
6468 |
||
6469 |
paperSize |
|
10096 | 6470 |
|properties| |
6471 |
||
6472 |
properties := self documentProperties. |
|
6473 |
^ properties isNil ifTrue:[ nil ] ifFalse:[ properties paperSize ] |
|
9476 | 6474 |
|
6475 |
"Created: / 31-07-2006 / 15:23:29 / fm" |
|
6476 |
"Modified: / 31-07-2006 / 16:25:58 / fm" |
|
10096 | 6477 |
"Modified: / 18-10-2006 / 12:01:45 / User" |
6478 |
! |
|
6479 |
||
17910 | 6480 |
paperSize:anInteger |
10096 | 6481 |
|properties| |
6482 |
||
6483 |
properties := self documentProperties. |
|
6484 |
properties notNil ifTrue:[ |
|
17910 | 6485 |
properties paperSize:anInteger |
10096 | 6486 |
] |
9476 | 6487 |
|
6488 |
"Created: / 31-07-2006 / 15:23:20 / fm" |
|
10096 | 6489 |
"Modified: / 18-10-2006 / 12:01:48 / User" |
9476 | 6490 |
! |
6491 |
||
6492 |
paperSizeName |
|
6493 |
^ self class paperSizeNameForNumber:self paperSize ifAbsent:[nil]. |
|
6494 |
||
6495 |
"Created: / 31-07-2006 / 15:35:12 / fm" |
|
6496 |
! |
|
6497 |
||
17910 | 6498 |
paperSizeName:aString |
10096 | 6499 |
self paperSize:(self class paperSizeNumberForName:aString) |
6500 |
||
6501 |
"Modified: / 18-10-2006 / 12:01:56 / User" |
|
9476 | 6502 |
! |
6503 |
||
6504 |
printQuality |
|
6505 |
^self documentProperties printQuality |
|
6506 |
||
6507 |
"Created: / 04-08-2006 / 13:10:06 / fm" |
|
6508 |
! |
|
6509 |
||
6510 |
printerName |
|
6511 |
^ printerName |
|
6512 |
||
6513 |
"Created: / 27-07-2006 / 12:16:59 / fm" |
|
6514 |
! |
|
6515 |
||
17910 | 6516 |
printerName:printerNameArg attributes:attributesArg |
9476 | 6517 |
|
6518 |
printerName := printerNameArg. |
|
6519 |
attributes := attributesArg. |
|
6520 |
||
6521 |
"Created: / 27-07-2006 / 12:29:18 / fm" |
|
6522 |
! |
|
6523 |
||
6524 |
remotePrinterHost |
|
10510 | 6525 |
^attributes at:#remotePrinterHost ifAbsent:[''] |
9476 | 6526 |
|
6527 |
"Created: / 28-07-2006 / 16:30:13 / fm" |
|
10510 | 6528 |
"Modified: / 16-04-2007 / 12:02:32 / cg" |
9476 | 6529 |
! |
6530 |
||
6531 |
remotePrinterName |
|
10510 | 6532 |
^attributes at:#remotePrinterName ifAbsent:[''] |
9476 | 6533 |
|
6534 |
"Created: / 28-07-2006 / 16:30:06 / fm" |
|
10510 | 6535 |
"Modified: / 16-04-2007 / 12:03:23 / cg" |
9476 | 6536 |
! |
6537 |
||
6538 |
status |
|
10510 | 6539 |
self isAvailable ifFalse:[^'']. |
6540 |
^self class statusNumberToDescriptionForNumber: self getPrinterInfo2 status |
|
9476 | 6541 |
|
6542 |
"Created: / 01-08-2006 / 13:48:58 / fm" |
|
10510 | 6543 |
"Modified: / 16-04-2007 / 12:03:41 / cg" |
9476 | 6544 |
! |
6545 |
||
6546 |
userFriendlyName |
|
6547 |
^self remotePrinterName isEmpty |
|
17910 | 6548 |
ifTrue:[self printerName] |
6549 |
ifFalse:[self remotePrinterName, ' on ', self remotePrinterHost] |
|
9476 | 6550 |
|
6551 |
"Created: / 03-08-2006 / 12:50:09 / fm" |
|
6552 |
! ! |
|
6553 |
||
6554 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'dc creation'! |
|
6555 |
||
6556 |
createDC |
|
10528 | 6557 |
|driverName pName| |
10510 | 6558 |
|
6559 |
driverName := self driverName. |
|
10528 | 6560 |
pName := self printerName. |
10513 | 6561 |
"/ Transcript show:driverName; show:' '; showCR:printerName. |
10510 | 6562 |
|
17910 | 6563 |
^OperatingSystem createPrinterDC:driverName |
6564 |
device:pName |
|
6565 |
output:self medium |
|
6566 |
initData:self documentProperties. |
|
9476 | 6567 |
|
6568 |
"Created: / 02-08-2006 / 16:51:02 / fm" |
|
10513 | 6569 |
"Modified: / 16-04-2007 / 13:56:56 / cg" |
9476 | 6570 |
! ! |
6571 |
||
6572 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'dialogs'! |
|
6573 |
||
6574 |
openPropertiesDialog |
|
9844 | 6575 |
"Returns true if the documentProperties have been accepted. Otherwise, returns false" |
6576 |
||
9476 | 6577 |
|h newDocumentProperties| |
6578 |
||
6579 |
h := OperatingSystem openPrinter: self printerName. |
|
17910 | 6580 |
newDocumentProperties := OperatingSystem documentPropertiesDialogFor:nil |
6581 |
hPrinter:h |
|
6582 |
pDeviceName: self printerName |
|
6583 |
devModeInput:self documentProperties. |
|
9844 | 6584 |
(newDocumentProperties contains:[:el | el ~= 0]) |
17910 | 6585 |
ifFalse:[^false]. |
9476 | 6586 |
self documentProperties: newDocumentProperties. |
6587 |
OperatingSystem closePrinter:h. |
|
6588 |
^true |
|
6589 |
||
6590 |
"Created: / 28-07-2006 / 11:44:01 / fm" |
|
6591 |
"Modified: / 01-08-2006 / 11:55:49 / fm" |
|
9844 | 6592 |
"Modified: / 13-09-2006 / 11:36:10 / cg" |
9476 | 6593 |
! ! |
6594 |
||
6595 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'modifying'! |
|
6596 |
||
6597 |
setLandscapeOrientation |
|
10510 | 6598 |
"DMORIENT_LANDSCAPE = 2" |
6599 |
self documentProperties orientation: 2 |
|
9476 | 6600 |
|
6601 |
"Created: / 28-07-2006 / 15:53:35 / fm" |
|
10510 | 6602 |
"Modified: / 16-04-2007 / 12:03:30 / cg" |
9476 | 6603 |
! |
6604 |
||
6605 |
setNumberOfCopies: n |
|
6606 |
||
10510 | 6607 |
self documentProperties copies: n |
9476 | 6608 |
|
6609 |
"Created: / 28-07-2006 / 16:04:04 / fm" |
|
10510 | 6610 |
"Modified: / 16-04-2007 / 12:03:33 / cg" |
9476 | 6611 |
! |
6612 |
||
6613 |
setPortraitOrientation |
|
10510 | 6614 |
"DMORIENT_PORTRAIT = 1" |
6615 |
self documentProperties orientation: 1 |
|
9476 | 6616 |
|
6617 |
"Created: / 28-07-2006 / 15:49:45 / fm" |
|
10510 | 6618 |
"Modified: / 16-04-2007 / 12:03:36 / cg" |
9476 | 6619 |
! ! |
6620 |
||
6621 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'printing & storing'! |
|
6622 |
||
6623 |
printOn:aStream |
|
6624 |
aStream nextPutAll:(self class name); nextPutAll:'('. |
|
6625 |
printerName printOn:aStream. |
|
6626 |
aStream nextPutAll:')'. |
|
6627 |
||
6628 |
"Created: / 27-07-2006 / 12:30:28 / fm" |
|
6629 |
! ! |
|
6630 |
||
6631 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'private'! |
|
6632 |
||
6633 |
getDocumentProperties |
|
6634 |
"Returns a aDevModeStructure" |
|
10510 | 6635 |
|
6636 |
|h devMode | |
|
9476 | 6637 |
|
6638 |
h := OperatingSystem openPrinter: self printerName. |
|
6639 |
devMode := OperatingSystem getDocumentProperties:nil |
|
17910 | 6640 |
hPrinter:h |
6641 |
pDeviceName: self printerName. |
|
9476 | 6642 |
OperatingSystem closePrinter: h. |
6643 |
^devMode |
|
6644 |
||
6645 |
"Created: / 28-07-2006 / 11:49:33 / fm" |
|
6646 |
"Modified: / 31-07-2006 / 10:33:04 / fm" |
|
10510 | 6647 |
"Modified: / 16-04-2007 / 12:02:00 / cg" |
9476 | 6648 |
! |
6649 |
||
6650 |
getPrinterInfo2 |
|
6651 |
"Returns a aPrinterInfo2 structure" |
|
17910 | 6652 |
|
10097 | 6653 |
printerInfo2 := OperatingSystem getPrinterInfo2:self printerName. |
6654 |
^ printerInfo2 |
|
9476 | 6655 |
|
6656 |
"Created: / 01-08-2006 / 13:50:55 / fm" |
|
6657 |
"Modified: / 01-08-2006 / 15:11:03 / fm" |
|
10097 | 6658 |
"Modified: / 18-10-2006 / 12:03:54 / User" |
9476 | 6659 |
! |
6660 |
||
6661 |
printerInfo2 |
|
6662 |
"Returns a aPrinterInfo2 structure" |
|
17910 | 6663 |
|
10097 | 6664 |
printerInfo2 isNil ifTrue:[ |
17910 | 6665 |
self getPrinterInfo2. |
10097 | 6666 |
]. |
6667 |
^ printerInfo2 |
|
9476 | 6668 |
|
6669 |
"Created: / 01-08-2006 / 15:10:18 / fm" |
|
10097 | 6670 |
"Modified: / 18-10-2006 / 12:03:57 / User" |
9476 | 6671 |
! |
6672 |
||
6673 |
setDocumentProperties |
|
17910 | 6674 |
"Sets a aDevModeStructure or nil if the printer is not available" |
9476 | 6675 |
|
6676 |
self documentProperties: self getDocumentProperties |
|
6677 |
||
6678 |
"Created: / 31-07-2006 / 13:04:58 / fm" |
|
6679 |
! ! |
|
6680 |
||
6681 |
!AbstractOperatingSystem::PrinterInfo methodsFor:'queries'! |
|
6682 |
||
6683 |
isAvailable |
|
6684 |
||
10510 | 6685 |
^self documentProperties notNil |
9476 | 6686 |
|
6687 |
"Created: / 31-07-2006 / 13:08:58 / fm" |
|
10510 | 6688 |
"Modified: / 16-04-2007 / 12:02:05 / cg" |
9476 | 6689 |
! ! |
6690 |
||
7514 | 6691 |
!AbstractOperatingSystem::TimeInfo methodsFor:'accessing'! |
6692 |
||
6693 |
at:index |
|
6694 |
"backward compatibility" |
|
6695 |
||
8357 | 6696 |
<resource: #obsolete> |
7514 | 6697 |
self obsoleteMethodWarning:'use accessor for index ', index printString. |
7739
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6698 |
|
7514 | 6699 |
index == 1 ifTrue:[ |
17910 | 6700 |
^ self year. |
7514 | 6701 |
]. |
6702 |
index == 2 ifTrue:[ |
|
17910 | 6703 |
^ self month. |
7514 | 6704 |
]. |
6705 |
index == 3 ifTrue:[ |
|
17910 | 6706 |
^ self day. |
7514 | 6707 |
]. |
6708 |
index == 4 ifTrue:[ |
|
17910 | 6709 |
^ self hours. |
7514 | 6710 |
]. |
6711 |
index == 5 ifTrue:[ |
|
17910 | 6712 |
^ self minutes. |
7514 | 6713 |
]. |
6714 |
index == 6 ifTrue:[ |
|
17910 | 6715 |
^ self seconds. |
7514 | 6716 |
]. |
6717 |
index == 7 ifTrue:[ |
|
17910 | 6718 |
^ self utcOffset. |
7514 | 6719 |
]. |
6720 |
index == 8 ifTrue:[ |
|
17910 | 6721 |
^ self dst. |
7514 | 6722 |
]. |
6723 |
index == 9 ifTrue:[ |
|
17910 | 6724 |
^ self milliseconds. |
7514 | 6725 |
]. |
6726 |
index == 10 ifTrue:[ |
|
17910 | 6727 |
^ self dayInYear. |
7514 | 6728 |
]. |
6729 |
index == 11 ifTrue:[ |
|
17910 | 6730 |
^ self dayInWeek. |
7514 | 6731 |
]. |
6732 |
self subscriptBoundsError:index |
|
6733 |
! |
|
6734 |
||
6735 |
day |
|
6736 |
^ day |
|
6737 |
! |
|
6738 |
||
6739 |
dayInWeek |
|
6740 |
^ dayInWeek |
|
6741 |
! |
|
6742 |
||
6743 |
dayInYear |
|
17757 | 6744 |
"answer of compute the day of the year - if necessary |
6745 |
(it is not set in windows)" |
|
6746 |
||
6747 |
|dayCount| |
|
6748 |
||
6749 |
dayInYear notNil ifTrue:[ |
|
17910 | 6750 |
^ dayInYear. |
17757 | 6751 |
]. |
6752 |
||
6753 |
dayCount := #(0 31 59 90 120 151 181 212 243 273 304 334) at:month. |
|
17910 | 6754 |
(month > 2 |
6755 |
and:[(year \\ 4 == 0) |
|
17757 | 6756 |
and:[(year \\ 100 ~~ 0) |
6757 |
and:[(year \\ 400 == 0)]]]) ifTrue:[ |
|
17910 | 6758 |
"leap year and month after February" |
6759 |
dayCount := dayCount + 1. |
|
17757 | 6760 |
]. |
6761 |
||
6762 |
^ dayCount + day. |
|
6763 |
||
6764 |
||
17910 | 6765 |
" |
17757 | 6766 |
|daysSoFar| |
6767 |
||
6768 |
daysSoFar := 0. |
|
6769 |
#(0 31 28 31 30 31 30 31 31 30 31 30) collect:[:daysInMonth| daysSoFar := daysSoFar + daysInMonth. daysSoFar] |
|
6770 |
" |
|
7514 | 6771 |
! |
6772 |
||
6773 |
dst |
|
6774 |
^ dst |
|
6775 |
! |
|
6776 |
||
6777 |
hours |
|
6778 |
^ hours |
|
6779 |
! |
|
6780 |
||
6781 |
milliseconds |
|
6782 |
^ milliseconds |
|
6783 |
! |
|
6784 |
||
6785 |
milliseconds:something |
|
6786 |
milliseconds := something. |
|
6787 |
! |
|
6788 |
||
6789 |
minutes |
|
6790 |
^ minutes |
|
6791 |
! |
|
6792 |
||
6793 |
month |
|
6794 |
^ month |
|
6795 |
! |
|
6796 |
||
6797 |
seconds |
|
6798 |
^ seconds |
|
6799 |
! |
|
6800 |
||
6801 |
utcOffset |
|
8887 | 6802 |
"return the difference between UTC (Greenwich Mean Time) and the local time in seconds. |
6803 |
If daylight saving time applies to ourself, take that into account. |
|
6804 |
Add utcOffset to convert from local time to UTC time. |
|
6805 |
Subtract utcOffset to convert from UTC time to local time. |
|
6806 |
||
6807 |
If utcOffset is negative, the local timezone is east of Greenwich. |
|
6808 |
If utcOffset is positive, the local timezone is west of Greenwich." |
|
6809 |
||
7514 | 6810 |
^ utcOffset |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6811 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6812 |
" |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6813 |
OperatingSystem utcOffset |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6814 |
" |
7514 | 6815 |
! |
6816 |
||
6817 |
year |
|
6818 |
^ year |
|
6819 |
! |
|
6820 |
||
8669 | 6821 |
year:yearArg month:monthArg day:dayArg hours:hoursArg minutes:minutesArg seconds:secondsArg milliseconds:millisecondsArg utcOffset:utcOffsetArg dst:dstArg dayInYear:dayInYearArg dayInWeek:dayInWeekArg |
7739
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6822 |
"set instance variables (automatically generated)" |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6823 |
|
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6824 |
year := yearArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6825 |
month := monthArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6826 |
day := dayArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6827 |
hours := hoursArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6828 |
minutes := minutesArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6829 |
seconds := secondsArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6830 |
milliseconds := millisecondsArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6831 |
utcOffset := utcOffsetArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6832 |
dst := dstArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6833 |
dayInYear := dayInYearArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6834 |
dayInWeek := dayInWeekArg. |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6835 |
! |
d09af69f0466
timeInfoFromOSTime - cache last return
Claus Gittinger <cg@exept.de>
parents:
7733
diff
changeset
|
6836 |
|
8669 | 6837 |
year:yearArg month:monthArg day:dayArg hours:hoursArg minutes:minutesArg seconds:secondsArg utcOffset:utcOffsetArg dst:dstArg dayInYear:dayInYearArg dayInWeek:dayInWeekArg |
7514 | 6838 |
"set instance variables (automatically generated)" |
6839 |
||
6840 |
year := yearArg. |
|
6841 |
month := monthArg. |
|
6842 |
day := dayArg. |
|
6843 |
hours := hoursArg. |
|
6844 |
minutes := minutesArg. |
|
6845 |
seconds := secondsArg. |
|
6846 |
utcOffset := utcOffsetArg. |
|
6847 |
dst := dstArg. |
|
6848 |
dayInYear := dayInYearArg. |
|
6849 |
dayInWeek := dayInWeekArg. |
|
6850 |
! ! |
|
6851 |
||
17815 | 6852 |
!AbstractOperatingSystem::TimeInfo methodsFor:'converting'! |
6853 |
||
6854 |
asDate |
|
6855 |
^ Date new year:year month:month day:day. |
|
6856 |
! |
|
6857 |
||
6858 |
asTime |
|
6859 |
^ Time hours:hours minutes:minutes seconds:seconds |
|
6860 |
! ! |
|
6861 |
||
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6862 |
!AbstractOperatingSystem::TimeZoneInfo class methodsFor:'documentation'! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6863 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6864 |
documentation |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6865 |
" |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6866 |
Bias |
17910 | 6867 |
The current bias for local time translation on this computer, in minutes. |
6868 |
The bias is the difference, in minutes, between Coordinated Universal Time (UTC) |
|
6869 |
and local time. |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6870 |
All translations between UTC and local time are based on the following formula: |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6871 |
|
17910 | 6872 |
UTC = local time + bias |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6873 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6874 |
StandardName |
17910 | 6875 |
A description for standard time. For example, 'EST' could indicate Eastern Standard Time. |
6876 |
The string will be returned unchanged by the GetTimeZoneInformation function. |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6877 |
This string can be empty. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6878 |
This is for information only - do not depend on the value of the string. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6879 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6880 |
StandardDate |
17910 | 6881 |
A Timestamp that contains a date and local time when the transition from daylight saving |
6882 |
time to standard time occurs on this operating system. |
|
6883 |
If the time zone does not support daylight saving time or if the caller needs to disable |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6884 |
daylight saving time, the standardDate is nil. |
17910 | 6885 |
If this date is specified, the DaylightDate member of this structure must also be specified. |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6886 |
Otherwise, the system assumes the time zone data is invalid and no changes will be applied. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6887 |
|
17910 | 6888 |
To select the correct day in the month, set the wYear member to zero, the wHour and wMinute members |
6889 |
to the transition time, the wDayOfWeek member to the appropriate weekday, and the wDay member to indicate |
|
6890 |
the occurrence of the day of the week within the month (1 to 5, where 5 indicates the final occurrence |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6891 |
during the month if that day of the week does not occur 5 times). |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6892 |
|
17910 | 6893 |
Using this notation, specify 02:00 on the first Sunday in April as follows: |
6894 |
wHour = 2, wMonth = 4, wDayOfWeek = 0, wDay = 1. |
|
6895 |
Specify 02:00 on the last Thursday in October as follows: |
|
6896 |
wHour = 2, wMonth = 10, wDayOfWeek = 4, wDay = 5. |
|
6897 |
||
6898 |
If the wYear member is not zero, the transition date is absolute; it will only occur one time. |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6899 |
Otherwise, it is a relative date that occurs yearly. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6900 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6901 |
StandardBias |
17910 | 6902 |
The bias value to be used during local time translations that occur during standard time. |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6903 |
This member is ignored if a value for the StandardDate member is not supplied. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6904 |
|
17910 | 6905 |
This value is added to the value of the Bias member to form the bias used during standard time. |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6906 |
In most time zones, the value of this member is zero. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6907 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6908 |
DaylightName |
17910 | 6909 |
A description for daylight saving time. For example, 'PDT' could indicate Pacific Daylight Time. |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6910 |
The string will be returned unchanged by the GetTimeZoneInformation function. This string can be empty. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6911 |
This is for information only - do not depend on the value of the string. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6912 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6913 |
DaylightDate |
17910 | 6914 |
A Timestamp structure that contains a date and local time when the transition from standard time |
6915 |
to daylight saving time occurs on this operating system. |
|
6916 |
If the time zone does not support daylight saving time or if the caller needs to disable daylight |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6917 |
saving time, this entry is nil. |
17910 | 6918 |
If this date is specified, the StandardDate member in this structure must also be specified. |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6919 |
Otherwise, the system assumes the time zone data is invalid and no changes will be applied. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6920 |
|
17910 | 6921 |
To select the correct day in the month, set the wYear member to zero, the wHour and wMinute members to |
6922 |
the transition time, the wDayOfWeek member to the appropriate weekday, and the wDay member to indicate |
|
6923 |
the occurrence of the day of the week within the month (1 to 5, where 5 indicates the final occurrence |
|
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6924 |
during the month if that day of the week does not occur 5 times). |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6925 |
|
17910 | 6926 |
If the wYear member is not zero, the transition date is absolute; it will only occur one time. |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6927 |
Otherwise, it is a relative date that occurs yearly. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6928 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6929 |
DaylightBias |
17910 | 6930 |
The bias value to be used during local time translations that occur during daylight saving time. |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6931 |
This member is ignored if a value for the DaylightDate member is not supplied. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6932 |
|
17910 | 6933 |
This value is added to the value of the Bias member to form the bias used during daylight saving time. |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6934 |
In most time zones, the value of this member is -60 |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6935 |
" |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6936 |
! ! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6937 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6938 |
!AbstractOperatingSystem::TimeZoneInfo methodsFor:'accessing'! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6939 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6940 |
bias |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6941 |
^ bias |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6942 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6943 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6944 |
bias:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6945 |
bias := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6946 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6947 |
|
17910 | 6948 |
bias:biasArg name:nameArg standardBias:standardBiasArg daylightName:daylightNameArg daylightBias:daylightBiasArg |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6949 |
bias := biasArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6950 |
name := nameArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6951 |
standardBias := standardBiasArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6952 |
daylightName := daylightNameArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6953 |
daylightBias := daylightBiasArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6954 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6955 |
|
17910 | 6956 |
bias:biasArg name:nameArg standardDate:standardDateArg standardBias:standardBiasArg daylightName:daylightNameArg daylightDate:daylightDateArg daylightBias:daylightBiasArg |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6957 |
bias := biasArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6958 |
name := nameArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6959 |
standardDate := standardDateArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6960 |
standardBias := standardBiasArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6961 |
daylightName := daylightNameArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6962 |
daylightDate := daylightDateArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6963 |
daylightBias := daylightBiasArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6964 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6965 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6966 |
daylightBias |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6967 |
^ daylightBias |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6968 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6969 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6970 |
daylightBias:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6971 |
daylightBias := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6972 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6973 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6974 |
daylightDay |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6975 |
^ daylightDay |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6976 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6977 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6978 |
daylightDay:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6979 |
daylightDay := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6980 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6981 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6982 |
daylightHour |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6983 |
^ daylightHour |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6984 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6985 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6986 |
daylightHour:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6987 |
daylightHour := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6988 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6989 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6990 |
daylightMinute |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6991 |
^ daylightMinute |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6992 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6993 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6994 |
daylightMinute:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6995 |
daylightMinute := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6996 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6997 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6998 |
daylightMonth |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
6999 |
^ daylightMonth |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7000 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7001 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7002 |
daylightMonth:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7003 |
daylightMonth := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7004 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7005 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7006 |
daylightName |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7007 |
^ daylightName |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7008 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7009 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7010 |
daylightName:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7011 |
daylightName := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7012 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7013 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7014 |
daylightWeekDay |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7015 |
^ daylightWeekDay |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7016 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7017 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7018 |
daylightWeekDay:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7019 |
daylightWeekDay := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7020 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7021 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7022 |
daylightYear |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7023 |
^ daylightYear |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7024 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7025 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7026 |
daylightYear:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7027 |
daylightYear := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7028 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7029 |
|
17910 | 7030 |
daylightYear:daylightYearArg daylightMonth:daylightMonthArg daylightDay:daylightDayArg daylightWeekDay:daylightWeekDayArg daylightHour:daylightHourArg daylightMinute:daylightMinuteArg |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7031 |
daylightYear := daylightYearArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7032 |
daylightMonth := daylightMonthArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7033 |
daylightDay := daylightDayArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7034 |
daylightWeekDay := daylightWeekDayArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7035 |
daylightHour := daylightHourArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7036 |
daylightMinute := daylightMinuteArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7037 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7038 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7039 |
name |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7040 |
^ name |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7041 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7042 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7043 |
name:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7044 |
name := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7045 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7046 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7047 |
standardBias |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7048 |
^ standardBias |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7049 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7050 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7051 |
standardBias:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7052 |
standardBias := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7053 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7054 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7055 |
standardDay |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7056 |
^ standardDay |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7057 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7058 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7059 |
standardDay:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7060 |
standardDay := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7061 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7062 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7063 |
standardHour |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7064 |
^ standardHour |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7065 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7066 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7067 |
standardHour:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7068 |
standardHour := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7069 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7070 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7071 |
standardMinute |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7072 |
^ standardMinute |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7073 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7074 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7075 |
standardMinute:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7076 |
standardMinute := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7077 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7078 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7079 |
standardMonth |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7080 |
^ standardMonth |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7081 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7082 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7083 |
standardMonth:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7084 |
standardMonth := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7085 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7086 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7087 |
standardWeekDay |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7088 |
^ standardWeekDay |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7089 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7090 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7091 |
standardWeekDay:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7092 |
standardWeekDay := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7093 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7094 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7095 |
standardYear |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7096 |
^ standardYear |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7097 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7098 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7099 |
standardYear:something |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7100 |
standardYear := something. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7101 |
! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7102 |
|
17910 | 7103 |
standardYear:standardYearArg standardMonth:standardMonthArg standardDay:standardDayArg standardWeekDay:standardWeekDayArg standardHour:standardHourArg standardMinute:standardMinuteArg |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7104 |
standardYear := standardYearArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7105 |
standardMonth := standardMonthArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7106 |
standardDay := standardDayArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7107 |
standardWeekDay := standardWeekDayArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7108 |
standardHour := standardHourArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7109 |
standardMinute := standardMinuteArg. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7110 |
! ! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7111 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7112 |
!AbstractOperatingSystem::TimeZoneInfo methodsFor:'queries'! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7113 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7114 |
utcOffset |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7115 |
"return the difference between UTC (Greenwich Mean Time) and the local time in seconds. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7116 |
If daylight saving time applies to ourself, take that into account. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7117 |
Add utcOffset to convert from local time to UTC time. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7118 |
Subtract utcOffset to convert from UTC time to local time. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7119 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7120 |
If utcOffset is negative, the local timezone is east of Greenwich. |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7121 |
If utcOffset is positive, the local timezone is west of Greenwich." |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7122 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7123 |
^ (bias + daylightBias) * 60 |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7124 |
|
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7125 |
" |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7126 |
OperatingSystem utcOffset |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7127 |
" |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7128 |
! ! |
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
7129 |
|
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7130 |
!AbstractOperatingSystem class methodsFor:'documentation'! |
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7131 |
|
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7132 |
version |
17921 | 7133 |
^ '$Header: /cvs/stx/stx/libbasic/AbstractOperatingSystem.st,v 1.220 2012/01/23 13:08:04 cg Exp $' |
17735 | 7134 |
! |
7135 |
||
7136 |
version_CVS |
|
17921 | 7137 |
^ 'Header: /cvs/stx/stx/libbasic/AbstractOperatingSystem.st,v 1.220 2012/01/23 13:08:04 cg Exp ' |
17865 | 7138 |
! |
7139 |
||
7140 |
version_SVN |
|
17921 | 7141 |
^ '$Id: AbstractOperatingSystem.st 10777 2012-02-13 19:19:41Z vranyj1 $' |
3576
9287c054ac83
started to remove abbreviations ...
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7142 |
! ! |
6772 | 7143 |
|
17846 | 7144 |
AbstractOperatingSystem initialize! |
17892 | 7145 |
|
17909 | 7146 |
|
17910 | 7147 |
|
17911 | 7148 |
|
17912 | 7149 |
|
17921 | 7150 |