author | Claus Gittinger <cg@exept.de> |
Wed, 21 Dec 2005 14:39:49 +0100 | |
changeset 9029 | 09b858d6135d |
parent 9028 | b7d7b7b0ca4d |
child 9030 | ebfba7803a10 |
permissions | -rw-r--r-- |
1 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1988 by Claus Gittinger |
7616 | 3 |
All Rights Reserved |
1 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
5363 | 13 |
"{ Package: 'stx:libbasic' }" |
14 |
||
1 | 15 |
Object subclass:#Smalltalk |
7616 | 16 |
instanceVariableNames:'' |
8964
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
17 |
classVariableNames:'StartBlocks ImageStartBlocks ExitBlocks CachedClasses |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
18 |
NumberOfClassesHint SystemPath StartupClass StartupSelector |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
19 |
StartupArguments CommandLine CommandName CommandLineArguments |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
20 |
CachedAbbreviations SilentLoading Initializing StandAlone |
9029 | 21 |
HeadlessOperation IsPlugin DebuggingStandAlone LogDoits |
22 |
LoadBinaries RealSystemPath ResourcePath SourcePath BitmapPath |
|
23 |
BinaryPath FileInPath PackagePath BinaryDirName ResourceDirName |
|
8964
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
24 |
SourceDirName BitmapDirName PackageDirName FileInDirName |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
25 |
ChangeFileName ImageStartTime ImageRestartTime DemoMode |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
26 |
SaveEmergencyImage SpecialObjectArray CallbackSignal |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
27 |
KnownPackages ClassesFailedToInitialize' |
7616 | 28 |
poolDictionaries:'' |
29 |
category:'System-Support' |
|
1 | 30 |
! |
31 |
||
8845
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
32 |
Smalltalk comment:'declared from: ..\..\..\stx\libbasic\abbrev.stc' |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
33 |
! |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
34 |
|
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
35 |
!Smalltalk class methodsFor:'documentation'! |
70 | 36 |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
37 |
copyright |
617 | 38 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
39 |
COPYRIGHT (c) 1988 by Claus Gittinger |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
40 |
All Rights Reserved |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
41 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
42 |
This software is furnished under a license and may be used |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
43 |
only in accordance with the terms of that license and with the |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
44 |
inclusion of the above copyright notice. This software may not |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
45 |
be provided or otherwise made available to, or used by, any |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
46 |
other person. No title to or ownership of the software is |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
47 |
hereby transferred. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
48 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
49 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
50 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
51 |
documentation |
70 | 52 |
" |
53 |
This is one of the central classes in the system; |
|
54 |
it provides all system-startup, shutdown and maintenance support. |
|
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
55 |
Also global variables are (conceptionally) kept here. |
70 | 56 |
|
57 |
As you will notice, this is NOT a Dictionary |
|
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
58 |
- my implementation of globals is totally different |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
59 |
due to the need to be able to access globals from c-code as well, |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
60 |
I do not use associations for globals, but instead keep the |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
61 |
name<->value relations in the VM and access globals via utility |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
62 |
functions found there. |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
63 |
|
70 | 64 |
However, it provides the known enumeration protocol. |
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
65 |
It may change to become a subclass of collection at some time, |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
66 |
to inherit more collection stuff ... |
70 | 67 |
|
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
68 |
|
1286 | 69 |
[Instance variables:] |
7616 | 70 |
none - all handling is done in the VM |
1286 | 71 |
|
72 |
[Class variables:] |
|
73 |
||
7616 | 74 |
StartBlocks <Collection> blocks to be executed in a separate process after |
75 |
everything has been initialized. These blocks will |
|
76 |
be deleted after execution and therefore not be |
|
77 |
executed after an image restart. Initial processes |
|
78 |
(such as the Launcher) are usually started here. |
|
79 |
These blocks are added by smalltalk.rc/private.rc etc. |
|
80 |
via #addStartBlock during early initialization. |
|
81 |
||
82 |
ImageStartBlocks |
|
83 |
<Collection> blocks to be executed in a separate process after |
|
84 |
everything has been initialized. These blocks will be |
|
85 |
executed after an image restart. |
|
86 |
These blocks are usually added by smalltalk_r.rc etc. |
|
87 |
||
88 |
ExitBlocks <Collection> blocks to evaluate before system is |
|
89 |
left. Not currently used (GNU-ST compatibility). |
|
90 |
||
91 |
SystemPath <Collection> path to search for system files (sources, bitmaps etc) |
|
92 |
Set to a default here, but typically changed from some |
|
93 |
startup.rc file |
|
94 |
||
95 |
PackagePath <Collection> path to search for package. |
|
96 |
This is going to replace the above systemPath, and a classes |
|
97 |
resources will eventually searched in its package directory. |
|
98 |
This list defines the path, where packages are searched for, |
|
99 |
initially this is something like /opt/smalltalk/packages. |
|
100 |
Set to a default here, but typically changed from some |
|
101 |
startup.rc file |
|
102 |
||
103 |
StartupClass <Class> class and selector, where the system starts up |
|
104 |
StartupSelector <Symbol> (right after VM initialization) |
|
105 |
StartupArguments <Array> If an image is saved while those being nonNil, |
|
106 |
the image will come up there. |
|
107 |
Allows for customized images to be generated from a standard ST/X. |
|
108 |
StandAlone programs also set those during initialization. |
|
109 |
||
110 |
CommandLine <String> Unix (OS-) command line |
|
111 |
||
112 |
CommandName <String> the command (i.e. argv[0]) |
|
113 |
||
114 |
CommandLineArguments <Array> Unix (OS-) command line arguments broken into words |
|
115 |
CommandName has been stripped off. |
|
116 |
(initially set by the VM) |
|
117 |
||
118 |
SilentLoading <Boolean> suppresses messages during fileIn and in compiler |
|
119 |
(can be set to true from a customized main.c) |
|
120 |
||
121 |
Initializing <Boolean> true while (re-)initializing |
|
122 |
Controls the behavior of certain error |
|
123 |
reporters (for example: suppress dialogBoxes) |
|
124 |
while the system is not yet fit for full operation. |
|
125 |
||
126 |
StandAlone <Boolean> true, if this is a standalone app; |
|
127 |
if true the process scheduler watches for |
|
128 |
which processes are still running, and |
|
129 |
exits ST/X, when the last non-background |
|
130 |
and non-system process exits. |
|
131 |
Can be set in an application-specific startup script, |
|
132 |
or, for standAlone programs, by C-code during initialization. |
|
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
133 |
|
7616 | 134 |
HeadlessOperation if true, a non-existing Display connection |
135 |
<Boolean> will NOT lead to an error-exit during startup. |
|
136 |
Default is false. |
|
137 |
Can be set in an application-specific startup script, |
|
138 |
or, for standAlone programs, by C-code during initialization. |
|
139 |
||
140 |
LogDoits <Boolean> if true, doits are also logged in the changes |
|
141 |
file. Default is false, since the changes file |
|
142 |
may become huge if every tiny doIt is saved there ... |
|
143 |
||
144 |
LoadBinaries <Boolean> if true, we attempt to load classes rom a binary |
|
145 |
file, if present. If false, this is always suppressed. |
|
146 |
||
147 |
SaveEmergencyImage <Boolean> if true (the default), an emergency image |
|
148 |
is saved, if the main Display looses its |
|
149 |
connection. This is useful if you have a |
|
150 |
flaky display connection (serial line) |
|
151 |
and want to have your stuff saved automatically |
|
152 |
in case of a broken connection. |
|
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
153 |
|
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
154 |
strictly private classVariables (helpers): |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
155 |
|
7616 | 156 |
CachedClasses <Collection> known classes (cached for faster class enumeration) |
157 |
||
158 |
CachedAbbreviations |
|
159 |
<Dictionary> className to filename mappings |
|
160 |
||
161 |
RealSystemPath <Collection> cached collection of directories along the path |
|
162 |
which really exist. Caching avoids long checks |
|
163 |
for existing directories on broken NFS volumes. |
|
164 |
||
165 |
SourcePath <Collection> cached names of really existing directories |
|
166 |
BitmapPath These are remembered, since in NFS systems, |
|
167 |
ResourcePath the time to lookup files may become long |
|
168 |
BinaryPath (especially, if some directories are on machines |
|
169 |
FileInPath which are not up ...). |
|
170 |
Therefore, the set of really |
|
171 |
existing directories is cached when the SystemPath |
|
172 |
is walked the first time. |
|
173 |
A consequence is that you have to invoke |
|
174 |
flushSystemPath, when you create any of those |
|
175 |
directories while running |
|
176 |
(and want the running ST/X to look there) |
|
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
177 |
|
1286 | 178 |
|
179 |
[author:] |
|
7616 | 180 |
Claus Gittinger |
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
181 |
|
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
182 |
[see also:] |
7616 | 183 |
ObjectMemory |
70 | 184 |
" |
8945 | 185 |
! |
186 |
||
187 |
readme_resources |
|
188 |
" |
|
189 |
What is a resource file: |
|
190 |
resource files contain language transformation and sometimes |
|
191 |
UI-look specifics such as icons etc. |
|
192 |
||
193 |
Where are resources stored in the image: |
|
9014 | 194 |
Resource files are only read on demand (i.e. when needed) and only read once |
195 |
i.e. they are cached in the image). |
|
8945 | 196 |
The cached data is held in a per-class class-instVar named 'ClassResources'. |
197 |
With only a few exceptions, the only classes which need resources are the GUI |
|
9014 | 198 |
classes under the SimpleView hierarchy. |
8945 | 199 |
|
200 |
How does the system find resources: |
|
201 |
The idea is that the system-provided resource files can be overwritten |
|
202 |
by the user or an application configuration. |
|
203 |
This works via a hierarchy of directories where resources are searched for, |
|
9014 | 204 |
with the systems standard resource-files being at the end of that chain. |
8945 | 205 |
|
206 |
When searching for a resource file for class X, the following files are searched |
|
207 |
in order: |
|
208 |
{ResourcePath} / resources / X.rs |
|
9014 | 209 |
{SystemPath} / (CLASSES-PACKAGE-PATH) / X.rs |
8945 | 210 |
{ResourcePath} / (CLASSES-PACKAGE-PATH) / X.rs |
211 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
212 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
213 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
214 |
!Smalltalk class methodsFor:'initialization'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
215 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
216 |
initGlobalsFromEnvironment |
617 | 217 |
"setup globals from the shell-environment" |
218 |
||
219 |
|envString i langString terrString| |
|
220 |
||
5406 | 221 |
StandAlone isNil ifTrue:[ |
7779
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
222 |
StandAlone := false. |
5406 | 223 |
]. |
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
224 |
HeadlessOperation isNil ifTrue:[ |
7779
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
225 |
HeadlessOperation := false. |
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
226 |
]. |
5406 | 227 |
|
617 | 228 |
" |
229 |
extract Language and LanguageTerritory from LANG variable. |
|
5846 | 230 |
valid are for example: |
7779
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
231 |
en_en / en |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
232 |
en_us |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
233 |
en_gb |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
234 |
de_de / de |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
235 |
de_at (for Austria) |
5846 | 236 |
" |
237 |
||
238 |
Language := #en. |
|
994
6163ae7aaf9b
territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
239 |
LanguageTerritory := #us. |
617 | 240 |
|
5846 | 241 |
|
242 |
"Format of LANG is: language[_territory][.codeset][@modifier] |
|
7779
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
243 |
language ISO-639 Language code |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
244 |
territory ISO-3166 Contry code" |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
245 |
|
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
246 |
envString := OperatingSystem getLanguage. |
3991
7b53bc45bf91
(isNil or:[isEmpty ]) -> (size == 0)
Claus Gittinger <cg@exept.de>
parents:
3988
diff
changeset
|
247 |
envString size > 0 ifTrue:[ |
7779
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
248 |
i := envString indexOf:$@. |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
249 |
(i ~~ 0) ifTrue:[ |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
250 |
envString := envString copyTo:(i - 1). |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
251 |
LanguageModifier := (envString copyFrom:(i + 1)) asLowercase asSymbol. |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
252 |
] ifFalse:[ |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
253 |
LanguageModifier := nil. |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
254 |
]. |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
255 |
i := envString indexOf:$.. |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
256 |
(i ~~ 0) ifTrue:[ |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
257 |
envString := envString copyTo:(i - 1). |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
258 |
LanguageCodeset := (envString copyFrom:(i + 1)) asLowercase asSymbol |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
259 |
] ifFalse:[ |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
260 |
LanguageCodeset := #'iso8859-1'. |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
261 |
]. |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
262 |
i := envString indexOf:$_. |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
263 |
(i == 0) ifTrue:[ |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
264 |
langString := envString. |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
265 |
terrString := envString |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
266 |
] ifFalse:[ |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
267 |
langString := envString copyTo:(i - 1). |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
268 |
terrString := envString copyFrom:(i + 1) |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
269 |
]. |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
270 |
Language := langString asLowercase asSymbol. |
6d88d32bdd64
Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents:
7763
diff
changeset
|
271 |
LanguageTerritory := terrString asLowercase asSymbol |
617 | 272 |
]. |
273 |
||
274 |
" |
|
275 |
Smalltalk initGlobalsFromEnvironment |
|
276 |
" |
|
994
6163ae7aaf9b
territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
277 |
|
6163ae7aaf9b
territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
278 |
"Modified: 22.2.1996 / 16:59:12 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
279 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
280 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
281 |
initInterrupts |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
282 |
"initialize interrupts" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
283 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
284 |
OperatingSystem enableUserInterrupts. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
285 |
OperatingSystem enableHardSignalInterrupts. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
286 |
OperatingSystem enableCrashSignalInterrupts. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
287 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
288 |
ObjectMemory userInterruptHandler:self. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
289 |
ObjectMemory signalInterruptHandler:self. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
290 |
ObjectMemory recursionInterruptHandler:self. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
291 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
292 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
293 |
Smalltalk initInterrupts |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
294 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
295 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
296 |
"Modified: 20.8.1997 / 09:35:49 / stefan" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
297 |
! |
617 | 298 |
|
299 |
initStandardStreams |
|
300 |
"initialize some well-known streams" |
|
301 |
||
302 |
Stdout := NonPositionableExternalStream forStdout. |
|
303 |
Stderr := NonPositionableExternalStream forStderr. |
|
304 |
Stdin := NonPositionableExternalStream forStdin. |
|
305 |
Printer := PrinterStream. |
|
306 |
Transcript := Stderr |
|
307 |
||
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
308 |
" |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
309 |
Smalltalk initStandardStreams |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
310 |
" |
617 | 311 |
! |
312 |
||
313 |
initStandardTools |
|
314 |
"predefine some tools which we will need later |
|
315 |
- if the view-classes exist, |
|
316 |
they will redefine Inspector and Debugger for graphical interfaces" |
|
317 |
||
318 |
"redefine debug-tools, if view-classes exist" |
|
319 |
||
320 |
Display notNil ifTrue:[ |
|
7616 | 321 |
InspectorView notNil ifTrue:[ |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
322 |
Inspector := InspectorView |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
323 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
324 |
DebugView notNil ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
325 |
Debugger := DebugView |
7616 | 326 |
]. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
327 |
Display initialize |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
328 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
329 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
330 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
331 |
Smalltalk initStandardTools |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
332 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
333 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
334 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
335 |
initSystemPath |
617 | 336 |
"setup path where system files are searched for. |
337 |
the default path is set to: |
|
9021 | 338 |
. |
339 |
<directory of exe> (WIN32 only) |
|
340 |
$HOME (if defined) |
|
341 |
$HOME/.smalltalk (if defined & existing) |
|
342 |
$SMALLTALK_LIBDIR (if defined & existing) |
|
343 |
$STX_LIBDIR (if defined & existing) |
|
344 |
$STX_TOPDIR (if defined & existing) |
|
345 |
REGISTRY('HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\<CurrentVersion>\LibDir') (WIN32 only) |
|
346 |
REGISTRY('HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\LibDir') (WIN32 only) |
|
347 |
<standard places> |
|
348 |
||
349 |
standard places (unix): |
|
350 |
/opt/smalltalk/<release> (if existing) |
|
351 |
/opt/smalltalk (if existing) |
|
352 |
/usr/local/lib/smalltalk (if existing) |
|
353 |
/usr/lib/smalltalk (if existing) |
|
354 |
/lib/smalltalk (if existing) |
|
4001
fa75465bd263
made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents:
3991
diff
changeset
|
355 |
|
fa75465bd263
made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents:
3991
diff
changeset
|
356 |
win32: |
9021 | 357 |
\programs\exept\smalltalk (if existing) |
358 |
\programs\smalltalk (if existing) |
|
359 |
\smalltalk (if existing) |
|
4001
fa75465bd263
made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents:
3991
diff
changeset
|
360 |
|
fa75465bd263
made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents:
3991
diff
changeset
|
361 |
vms: |
9021 | 362 |
$stx:lib (if existing) |
363 |
$stx:root (if existing) |
|
617 | 364 |
|
365 |
of course, it is possible to add entries from the 'smalltalk.rc' |
|
366 |
startup file; add expressions such as: |
|
9021 | 367 |
Smalltalk systemPath addFirst:'/foo/bar/baz'. |
368 |
or: |
|
369 |
Smalltalk systemPath addLast:'/fee/foe/foo'. |
|
4001
fa75465bd263
made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents:
3991
diff
changeset
|
370 |
|
fa75465bd263
made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents:
3991
diff
changeset
|
371 |
However, smalltalk.rc itself must be found along the above path. |
617 | 372 |
" |
373 |
||
2928 | 374 |
ChangeFileName := 'changes'. |
375 |
OperatingSystem isVMSlike ifTrue:[ |
|
9021 | 376 |
BitmapDirName := 'bitmaps.dir'. |
377 |
BinaryDirName := 'binary.dir'. |
|
378 |
SourceDirName := 'source.dir'. |
|
379 |
ResourceDirName := 'resources.dir'. |
|
380 |
FileInDirName := 'filein.dir'. |
|
381 |
PackageDirName := 'packages.dir'. |
|
2928 | 382 |
] ifFalse:[ |
9021 | 383 |
BitmapDirName := 'bitmaps'. |
384 |
BinaryDirName := 'binary'. |
|
385 |
SourceDirName := 'source'. |
|
386 |
ResourceDirName := 'resources'. |
|
387 |
FileInDirName := 'fileIn'. |
|
388 |
PackageDirName := 'packages'. |
|
2928 | 389 |
]. |
390 |
||
680 | 391 |
SystemPath isNil ifTrue:[ |
9021 | 392 |
SystemPath := OperatingSystem defaultSystemPath. |
393 |
self flushPathCaches |
|
5139 | 394 |
]. |
395 |
||
5144 | 396 |
PackagePath isNil ifTrue:[ |
9021 | 397 |
PackagePath := OperatingSystem defaultPackagePath. |
5144 | 398 |
]. |
617 | 399 |
|
400 |
" |
|
401 |
Smalltalk initSystemPath |
|
402 |
Smalltalk systemPath |
|
403 |
" |
|
5139 | 404 |
|
5145 | 405 |
"Modified: / 24.12.1999 / 00:23:35 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
406 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
407 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
408 |
initUserPreferences |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
409 |
"setup other stuff" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
410 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
411 |
LogDoits := false. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
412 |
LoadBinaries := false. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
413 |
SaveEmergencyImage := (StandAlone ~~ true). |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
414 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
415 |
"Modified: / 24.10.1997 / 18:22:47 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
416 |
! |
617 | 417 |
|
7526 | 418 |
initializeClass:aClass |
419 |
"sent from VM via #initializeModules" |
|
420 |
||
7527 | 421 |
Error handle:[:ex | |
7616 | 422 |
ClassesFailedToInitialize isNil ifTrue:[ |
423 |
ClassesFailedToInitialize := IdentitySet new. |
|
424 |
]. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
425 |
ClassesFailedToInitialize add:aClass. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
426 |
('Smalltalk [warning]: error during initialize of ' , aClass name,': ', ex description printString) errorPrintCR. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
427 |
(Smalltalk commandLineArguments includes:'--debug') ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
428 |
ex reject |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
429 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
430 |
] do:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
431 |
aClass initialize |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
432 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
433 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
434 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
435 |
initializeModules |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
436 |
"perform module specific initialization and |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
437 |
send #initialize to all classes. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
438 |
Notice: this is not called when an image is restarted" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
439 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
440 |
self initializeModulesOnce. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
441 |
ClassesFailedToInitialize size > 0 ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
442 |
('Smalltalk [info]: retry initialization of failed class(es)...') infoPrintCR. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
443 |
ClassesFailedToInitialize := nil. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
444 |
self initializeModulesOnce. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
445 |
ClassesFailedToInitialize size > 0 ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
446 |
('Smalltalk [error]: class(es) persist to fail during initialize') errorPrintCR. |
7616 | 447 |
] |
7527 | 448 |
]. |
449 |
! |
|
450 |
||
7563 | 451 |
initializeModulesOnce |
452 |
"perform module specific initialization and |
|
453 |
send #initialize to all classes. |
|
7527 | 454 |
Notice: this is not called when an image is restarted" |
4963 | 455 |
|
617 | 456 |
%{ |
1688
8a42db1eea60
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
1682
diff
changeset
|
457 |
__init_registered_modules__(3); |
4963 | 458 |
|
1481 | 459 |
@global(DemoMode) = __getDemoMode() ? true : false; |
5410 | 460 |
RETURN (self); |
461 |
%}. |
|
462 |
^ self primitiveFailed |
|
617 | 463 |
! |
464 |
||
7563 | 465 |
initializeSystem |
466 |
"initialize all other classes; setup dispatcher processes etc. |
|
3499 | 467 |
This one is the very first entry into the smalltalk world, |
468 |
right after startup, ususally immediately followed by Smalltalk>>start. |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
469 |
Notice: |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
470 |
this is not called when an image is restarted; in this |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
471 |
case the show starts in Smalltalk>>restart." |
211 | 472 |
|
6841
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
473 |
|idx| |
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
474 |
|
8964
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
475 |
NumberOfClassesHint := 4500. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
476 |
|
3499 | 477 |
Initializing := true. |
6841
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
478 |
|
3499 | 479 |
AbstractOperatingSystem initializeConcreteClass. |
480 |
||
5400 | 481 |
CommandLineArguments isNil ifTrue:[ |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
482 |
CommandLineArguments := #('stx'). |
5400 | 483 |
]. |
4006
c7ad38c52eb9
must set CommandLineArguments earlier (to be available in initializeSystem)
Claus Gittinger <cg@exept.de>
parents:
4001
diff
changeset
|
484 |
CommandLine := CommandLineArguments copy. |
c7ad38c52eb9
must set CommandLineArguments earlier (to be available in initializeSystem)
Claus Gittinger <cg@exept.de>
parents:
4001
diff
changeset
|
485 |
CommandLineArguments := CommandLineArguments asOrderedCollection. |
6842 | 486 |
CommandName := CommandLineArguments removeFirst. "/ the command |
4006
c7ad38c52eb9
must set CommandLineArguments earlier (to be available in initializeSystem)
Claus Gittinger <cg@exept.de>
parents:
4001
diff
changeset
|
487 |
|
4028
b46539f16af5
added --silentStartup argument
Claus Gittinger <cg@exept.de>
parents:
4026
diff
changeset
|
488 |
SilentLoading := (CommandLineArguments includes:'--silentStartup'). |
348 | 489 |
|
6841
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
490 |
DebuggingStandAlone := false. |
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
491 |
|
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
492 |
StandAlone ifTrue:[ |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
493 |
InfoPrinting := false. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
494 |
ObjectMemory infoPrinting:false. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
495 |
|
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
496 |
idx := CommandLineArguments indexOf:'--debug'. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
497 |
idx ~~ 0 ifTrue:[ |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
498 |
DebuggingStandAlone := true. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
499 |
]. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
500 |
DebuggingStandAlone ifTrue:[ |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
501 |
Inspector := MiniInspector. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
502 |
Debugger := MiniDebugger. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
503 |
]. |
6841
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
504 |
] ifFalse:[ |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
505 |
"/ |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
506 |
"/ define low-level debugging tools - graphical classes are not prepared yet |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
507 |
"/ to handle things. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
508 |
"/ This will bring us into the MiniDebugger when an error occurs during startup. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
509 |
"/ |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
510 |
Inspector := MiniInspector. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
511 |
Debugger := MiniDebugger. |
6841
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
512 |
]. |
1 | 513 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
514 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
515 |
"/ start catching SIGSEGV and SIGBUS |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
516 |
"/ |
713
32540afb8ffc
setup SIGSEGV/SIGBUS handling early - to catch those during startup
Claus Gittinger <cg@exept.de>
parents:
706
diff
changeset
|
517 |
OperatingSystem enableHardSignalInterrupts. |
32540afb8ffc
setup SIGSEGV/SIGBUS handling early - to catch those during startup
Claus Gittinger <cg@exept.de>
parents:
706
diff
changeset
|
518 |
|
1 | 519 |
self initGlobalsFromEnvironment. |
520 |
||
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
521 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
522 |
"/ sorry - there are some, which MUST be initialized before .. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
523 |
"/ reason: if any error happens during init, we need Signals, Stdout etc. to be there |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
524 |
"/ |
1 | 525 |
Object initialize. |
7704 | 526 |
Stream initialize. |
527 |
PositionableStream initialize. |
|
2907 | 528 |
Filename initialize. |
326 | 529 |
ObjectMemory initialize. |
2504
ece15ffbcb69
Initialize OperatingSystem early (needed for some signals).
Stefan Vogel <sv@exept.de>
parents:
2485
diff
changeset
|
530 |
OperatingSystem initialize. |
1 | 531 |
ExternalStream initialize. |
211 | 532 |
|
533 |
self initStandardStreams. "/ setup Stdin, Stdout etc. |
|
1 | 534 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
535 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
536 |
"/ sorry, path must be set before ... |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
537 |
"/ reason: some classes need it during initialize (they might need resources, bitmaps etc) |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
538 |
"/ |
1 | 539 |
self initSystemPath. |
540 |
||
541 |
Compiler := ByteCodeCompiler. |
|
542 |
Compiler isNil ifTrue:[ |
|
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
543 |
" |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
544 |
ByteCodeCompiler is not in the system (i.e. has not been linked in) |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
545 |
this allows at least immediate evaluations for runtime systems without compiler |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
546 |
NOTICE: a parser is always needed, otherwise we cannot read resource files etc. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
547 |
" |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
548 |
Compiler := Parser |
1 | 549 |
]. |
550 |
||
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
551 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
552 |
"/ another one, to be initialized before others |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
553 |
"/ |
2077
6b5dc412dd15
must initialize Processor before doing modulInits
Claus Gittinger <cg@exept.de>
parents:
2076
diff
changeset
|
554 |
ProcessorScheduler initialize. |
6b5dc412dd15
must initialize Processor before doing modulInits
Claus Gittinger <cg@exept.de>
parents:
2076
diff
changeset
|
555 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
556 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
557 |
"/ now, finally, initialize all other classes |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
558 |
"/ |
325 | 559 |
self initializeModules. |
560 |
||
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
561 |
ImageStartTime := Timestamp now. |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
562 |
|
70 | 563 |
self initInterrupts. |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
564 |
self initUserPreferences. |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
565 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
566 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
567 |
"/ give classes a chance to perform 2nd-level initialization |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
568 |
"/ now, we are certain, that all other classes have been initialized |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
569 |
"/ (especially: streams and signals can now be used) |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
570 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
571 |
ObjectMemory changed:#initialized. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
572 |
|
2504
ece15ffbcb69
Initialize OperatingSystem early (needed for some signals).
Stefan Vogel <sv@exept.de>
parents:
2485
diff
changeset
|
573 |
"Modified: 8.1.1997 / 19:58:12 / stefan" |
2907 | 574 |
"Modified: 7.9.1997 / 23:34:44 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
575 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
576 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
577 |
isInitialized |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
578 |
"this returns true, if the system is properly initialized; |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
579 |
i.e. false during startup. Especially, the whole viewing stuff is |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
580 |
not working correctly until initialized." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
581 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
582 |
^ Initializing not |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
583 |
! |
1 | 584 |
|
7563 | 585 |
reinitStandardStreams |
586 |
"reinitialize some well-known streams. |
|
587 |
Tis must be done very early during startup, to allow for |
|
477
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
588 |
debug and trace messages to be output |
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
589 |
(otherwise, the file-descriptors are invalid)" |
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
590 |
|
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
591 |
Stdout reOpen. Stderr reOpen. Stdin reOpen. |
161 | 592 |
! ! |
593 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
594 |
!Smalltalk class methodsFor:'Compatibility-Squeak'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
595 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
596 |
beep |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
597 |
Screen current beep |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
598 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
599 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
600 |
garbageCollect |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
601 |
ObjectMemory garbageCollect |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
602 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
603 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
604 |
garbageCollectMost |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
605 |
"collect recently created garbage; return the amount of freeSpace. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
606 |
In ST/X, only the newSpace is collected here, and the sum of |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
607 |
newSpace + freeListSpace is returned." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
608 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
609 |
ObjectMemory scavenge. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
610 |
^ ObjectMemory freeSpace |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
611 |
+ (ObjectMemory newSpaceSize - ObjectMemory newSpaceUsed) |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
612 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
613 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
614 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
615 |
isMorphic |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
616 |
^ false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
617 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
618 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
619 |
registerExternalObject: anObject |
7563 | 620 |
"Register the given object in the external objects array and return its index. |
4584
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
621 |
If it is already there, just return its index. |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
622 |
ExternalObjects are protected from GC and can be accessed easily from |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
623 |
primitive code (via the global Smalltalk:SpecialObjectArray)" |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
624 |
|
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
625 |
| objects firstEmptyIndex obj sz newObjects | |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
626 |
|
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
627 |
objects := SpecialObjectArray. |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
628 |
objects isNil ifTrue:[ |
7616 | 629 |
objects := Array new:5. |
4584
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
630 |
]. |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
631 |
|
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
632 |
"find the first empty slot and look if already registered" |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
633 |
firstEmptyIndex := 0. |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
634 |
1 to: objects size do: [:i | |
7616 | 635 |
obj := objects at: i. |
636 |
obj == anObject ifTrue: [^ i]. "object already there, just return its index" |
|
637 |
(obj == nil and: [firstEmptyIndex = 0]) ifTrue: [ |
|
638 |
firstEmptyIndex := i |
|
639 |
] |
|
4584
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
640 |
]. |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
641 |
|
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
642 |
"if no empty slots, expand the array" |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
643 |
firstEmptyIndex = 0 ifTrue: [ |
7616 | 644 |
sz := objects size. |
645 |
newObjects := objects species new: sz + 20. "grow linearly" |
|
646 |
newObjects replaceFrom: 1 to: sz with: objects startingAt: 1. |
|
647 |
firstEmptyIndex := sz + 1. |
|
648 |
SpecialObjectArray := newObjects. |
|
649 |
objects := newObjects |
|
4584
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
650 |
]. |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
651 |
|
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
652 |
objects at: firstEmptyIndex put: anObject. |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
653 |
^ firstEmptyIndex |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
654 |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
655 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
656 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
657 |
renameClassNamed:oldName as:newName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
658 |
self renameClass:(self at:oldName) to:newName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
659 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
660 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
661 |
unregisterExternalObject: anObject |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
662 |
"Unregister the given object in the external objects array. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
663 |
Do nothing if it isn't registered." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
664 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
665 |
|objects| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
666 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
667 |
anObject isNil ifTrue:[^ self]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
668 |
objects := SpecialObjectArray. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
669 |
1 to: objects size do: [:i | |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
670 |
(objects at: i) == anObject ifTrue: [ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
671 |
objects at: i put: nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
672 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
673 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
674 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
675 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
676 |
!Smalltalk class methodsFor:'Compatibility-V''Age'! |
6722
8388292bc41d
allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
677 |
|
7563 | 678 |
allClassesImplementing:aSelector |
679 |
^ self allClasses select:[:cls | cls implements:aSelector]. |
|
6722
8388292bc41d
allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
680 |
! ! |
8388292bc41d
allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
681 |
|
7295 | 682 |
!Smalltalk class methodsFor:'Compatibility-VW5.4'! |
6094
79ebf84b51bd
first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents:
6080
diff
changeset
|
683 |
|
7563 | 684 |
defineClass:nameSymbol superclass:superclass indexedType:indexed private:private instanceVariableNames:instVars classInstanceVariableNames:classInstVars imports:imports category:category attributes:annotations |
6094
79ebf84b51bd
first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents:
6080
diff
changeset
|
685 |
|newClass| |
79ebf84b51bd
first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents:
6080
diff
changeset
|
686 |
|
79ebf84b51bd
first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents:
6080
diff
changeset
|
687 |
indexed == #none ifTrue:[ |
7616 | 688 |
newClass := superclass |
689 |
subclass:nameSymbol |
|
690 |
instanceVariableNames:instVars |
|
691 |
classVariableNames:'' |
|
692 |
poolDictionaries:'' |
|
693 |
category:category |
|
694 |
inEnvironment:self. |
|
695 |
classInstVars size > 0 ifTrue:[ |
|
696 |
newClass class instanceVariableNames:classInstVars. |
|
697 |
]. |
|
698 |
^ newClass |
|
6851 | 699 |
]. |
700 |
self shouldImplement. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
701 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
702 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
703 |
!Smalltalk class methodsFor:'accessing'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
704 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
705 |
associationAt:aKey |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
706 |
"return a key-value association for aKey. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
707 |
Since ST/X's Smalltalk as no real dictionary, this is |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
708 |
simulated here." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
709 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
710 |
|val| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
711 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
712 |
val := self at:aKey ifAbsent:nil. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
713 |
val isNil ifTrue:[^ nil]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
714 |
^ Association key:aKey value:val |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
715 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
716 |
"Created: / 1.11.1997 / 13:27:20 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
717 |
! |
3083 | 718 |
|
7563 | 719 |
associationAt:aKey ifAbsent:exceptionBlock |
720 |
"return a key-value association for aKey, or the value |
|
3610
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
721 |
from exceptionBlock, if no such key is present. |
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
722 |
Since ST/X's Smalltalk as no real dictionary, this is |
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
723 |
simulated here." |
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
724 |
|
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
725 |
|val| |
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
726 |
|
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
727 |
val := self at:aKey ifAbsent:nil. |
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
728 |
val isNil ifTrue:[^ exceptionBlock value]. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
729 |
^ Association key:aKey value:val |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
730 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
731 |
"Created: / 18.6.1998 / 17:05:24 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
732 |
! |
3610
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
733 |
|
7563 | 734 |
at:aKey |
735 |
"retrieve the value stored under aKey, a symbol. |
|
736 |
Return nil if not present |
|
1956 | 737 |
(this will be changed to trigger an error - better use #at:ifAbsent:)" |
453 | 738 |
|
6851 | 739 |
aKey class == String ifTrue:[self error:'expected symbol']. |
6080
15ea3cbf6003
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6074
diff
changeset
|
740 |
|
453 | 741 |
%{ /* NOCONTEXT */ |
742 |
RETURN ( __GLOBAL_GET(aKey) ); |
|
5406 | 743 |
%}. |
5410 | 744 |
^ self primitiveFailed |
453 | 745 |
! |
746 |
||
7563 | 747 |
at:aKey ifAbsent:aBlock |
748 |
"retrieve the value stored at aKey. |
|
7565 | 749 |
If there is nothing stored under this key, return the value of |
750 |
the evaluation of aBlock." |
|
453 | 751 |
|
752 |
(self includesKey:aKey) ifTrue:[ |
|
7616 | 753 |
^ self at:aKey |
453 | 754 |
]. |
755 |
^ aBlock value |
|
756 |
||
757 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
758 |
Smalltalk at:#fooBar <- returns nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
759 |
Smalltalk at:#fooBar ifAbsent:['sorry'] <- no error |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
760 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
761 |
! |
453 | 762 |
|
7563 | 763 |
at:aKey ifPresent:aBlock |
764 |
"try to retrieve the value stored at aKey. |
|
765 |
If there is nothing stored under this key, do nothing. |
|
4870 | 766 |
Otherwise, evaluate aBlock, passing the retrieved value as argument." |
767 |
||
768 |
(self includesKey:aKey) ifTrue:[ |
|
7616 | 769 |
^ aBlock value:(self at:aKey) |
4870 | 770 |
]. |
771 |
^ nil |
|
772 |
||
773 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
774 |
Smalltalk at:#fooBar ifPresent:[:what | Transcript showCR:what]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
775 |
Smalltalk at:#Object ifPresent:[:what | Transcript showCR:what]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
776 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
777 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
778 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
779 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
780 |
at:aKey put:aValue |
7563 | 781 |
"store the argument aValue under aKey, a symbol. |
782 |
Return aValue (sigh)." |
|
453 | 783 |
|
784 |
|oldValue| |
|
785 |
||
786 |
%{ |
|
787 |
oldValue = __GLOBAL_SET(aKey, aValue, (OBJ *)0); |
|
788 |
%}. |
|
789 |
CachedClasses notNil ifTrue:[ |
|
7616 | 790 |
oldValue isBehavior ifTrue:[ |
791 |
oldValue name == aKey ifTrue:[ |
|
792 |
CachedClasses remove:oldValue ifAbsent:[] |
|
793 |
] |
|
794 |
]. |
|
795 |
aValue isBehavior ifTrue:[ |
|
1956 | 796 |
"/ aValue isMeta ifTrue:[ |
797 |
"/ "/ this should not happen |
|
798 |
"/ ('SMALLTALK: store a Metaclass: ' , aValue name , ' as ' , aKey) infoPrintCR. |
|
799 |
"/ ]. |
|
800 |
||
7616 | 801 |
aValue name == aKey ifTrue:[ |
802 |
CachedClasses add:aValue |
|
803 |
] ifFalse:[ |
|
804 |
CachedClasses := nil |
|
805 |
] |
|
806 |
]. |
|
453 | 807 |
]. |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
808 |
^ aValue. |
1955 | 809 |
"/ |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
810 |
"/%{ /* NOCONTEXT */ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
811 |
"/ (void) __GLOBAL_SET(aKey, aValue, (OBJ *)0); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
812 |
"/%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
813 |
"/ CachedClasses := nil. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
814 |
"/ ^ aValue |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
815 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
816 |
"Modified: 19.4.1996 / 11:31:49 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
817 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
818 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
819 |
includesKey:aKey |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
820 |
"return true, if the key is known" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
821 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
822 |
"/ for debugging - this is a common mistake, |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
823 |
"/ to try to access a class by nameString, instead |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
824 |
"/ of by symbol. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
825 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
826 |
"/ aKey class == String ifTrue:[self halt]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
827 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
828 |
%{ /* NOCONTEXT */ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
829 |
RETURN ( __GLOBAL_KEYKNOWN(aKey) ); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
830 |
%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
831 |
^ self primitiveFailed |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
832 |
! |
453 | 833 |
|
7563 | 834 |
keyAtValue:anObject |
835 |
"return the symbol under which anObject is stored - or nil" |
|
453 | 836 |
|
837 |
self keysDo:[:aKey | |
|
7616 | 838 |
(self at:aKey) == anObject ifTrue:[^ aKey] |
453 | 839 |
]. |
840 |
^ nil |
|
841 |
||
842 |
"Smalltalk keyAtValue:Object" |
|
843 |
! |
|
844 |
||
7563 | 845 |
keys |
846 |
"return a collection with all keys in the Smalltalk dictionary" |
|
847 |
||
848 |
|keys| |
|
453 | 849 |
|
850 |
keys := IdentitySet new. |
|
851 |
self keysDo:[:k | keys add:k]. |
|
852 |
^ keys |
|
617 | 853 |
! |
854 |
||
7563 | 855 |
removeKey:aKey |
856 |
"remove the association stored under the key-argument from the globals dictionary. |
|
878
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
857 |
WARNING: |
7616 | 858 |
this is somewhat dangerous: conceptionally, the association is removed, |
859 |
to which machine & byte compiled code refers if it accesses a global. |
|
860 |
If there are still global accesses in some literalArray or from machine-compiled code, |
|
861 |
it continues to reference the globals value via that obsolete association and gets a nil |
|
862 |
value. (which is correct) |
|
863 |
However, if that global is later reintroduced, a new association will be created and |
|
864 |
the new global now referenced via the new association. |
|
865 |
The old accesses will still see nil, although the globals value is actually non-nil |
|
866 |
(this is questionable). |
|
867 |
To avoid this problem, the #removeClass: method never removed the key." |
|
617 | 868 |
|
869 |
CachedClasses := nil. |
|
870 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
871 |
%{ /* NOCONTEXT */ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
872 |
RETURN ( __GLOBAL_REMOVE(aKey) ); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
873 |
%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
874 |
^ self primitiveFailed |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
875 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
876 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
877 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
878 |
values |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
879 |
"return a collection with all values in the Smalltalk dictionary" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
880 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
881 |
|values| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
882 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
883 |
values := OrderedCollection new. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
884 |
self do:[:v | values add:v]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
885 |
^ values |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
886 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
887 |
"Created: 20.6.1997 / 16:58:28 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
888 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
889 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
890 |
!Smalltalk class methodsFor:'binary storage'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
891 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
892 |
addGlobalsForBinaryStorageTo:globalDictionary |
7563 | 893 |
|pools| |
894 |
||
895 |
pools := Set new. |
|
2465
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
896 |
|
879 | 897 |
self keysAndValuesDo:[:key :value | |
7616 | 898 |
(key includes:$:) ifFalse:[ "/ skip classVars |
899 |
(value ~~ self |
|
900 |
and:[value notNil]) ifTrue:[ |
|
901 |
value isClass ifTrue:[ |
|
902 |
value addGlobalsForBinaryStorageTo:globalDictionary. |
|
903 |
pools addAll:value sharedPools |
|
904 |
] ifFalse:[ |
|
905 |
globalDictionary at:(key->value) put:self |
|
906 |
]. |
|
907 |
value notNil ifTrue:[ |
|
908 |
globalDictionary at:value put:self |
|
909 |
] |
|
910 |
] |
|
911 |
] |
|
453 | 912 |
]. |
913 |
||
914 |
pools do:[:poolDictionary| |
|
7616 | 915 |
poolDictionary addGlobalsForBinaryStorageTo:globalDictionary |
453 | 916 |
] |
2465
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
917 |
|
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
918 |
"Modified: 19.3.1997 / 18:15:25 / cg" |
2476 | 919 |
"Created: 21.3.1997 / 15:40:31 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
920 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
921 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
922 |
storeBinaryDefinitionOf:anObject on:stream manager:manager |
7563 | 923 |
|string| |
924 |
||
925 |
anObject class == Association ifTrue:[ |
|
7616 | 926 |
string := 'Smalltalk associationAt: ', anObject key storeString |
453 | 927 |
] ifFalse: [ |
7616 | 928 |
string := 'Smalltalk at: ', (self keyAtValue: anObject) storeString |
453 | 929 |
]. |
930 |
stream nextNumber:2 put:string size. |
|
2465
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
931 |
stream nextPutBytes:(string size) from:string startingAt:1. |
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
932 |
"/ string do:[:char | stream nextPut:char asciiValue] |
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
933 |
|
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
934 |
"Modified: 19.3.1997 / 18:49:14 / cg" |
453 | 935 |
! ! |
936 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
937 |
!Smalltalk class methodsFor:'browsing'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
938 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
939 |
browseAllCallsOn:aSelectorSymbol |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
940 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
941 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
942 |
"startup a browser for all methods sending a particular message" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
943 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
944 |
UserPreferences systemBrowserClass browseAllCallsOn:aSelectorSymbol |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
945 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
946 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
947 |
Smalltalk browseAllCallsOn:#at:put: |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
948 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
949 |
! |
617 | 950 |
|
7563 | 951 |
browseAllSelect:aBlock |
952 |
"{ Pragma: +optSpace }" |
|
953 |
||
954 |
"startup a browser for all methods for which aBlock returns true" |
|
617 | 955 |
|
6020 | 956 |
UserPreferences systemBrowserClass browseAllSelect:aBlock |
617 | 957 |
|
958 |
" |
|
959 |
Smalltalk browseAllSelect:[:m | m literals isNil] |
|
960 |
" |
|
961 |
! |
|
962 |
||
7563 | 963 |
browseChanges |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
964 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
965 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
966 |
"startup a changes browser" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
967 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
968 |
ChangesBrowser notNil ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
969 |
ChangesBrowser open |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
970 |
] ifFalse:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
971 |
self warn:'no ChangesBrowser built in' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
972 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
973 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
974 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
975 |
Smalltalk browseChanges |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
976 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
977 |
! |
453 | 978 |
|
7563 | 979 |
browseClass:aClass |
980 |
"{ Pragma: +optSpace }" |
|
981 |
||
982 |
"startup a browser on aClass" |
|
6970 | 983 |
|
984 |
UserPreferences systemBrowserClass browseClass:aClass |
|
985 |
||
986 |
" |
|
987 |
Smalltalk browseClass:Array |
|
988 |
" |
|
989 |
! |
|
990 |
||
7563 | 991 |
browseImplementorsMatching:aSelectorSymbolOrMatchPattern |
992 |
"{ Pragma: +optSpace }" |
|
6819 | 993 |
|
994 |
"startup a browser for all methods implementing a message matching" |
|
995 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
996 |
UserPreferences systemBrowserClass browseImplementorsMatching:aSelectorSymbolOrMatchPattern |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
997 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
998 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
999 |
Smalltalk browseImplementorsOf:#'at:put:' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1000 |
Smalltalk browseImplementorsMatching:#'at:*' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1001 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1002 |
! |
6819 | 1003 |
|
7563 | 1004 |
browseImplementorsOf:aSelectorSymbol |
1005 |
"{ Pragma: +optSpace }" |
|
1006 |
||
1007 |
"startup a browser for all methods implementing a particular message" |
|
453 | 1008 |
|
6020 | 1009 |
UserPreferences systemBrowserClass browseImplementorsOf:aSelectorSymbol |
453 | 1010 |
|
1011 |
" |
|
1012 |
Smalltalk browseImplementorsOf:#at:put: |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1013 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1014 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1015 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1016 |
browseInClass:aClass |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1017 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1018 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1019 |
"startup a full browser showing aClass" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1020 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1021 |
UserPreferences systemBrowserClass openInClass:aClass |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1022 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1023 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1024 |
Smalltalk browseInClass:Array |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1025 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1026 |
! |
6970 | 1027 |
|
7563 | 1028 |
browseInClass:aClass selector:selector |
1029 |
"{ Pragma: +optSpace }" |
|
1030 |
||
1031 |
"startup a full browser showing aClass>>selector" |
|
6970 | 1032 |
|
1033 |
UserPreferences systemBrowserClass openInClass:aClass selector:selector |
|
1034 |
||
1035 |
" |
|
1036 |
Smalltalk browseInClass:Array selector:#at: |
|
1037 |
" |
|
453 | 1038 |
! ! |
1039 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1040 |
!Smalltalk class methodsFor:'class management'! |
453 | 1041 |
|
7563 | 1042 |
changeCategoryOf:aClass to:newCategory |
1043 |
"change a classes category, add a change record, |
|
5253
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1044 |
send change notifications" |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1045 |
|
8405 | 1046 |
|ns oldCategory| |
1047 |
||
1048 |
oldCategory := aClass category. |
|
1049 |
oldCategory ~= newCategory ifTrue:[ |
|
1050 |
aClass category:(newCategory withoutSeparators asSymbol). |
|
1051 |
||
1052 |
"notify change of category" |
|
1053 |
ns := aClass environment ? self. |
|
1054 |
ns changed:#organization with:(aClass -> oldCategory). |
|
1055 |
ns ~~ self ifTrue:[ |
|
1056 |
self changed:#organization with:(aClass -> oldCategory). |
|
1057 |
] |
|
5253
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1058 |
]. |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1059 |
|
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1060 |
" |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1061 |
Smalltalk changeCategoryOf:NewApplication to:#myApplications |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1062 |
" |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1063 |
|
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1064 |
"Modified: / 11.2.2000 / 11:36:27 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1065 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1066 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1067 |
defineNameSpace: name private: private imports: imports category: category attributes: annotations |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1068 |
NameSpace name:name |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1069 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1070 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1071 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1072 |
flushCachedClass:aClass |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1073 |
CachedClasses notNil ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1074 |
CachedClasses remove:aClass ifAbsent:[] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1075 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1076 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1077 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1078 |
flushCachedClasses |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1079 |
CachedClasses := nil. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1080 |
Class flushSubclassInfo. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1081 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1082 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1083 |
Smalltalk flushCachedClasses |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1084 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1085 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1086 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1087 |
removeClass:aClass |
7563 | 1088 |
"remove the argument, aClass from the smalltalk dictionary; |
453 | 1089 |
we have to flush the caches since these methods are now void. |
1090 |
Also, class variables of aClass are removed." |
|
1091 |
||
4781 | 1092 |
|sym cSym names oldName oldNameSym actualName wrongName ns ons| |
453 | 1093 |
|
4099 | 1094 |
aClass isNil ifTrue:[^ self]. |
4781 | 1095 |
|
453 | 1096 |
oldName := aClass name. |
4781 | 1097 |
sym := oldNameSym := oldName asSymbol. |
1098 |
((self at:oldNameSym) == aClass) ifFalse:[ |
|
7694
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1099 |
"check other name ..." |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1100 |
(self includes:aClass) ifFalse:[ |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1101 |
'Smalltalk [warning]: no such class: ' errorPrint. oldName errorPrintCR. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1102 |
^ self |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1103 |
]. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1104 |
" |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1105 |
the class has changed its name - without telling me ... |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1106 |
what should be done in this case ? |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1107 |
" |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1108 |
'Smalltalk [warning]: class ' errorPrint. oldName errorPrint. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1109 |
' has changed its name' errorPrintCR. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1110 |
|
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1111 |
"/ |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1112 |
"/ might be an alias (i.e. removing a compatibility name) |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1113 |
"/ |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1114 |
actualName := self keyAtValue:aClass. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1115 |
('Smalltalk [info]: ' , oldName , ' is actually stored as ' , actualName , '.') infoPrintCR. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1116 |
sym := actualName asSymbol. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1117 |
oldName := actualName asString. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1118 |
wrongName := true. |
453 | 1119 |
]. |
1120 |
||
4781 | 1121 |
ns := aClass nameSpace. |
1122 |
aClass topOwningClass notNil ifTrue:[ |
|
7694
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1123 |
ons := aClass topOwningClass nameSpace |
4781 | 1124 |
]. |
1125 |
||
453 | 1126 |
self at:sym put:nil. "nil it out for compiled accesses" |
878
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
1127 |
|
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
1128 |
"/ |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
1129 |
"/ see comment in removeKey: on why we dont remove it here |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
1130 |
"/ |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
1131 |
"/ self removeKey:sym. "/ remove key - this actually fails, if there are |
7694
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1132 |
"/ still compiled code references." |
453 | 1133 |
|
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1134 |
"remove private classes" |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1135 |
|
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
1136 |
aClass privateClassesSorted do:[:somePrivateClass | |
7694
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1137 |
aClass privateClassesAt:(somePrivateClass nameWithoutPrefix) asSymbol put:nil. |
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1138 |
]. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1139 |
|
453 | 1140 |
"remove class variables" |
1141 |
||
1142 |
names := aClass classVariableString asCollectionOfWords. |
|
1143 |
names do:[:name | |
|
7694
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1144 |
cSym := (sym , ':' , name) asSymbol. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1145 |
self at:cSym asSymbol put:nil. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1146 |
|
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1147 |
"/ |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1148 |
"/ see comment in removeKey: on why we dont remove it here |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1149 |
"/ |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1150 |
"/ self removeKey:cSym |
453 | 1151 |
]. |
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1152 |
|
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1153 |
|
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1154 |
"/ actually could get along with less flushing |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1155 |
"/ (entries for aClass and subclasses only) |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1156 |
"/ but we have to delay this, until we have the set of subclasses |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1157 |
"/ at hand - for now, searching for all subclasses is way more |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1158 |
"/ expensive then cache flushing. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1159 |
"/ |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1160 |
"/ aClass allSubclassesDo:[:aSubclass | |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1161 |
"/ ObjectMemory flushInlineCachesForClass:aSubclass. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1162 |
"/ ObjectMemory flushMethodCacheFor:aSubclass |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1163 |
"/ ]. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1164 |
"/ ObjectMemory flushInlineCachesForClass:aClass. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1165 |
"/ ObjectMemory flushMethodCacheFor:aClass |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1166 |
|
453 | 1167 |
ObjectMemory flushInlineCaches. |
1168 |
ObjectMemory flushMethodCache. |
|
1169 |
||
7181 | 1170 |
aClass addChangeRecordForClassRemove. |
453 | 1171 |
self changed:#classRemove with:aClass. |
1172 |
||
7581
6912a7336e15
class category: sends a change notification;
Claus Gittinger <cg@exept.de>
parents:
7572
diff
changeset
|
1173 |
aClass setCategory:#'* removed *'. |
1655 | 1174 |
|
5326 | 1175 |
self flushCachedClasses. |
1176 |
Class flushSubclassInfo. |
|
1177 |
||
3627
452f2e1ff1b4
removeClass - care for aliases.
Claus Gittinger <cg@exept.de>
parents:
3626
diff
changeset
|
1178 |
wrongName == true ifTrue:[ |
7694
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1179 |
"/ |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1180 |
"/ an alias (i.e. removing a compatibility name) |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1181 |
"/ |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1182 |
"/ check if there are more refs to it ... |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1183 |
[self includes:aClass] whileTrue:[ |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1184 |
actualName := self keyAtValue:aClass. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1185 |
('Smalltalk [info]: ' , aClass name , ' is also registered under the name ' , actualName |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1186 |
, ' - remove that binding too.') infoPrintCR. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1187 |
self at:actualName put:nil. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1188 |
]. |
4724
44793fe70787
recompile ns classes after a class remove
Claus Gittinger <cg@exept.de>
parents:
4723
diff
changeset
|
1189 |
]. |
44793fe70787
recompile ns classes after a class remove
Claus Gittinger <cg@exept.de>
parents:
4723
diff
changeset
|
1190 |
|
4781 | 1191 |
ns ~~ Smalltalk ifTrue:[ |
7694
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1192 |
ons notNil ifTrue:[ |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1193 |
ClassBuilder |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1194 |
recompileGlobalAccessorsTo:oldNameSym |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1195 |
in:ons |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1196 |
except:nil |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1197 |
]. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1198 |
(ns notNil and:[ns ~~ ons]) ifTrue:[ |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1199 |
ClassBuilder |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1200 |
recompileGlobalAccessorsTo:oldNameSym |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1201 |
in:ns |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1202 |
except:nil |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
1203 |
]. |
3627
452f2e1ff1b4
removeClass - care for aliases.
Claus Gittinger <cg@exept.de>
parents:
3626
diff
changeset
|
1204 |
]. |
452f2e1ff1b4
removeClass - care for aliases.
Claus Gittinger <cg@exept.de>
parents:
3626
diff
changeset
|
1205 |
|
452f2e1ff1b4
removeClass - care for aliases.
Claus Gittinger <cg@exept.de>
parents:
3626
diff
changeset
|
1206 |
"Modified: / 20.6.1998 / 13:26:10 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1207 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1208 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1209 |
renameClass:aClass to:newName |
7563 | 1210 |
"rename aClass to newName. Most of the work is in |
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1211 |
renaming the classVariables (create & copy over values) |
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1212 |
and patching the classes methods to access the new variables." |
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1213 |
|
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1214 |
|oldName oldSym newSym names oldCVSym newCVSym value oldNameToNewName |
3698
8bce45214d24
fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents:
3678
diff
changeset
|
1215 |
oldNameSpace newNameSpace oldBaseName newBaseName privateClasses |
5610
af0d91fe32fc
rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents:
5601
diff
changeset
|
1216 |
oldBaseNameWithoutPrefix newBaseNameWithoutPrefix i1 i2 nm ns subns |
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1217 |
oldMetaclass newMetaclass newCategory| |
5610
af0d91fe32fc
rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents:
5601
diff
changeset
|
1218 |
|
af0d91fe32fc
rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents:
5601
diff
changeset
|
1219 |
"/ check for all intermediate namespaces / owning classes |
5253
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1220 |
i1 := 1. |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1221 |
i2 := 1. |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1222 |
ns := self. |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1223 |
[i2 ~~ 0] whileTrue:[ |
7996
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1224 |
i2 := newName indexOfSubCollection:'::' startingAt:i1. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1225 |
i2 ~~ 0 ifTrue:[ |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1226 |
nm := newName copyFrom:i1 to:i2-1. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1227 |
ns isNameSpace ifTrue:[ |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1228 |
subns := ns at:nm asSymbol ifAbsent:nil. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1229 |
subns isNil ifTrue:[ |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1230 |
self error:'Nonexisting namespace: ',nm. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1231 |
^ nil. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1232 |
]. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1233 |
] ifFalse:[ |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1234 |
subns := ns privateClassesAt:nm asSymbol. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1235 |
subns isNil ifTrue:[ |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1236 |
self error:'Cannot create a namespace below a class' |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1237 |
] |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1238 |
]. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1239 |
ns := subns. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1240 |
i1 := i2 + 2. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1241 |
]. |
5253
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1242 |
]. |
617 | 1243 |
|
1244 |
oldName := aClass name. |
|
6734 | 1245 |
oldNameSpace := aClass topNameSpace. |
2319
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
1246 |
oldBaseName := aClass nameWithoutNameSpacePrefix. |
3698
8bce45214d24
fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents:
3678
diff
changeset
|
1247 |
oldBaseNameWithoutPrefix := aClass nameWithoutPrefix. |
617 | 1248 |
oldSym := oldName asSymbol. |
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
1249 |
privateClasses := aClass privateClassesSorted. |
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1250 |
|
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1251 |
((self at:oldSym) ~~ aClass) ifTrue:[ |
7996
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1252 |
'Smalltalk [warning]: rename failed - name is different from key' errorPrintCR. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1253 |
^ self |
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1254 |
]. |
617 | 1255 |
|
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1256 |
"/ rename the class |
617 | 1257 |
|
1847
6e567214b167
care for className being a symbol, when renaming classes
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
1258 |
newSym := newName asSymbol. |
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1259 |
|
5610
af0d91fe32fc
rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents:
5601
diff
changeset
|
1260 |
"/ change the owning class |
af0d91fe32fc
rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents:
5601
diff
changeset
|
1261 |
ns isNameSpace ifFalse:[ |
7996
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1262 |
aClass isPrivate ifTrue:[ |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1263 |
aClass class setOwningClass:ns. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1264 |
] ifFalse:[ |
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1265 |
"/ sigh - must make a PrivateMetaclass from Metaclass |
7996
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1266 |
oldMetaclass := aClass class. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1267 |
newMetaclass := PrivateMetaclass new. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1268 |
newMetaclass flags:(oldMetaclass flags). |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1269 |
newMetaclass setSuperclass:(oldMetaclass superclass). |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1270 |
newMetaclass instSize:(oldMetaclass instSize). |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1271 |
newMetaclass setInstanceVariableString:(oldMetaclass instanceVariableString). |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1272 |
newMetaclass setMethodDictionary:(oldMetaclass methodDictionary). |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1273 |
newMetaclass setSoleInstance:aClass. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1274 |
newMetaclass setOwningClass:ns. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1275 |
|
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1276 |
aClass changeClassTo:newMetaclass. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1277 |
ObjectMemory flushCaches. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1278 |
] |
5610
af0d91fe32fc
rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents:
5601
diff
changeset
|
1279 |
] ifTrue:[ |
7996
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1280 |
aClass isPrivate ifTrue:[ |
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1281 |
newCategory := aClass topOwningClass category. |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1282 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1283 |
"/ sigh - must make a Metaclass from PrivateMetaclass |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1284 |
oldMetaclass := aClass class. |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1285 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1286 |
newMetaclass := Metaclass new. |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1287 |
newMetaclass flags:(oldMetaclass flags). |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1288 |
newMetaclass setSuperclass:(oldMetaclass superclass). |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1289 |
newMetaclass instSize:(oldMetaclass instSize). |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1290 |
newMetaclass setInstanceVariableString:(oldMetaclass instanceVariableString). |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1291 |
newMetaclass setMethodDictionary:(oldMetaclass methodDictionary). |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1292 |
newMetaclass setSoleInstance:aClass. |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1293 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1294 |
aClass category:newCategory. |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1295 |
aClass changeClassTo:newMetaclass. |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1296 |
ObjectMemory flushCaches. |
7996
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1297 |
] |
5610
af0d91fe32fc
rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents:
5601
diff
changeset
|
1298 |
]. |
af0d91fe32fc
rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents:
5601
diff
changeset
|
1299 |
|
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1300 |
aClass setName:newSym. |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1301 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1302 |
"/ store it in Smalltalk |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1303 |
self at:oldSym put:nil. |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1304 |
|
878
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
1305 |
"/ |
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1306 |
"/ see comment in #removeKey: on why we dont remove it it here |
878
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
1307 |
"/ |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
1308 |
"/ self removeKey:oldSym. |
617 | 1309 |
self at:newSym put:aClass. |
1310 |
||
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1311 |
"/ create new class variables and copy over values |
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1312 |
|
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1313 |
oldNameToNewName := IdentityDictionary new. |
617 | 1314 |
|
1315 |
names := aClass classVariableString asCollectionOfWords. |
|
1316 |
names do:[:name | |
|
7996
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1317 |
oldCVSym := (oldSym , ':' , name) asSymbol. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1318 |
value := self at:oldCVSym. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1319 |
self at:oldCVSym put:nil. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1320 |
|
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1321 |
"/ |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1322 |
"/ see comment in #removeKey: on why we dont remove it it here |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1323 |
"/ |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1324 |
"/ self removeKey:cSym. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1325 |
|
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1326 |
newCVSym := (newSym , ':' , name) asSymbol. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1327 |
self at:newCVSym put:value. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1328 |
|
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1329 |
oldNameToNewName at:oldCVSym put:newCVSym. |
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1330 |
]. |
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1331 |
|
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1332 |
"/ patch methods literal arrays from oldCVname to newCVname |
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1333 |
|
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1334 |
oldNameToNewName keysAndValuesDo:[:oldNameSym :newNameSym | |
7996
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1335 |
aClass withAllSubclasses do:[:aSubClass | |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1336 |
Transcript showCR:'changing global accesses from ''' , oldNameSym , ''' into ''' , newNameSym , ''' in class: ''' , aSubClass name , ''' ...'. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1337 |
aSubClass instAndClassSelectorsAndMethodsDo:[:sel :aMethod | |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1338 |
aMethod changeLiteral:oldNameSym to:newNameSym |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1339 |
]. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1340 |
]. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1341 |
|
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1342 |
"/ and also in privateClasses ? ... |
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1343 |
|
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
1344 |
"/ privateClasses size > 0 ifTrue:[ |
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1345 |
"/ privateClasses do:[:aPrivateClass | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1346 |
"/ aPrivateClass withAllSubclasses do:[:aSubClass | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1347 |
"/ aSubClass class methodDictionary do:[:aMethod | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1348 |
"/ aMethod changeLiteral:oldNameSym to:newNameSym |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1349 |
"/ ]. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1350 |
"/ aSubClass methodDictionary do:[:aMethod | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1351 |
"/ aMethod changeLiteral:oldNameSym to:newNameSym |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1352 |
"/ ] |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1353 |
"/ ]. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1354 |
"/ ] |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1355 |
"/ ] |
617 | 1356 |
]. |
1357 |
||
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1358 |
aClass addChangeRecordForClassRename:oldSym to:newSym. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1359 |
|
5333
d80386e06d21
rename into other namespace did not work
Claus Gittinger <cg@exept.de>
parents:
5328
diff
changeset
|
1360 |
"/ clear the namespace (for namespace query to work) |
d80386e06d21
rename into other namespace did not work
Claus Gittinger <cg@exept.de>
parents:
5328
diff
changeset
|
1361 |
aClass setEnvironment:nil. |
6734 | 1362 |
newNameSpace := aClass topNameSpace. |
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
1363 |
|
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
1364 |
privateClasses size > 0 ifTrue:[ |
7996
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1365 |
"/ must rename privateClasses as well |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1366 |
Class withoutUpdatingChangesDo:[ |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1367 |
privateClasses do:[:aPrivateClass | |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1368 |
self renameClass:aPrivateClass |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1369 |
to:(newSym , '::' , aPrivateClass nameWithoutPrefix). |
5916
4364f9ae4254
when renaming a class, no changeRecrd for its private-class renames
Claus Gittinger <cg@exept.de>
parents:
5913
diff
changeset
|
1370 |
|
7996
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1371 |
Transcript showCR:'recompiling methods in ''' , newNameSpace name , ''' accessing ''' , oldName , '::' , aPrivateClass nameWithoutPrefix , ''' ...'. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1372 |
ClassBuilder |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1373 |
recompileGlobalAccessorsTo:(oldName , '::' , aPrivateClass nameWithoutPrefix) asSymbol |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1374 |
in:newNameSpace |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1375 |
except:nil. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1376 |
] |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1377 |
] |
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
1378 |
]. |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
1379 |
|
2319
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
1380 |
oldNameSpace ~~ newNameSpace ifTrue:[ |
5246
2ca7b20c4108
create namespaces as requried, when renaming a class
Claus Gittinger <cg@exept.de>
parents:
5214
diff
changeset
|
1381 |
|
7996
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1382 |
"/ all those referencing the class from the old nameSpace |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1383 |
"/ must be recompiled ... |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1384 |
"/ (to now access the global from smalltalk) |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1385 |
|
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1386 |
oldNameSpace ~~ Smalltalk ifTrue:[ |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1387 |
Transcript showCR:'recompiling methods in ''' , oldNameSpace name , ''' accessing ''' , oldName , ''' ...'. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1388 |
|
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1389 |
ClassBuilder |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1390 |
recompileGlobalAccessorsTo:oldName asSymbol |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1391 |
in:oldNameSpace |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1392 |
except:nil. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1393 |
]. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1394 |
|
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1395 |
"/ all referencing the class in the new namespace |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1396 |
"/ as well; to now access the new class. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1397 |
|
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1398 |
(newNameSpace notNil and:[newNameSpace ~~ Smalltalk]) ifTrue:[ |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1399 |
Transcript showCR:'recompiling methods in ''' , newNameSpace name , ''' accessing ''' , oldBaseName , ''' ...'. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1400 |
|
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1401 |
ClassBuilder |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1402 |
recompileGlobalAccessorsTo:oldBaseName asSymbol |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1403 |
in:newNameSpace |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1404 |
except:nil. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1405 |
]. |
3698
8bce45214d24
fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents:
3678
diff
changeset
|
1406 |
] ifFalse:[ |
7996
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1407 |
"/ all references to a global with my new name in my owning class |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1408 |
"/ must now be redirected to myself. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1409 |
|
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1410 |
aClass isPrivate ifTrue:[ |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1411 |
newBaseName := aClass nameWithoutNameSpacePrefix. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1412 |
newBaseNameWithoutPrefix := aClass nameWithoutPrefix. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1413 |
|
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1414 |
Transcript showCR:'recompiling methods accessing ''' , oldBaseNameWithoutPrefix , ''' in: ''' , aClass owningClass name , ''' ...'. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1415 |
aClass owningClass recompileMethodsAccessingGlobal:oldBaseNameWithoutPrefix. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1416 |
aClass owningClass class recompileMethodsAccessingGlobal:oldBaseNameWithoutPrefix. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1417 |
|
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1418 |
Transcript showCR:'recompiling methods accessing ''' , oldBaseName , ''' in: ''' , aClass owningClass name , ''' ...'. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1419 |
aClass owningClass recompileMethodsAccessingGlobal:oldBaseName. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1420 |
aClass owningClass class recompileMethodsAccessingGlobal:oldBaseName. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1421 |
|
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1422 |
Transcript showCR:'recompiling methods accessing ''' , newBaseNameWithoutPrefix , ''' in: ''' , aClass owningClass name , ''' ...'. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1423 |
aClass owningClass recompileMethodsAccessingGlobal:newBaseNameWithoutPrefix. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1424 |
aClass owningClass class recompileMethodsAccessingGlobal:newBaseNameWithoutPrefix. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1425 |
|
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1426 |
Transcript showCR:'recompiling methods accessing ''' , newBaseName , ''' in: ''' , aClass owningClass name , ''' ...'. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1427 |
aClass owningClass recompileMethodsAccessingGlobal:newBaseName. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1428 |
aClass owningClass class recompileMethodsAccessingGlobal:newBaseName. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1429 |
] |
4040
b27f87d9772d
must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
4028
diff
changeset
|
1430 |
]. |
b27f87d9772d
must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
4028
diff
changeset
|
1431 |
|
b27f87d9772d
must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
4028
diff
changeset
|
1432 |
aClass changed:#definition. |
b27f87d9772d
must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
4028
diff
changeset
|
1433 |
"/ because of the change of my superclasses name ... |
b27f87d9772d
must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
4028
diff
changeset
|
1434 |
aClass allSubclassesDo:[:subClass | |
7996
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1435 |
subClass changed:#definition. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1436 |
]. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1437 |
"/ because of the change of my superclasses name ... |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1438 |
aClass subclassesDo:[:subClass | |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1439 |
subClass addChangeRecordForClass:subClass. |
4040
b27f87d9772d
must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
4028
diff
changeset
|
1440 |
]. |
5613
b534e427f028
change message when renaming a class
Claus Gittinger <cg@exept.de>
parents:
5611
diff
changeset
|
1441 |
self changed:#definition. |
b534e427f028
change message when renaming a class
Claus Gittinger <cg@exept.de>
parents:
5611
diff
changeset
|
1442 |
Smalltalk changed:#classRename with:(Array with:aClass with:oldName). |
3698
8bce45214d24
fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents:
3678
diff
changeset
|
1443 |
|
8bce45214d24
fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents:
3678
diff
changeset
|
1444 |
"Created: / 29.10.1995 / 19:58:32 / cg" |
8bce45214d24
fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents:
3678
diff
changeset
|
1445 |
"Modified: / 18.6.1996 / 14:20:50 / stefan" |
5253
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1446 |
"Modified: / 11.2.2000 / 01:12:38 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1447 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1448 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1449 |
!Smalltalk class methodsFor:'copying'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1450 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1451 |
deepCopy |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1452 |
"redefined to return self - there is only one Smalltalk dictionary" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1453 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1454 |
^ self |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1455 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1456 |
"Modified: 18.5.1996 / 12:13:33 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1457 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1458 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1459 |
deepCopyUsing:aDictionary |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1460 |
"return a deep copy of the receiver. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1461 |
Redefined to return the receiver - there is only one Smalltalk dictionary" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1462 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1463 |
^ self |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1464 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1465 |
"Modified: 18.5.1996 / 12:13:36 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1466 |
! |
453 | 1467 |
|
7563 | 1468 |
shallowCopy |
1469 |
"redefined to return self - there is only one Smalltalk dictionary" |
|
617 | 1470 |
|
1471 |
^ self |
|
1410 | 1472 |
|
1473 |
"Modified: 18.5.1996 / 12:13:39 / cg" |
|
617 | 1474 |
! |
1475 |
||
7563 | 1476 |
simpleDeepCopy |
1477 |
"redefined to return self - there is only one Smalltalk dictionary" |
|
453 | 1478 |
|
1479 |
^ self |
|
1410 | 1480 |
|
1481 |
"Modified: 18.5.1996 / 12:13:42 / cg" |
|
453 | 1482 |
! ! |
1483 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1484 |
!Smalltalk class methodsFor:'debugging ST/X'! |
453 | 1485 |
|
7563 | 1486 |
compileTrace:aBoolean |
1487 |
"dump generated inline code (NOOP if VM was compiled without the trace-debug option)" |
|
7325 | 1488 |
%{ |
1489 |
extern char __compileTrace__; |
|
1490 |
||
1491 |
__compileTrace__ = (aBoolean == true) ? 1 : 0; |
|
1492 |
%} |
|
1493 |
" |
|
1494 |
Smalltalk compileTrace:true |
|
1495 |
Smalltalk compileTrace:false |
|
1496 |
" |
|
1497 |
! |
|
1498 |
||
7563 | 1499 |
debugBreakPoint |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1500 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1501 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1502 |
"call the dummy debug function, on which a breakpoint |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1503 |
can be put in adb, sdb, dbx or gdb. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1504 |
WARNING: this method is for debugging only |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1505 |
it will be removed without notice." |
453 | 1506 |
%{ |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1507 |
__PATCHUPCONTEXTS(__context); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1508 |
__debugBreakPoint__(); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1509 |
%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1510 |
^ self |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1511 |
! |
453 | 1512 |
|
7563 | 1513 |
exitWithCoreDump |
1514 |
"{ Pragma: +optSpace }" |
|
1515 |
||
1516 |
"abort program and dump core" |
|
1517 |
||
1518 |
OperatingSystem exitWithCoreDump |
|
4096
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1519 |
"/ never returns |
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1520 |
|
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1521 |
"Be careful evaluating this |
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1522 |
Smalltalk exitWithCoreDump |
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1523 |
" |
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1524 |
|
617 | 1525 |
! |
1526 |
||
7563 | 1527 |
fatalAbort |
1528 |
"{ Pragma: +optSpace }" |
|
1529 |
||
1530 |
"report a fatal-error, print a stack backtrace and exit with core dump. |
|
617 | 1531 |
(You may turn off the stack print with debugPrinting:false)" |
1532 |
%{ |
|
1533 |
__fatal0(__context, "fatalAbort"); |
|
1534 |
/* NEVER RETURNS */ |
|
5410 | 1535 |
%}. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1536 |
^ self primitiveFailed |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1537 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1538 |
! |
617 | 1539 |
|
7563 | 1540 |
fatalAbort:aMessage |
1541 |
"{ Pragma: +optSpace }" |
|
1542 |
||
1543 |
"report a fatal-error; print a stack backtrace and exit with core dump |
|
617 | 1544 |
(You may turn off the stack print with debugPrinting:false)" |
1545 |
||
1546 |
%{ |
|
1547 |
char *msg; |
|
1548 |
||
1549 |
if (__isString(aMessage)) |
|
7616 | 1550 |
msg = (char *) __stringVal(aMessage); |
617 | 1551 |
else |
7616 | 1552 |
msg = "fatalAbort"; |
617 | 1553 |
|
1554 |
__fatal0(__context, msg); |
|
1555 |
/* NEVER RETURNS */ |
|
5410 | 1556 |
%}. |
1557 |
^ self primitiveFailed |
|
1558 |
||
5441 | 1559 |
! |
1560 |
||
7563 | 1561 |
vmInstructionTrace:aBoolean |
1562 |
||
1563 |
||
1564 |
! ! |
|
1565 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1566 |
!Smalltalk class methodsFor:'enumerating'! |
7563 | 1567 |
|
453 | 1568 |
allBehaviorsDo:aBlock |
5580
374e843aa424
allBehaviorsDo now enumerates both classes and metaclasses
Claus Gittinger <cg@exept.de>
parents:
5579
diff
changeset
|
1569 |
"evaluate the argument, aBlock for all classes and metaclasses in the system" |
374e843aa424
allBehaviorsDo now enumerates both classes and metaclasses
Claus Gittinger <cg@exept.de>
parents:
5579
diff
changeset
|
1570 |
|
374e843aa424
allBehaviorsDo now enumerates both classes and metaclasses
Claus Gittinger <cg@exept.de>
parents:
5579
diff
changeset
|
1571 |
self allClassesAndMetaclassesDo:aBlock |
453 | 1572 |
|
1573 |
" |
|
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1574 |
Smalltalk allBehaviorsDo:[:aClass | aClass name printCR] |
453 | 1575 |
" |
7563 | 1576 |
! |
1577 |
||
1578 |
allClassCategories |
|
1579 |
"return a set of all class categories in the system" |
|
1580 |
||
1581 |
|allCategories| |
|
6217
e0f4f3959c49
reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
1582 |
|
e0f4f3959c49
reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
1583 |
allCategories := Set new. |
7124
da253fd03ba1
Do not sort categories in #allClassCategories.
Stefan Vogel <sv@exept.de>
parents:
7105
diff
changeset
|
1584 |
Smalltalk allClassesDo:[:cls | |category| |
7616 | 1585 |
category := cls category. |
1586 |
category notNil ifTrue:[ |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1587 |
allCategories add:category. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1588 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1589 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1590 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1591 |
^ allCategories. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1592 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1593 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1594 |
Smalltalk allClassCategories |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1595 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1596 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1597 |
"Created: / 17.11.2001 / 12:13:09 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1598 |
! |
6217
e0f4f3959c49
reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
1599 |
|
7563 | 1600 |
allClassesAndMetaclassesDo:aBlock |
1601 |
"evaluate the argument, aBlock for all classes and metaclasses in the system." |
|
5579
26af506d271e
added #allClassesAndMetaclasses
Claus Gittinger <cg@exept.de>
parents:
5550
diff
changeset
|
1602 |
|
5940
804fb27727a6
oops - allClassesAndMetaclassesDo: evaluated block twice for
Claus Gittinger <cg@exept.de>
parents:
5916
diff
changeset
|
1603 |
|already| |
804fb27727a6
oops - allClassesAndMetaclassesDo: evaluated block twice for
Claus Gittinger <cg@exept.de>
parents:
5916
diff
changeset
|
1604 |
|
8964
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1605 |
already := IdentitySet new:NumberOfClassesHint*2. |
5940
804fb27727a6
oops - allClassesAndMetaclassesDo: evaluated block twice for
Claus Gittinger <cg@exept.de>
parents:
5916
diff
changeset
|
1606 |
self allClassesDo:[:eachClass | |cls| |
8964
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1607 |
cls := eachClass theNonMetaclass. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1608 |
(already includes:cls) ifFalse:[ |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1609 |
aBlock value:cls. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1610 |
already add:cls. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1611 |
]. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1612 |
cls := cls class. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1613 |
(already includes:cls) ifFalse:[ |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1614 |
aBlock value:cls. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1615 |
already add:cls. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1616 |
]. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1617 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1618 |
! |
5579
26af506d271e
added #allClassesAndMetaclasses
Claus Gittinger <cg@exept.de>
parents:
5550
diff
changeset
|
1619 |
|
7563 | 1620 |
allClassesDo:aBlock |
1621 |
"evaluate the argument, aBlock for all classes in the system." |
|
5580
374e843aa424
allBehaviorsDo now enumerates both classes and metaclasses
Claus Gittinger <cg@exept.de>
parents:
5579
diff
changeset
|
1622 |
|
5765 | 1623 |
self allClasses do:aBlock |
453 | 1624 |
|
1625 |
" |
|
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1626 |
Smalltalk allClassesDo:[:aClass | aClass name printCR] |
453 | 1627 |
" |
1628 |
! |
|
1629 |
||
7563 | 1630 |
allClassesInCategory:aCategory |
1631 |
"return a collection of for all classes in aCategory; |
|
1299 | 1632 |
The order of the classes is not defined." |
1633 |
||
1634 |
|coll| |
|
1635 |
||
1636 |
coll := OrderedCollection new. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1637 |
self allClassesInCategory:aCategory do:[:aClass | |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1638 |
coll add:aClass |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1639 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1640 |
^ coll |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1641 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1642 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1643 |
Smalltalk allClassesInCategory:'Views-Basic' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1644 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1645 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1646 |
"Modified: 25.4.1996 / 18:06:13 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1647 |
! |
1299 | 1648 |
|
7563 | 1649 |
allClassesInCategory:aCategory do:aBlock |
1650 |
"evaluate the argument, aBlock for all classes in the aCategory; |
|
453 | 1651 |
The order of the classes is not defined." |
1652 |
||
1653 |
aCategory notNil ifTrue:[ |
|
7616 | 1654 |
self allClassesDo:[:aClass | |
1655 |
aClass isMeta ifFalse:[ |
|
1656 |
(aClass category = aCategory) ifTrue:[ |
|
1657 |
aBlock value:aClass |
|
1658 |
] |
|
1659 |
] |
|
1660 |
] |
|
453 | 1661 |
] |
1662 |
||
1663 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1664 |
Smalltalk allClassesInCategory:'Views-Basic' do:[:aClass | aClass name printCR] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1665 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1666 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1667 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1668 |
allClassesInCategory:aCategory inOrderDo:aBlock |
7563 | 1669 |
"evaluate the argument, aBlock for all classes in aCategory; |
453 | 1670 |
superclasses come first - then subclasses" |
1671 |
||
1672 |
|classes| |
|
1673 |
||
1674 |
aCategory notNil ifTrue:[ |
|
7616 | 1675 |
classes := OrderedCollection new. |
1676 |
self allClassesInCategory:aCategory do:[:aClass | |
|
1677 |
classes add:aClass |
|
1678 |
]. |
|
1679 |
classes topologicalSort:[:a :b | b isSubclassOf:a]. |
|
1680 |
classes do:aBlock |
|
453 | 1681 |
] |
1682 |
||
1683 |
" |
|
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1684 |
Smalltalk allClassesInCategory:'Views-Basic' inOrderDo:[:aClass | aClass name printCR] |
453 | 1685 |
" |
6217
e0f4f3959c49
reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
1686 |
|
e0f4f3959c49
reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
1687 |
"Modified: / 17.11.2001 / 12:18:15 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1688 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1689 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1690 |
allClassesInOrderDo:aBlock |
7563 | 1691 |
"evaluate the argument, aBlock for all classes in the system; |
5406 | 1692 |
Evaluation order is by inheritance: superclasses come first." |
1693 |
||
1694 |
|already| |
|
1695 |
||
8964
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1696 |
already := IdentitySet new:NumberOfClassesHint. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1697 |
self allClassesDo:[:eachClass | |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1698 |
(already includes:eachClass) ifFalse:[ |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1699 |
eachClass allSuperclasses reverseDo:[:eachSuperClass | |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1700 |
(already includes:eachSuperClass) ifFalse:[ |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1701 |
already add:eachSuperClass. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1702 |
aBlock value:eachSuperClass. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1703 |
]. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1704 |
]. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1705 |
already add:eachClass. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1706 |
aBlock value:eachClass. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1707 |
] |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1708 |
]. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1709 |
|
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1710 |
" |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1711 |
Smalltalk allClassesInOrderDo:[:aClass | Transcript showCR:aClass name] |
5406 | 1712 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1713 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1714 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1715 |
allKeysDo:aBlock |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1716 |
"evaluate the argument, aBlock for all keys in the Smalltalk dictionary" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1717 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1718 |
^ self keysDo:aBlock |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1719 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1720 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1721 |
allMethodCategories |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1722 |
"return a set of all method categories in the system" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1723 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1724 |
|allCategories| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1725 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1726 |
allCategories := Set new. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1727 |
Smalltalk allClassesDo:[:cls | |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1728 |
allCategories addAll:cls categories. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1729 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1730 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1731 |
^ allCategories. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1732 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1733 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1734 |
Smalltalk allMethodCategories |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1735 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1736 |
! |
6722
8388292bc41d
allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
1737 |
|
7563 | 1738 |
associationsDo:aBlock |
1739 |
"evaluate the argument, aBlock for all key/value pairs |
|
617 | 1740 |
in the Smalltalk dictionary" |
1741 |
||
1742 |
self keysDo:[:aKey | |
|
7616 | 1743 |
aBlock value:(aKey -> (self at:aKey)) |
617 | 1744 |
] |
1745 |
||
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1746 |
"Smalltalk associationsDo:[:assoc | assoc printCR]" |
617 | 1747 |
! |
1748 |
||
7563 | 1749 |
basicKeys |
1750 |
"for rel > 5 only" |
|
1751 |
||
1752 |
self primitiveFailed |
|
1753 |
||
1754 |
||
1755 |
||
1756 |
||
1757 |
||
1758 |
||
1759 |
! |
|
1760 |
||
1761 |
do:aBlock |
|
1762 |
"evaluate the argument, aBlock for all values in the Smalltalk dictionary" |
|
617 | 1763 |
|
1764 |
|work| |
|
1765 |
||
1766 |
%{ /* NOREGISTER - work may not be placed into a register here */ |
|
1688
8a42db1eea60
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
1682
diff
changeset
|
1767 |
__GLOBALS_DO(&aBlock, &work); |
5406 | 1768 |
RETURN (self); |
1769 |
%}. |
|
1770 |
self keysDo:[:aKey | |
|
7616 | 1771 |
aBlock value:(self at:aKey) |
5406 | 1772 |
] |
617 | 1773 |
! |
1774 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1775 |
keysAndValuesDo:aBlock |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1776 |
"evaluate the two-arg block, aBlock for all keys and values" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1777 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1778 |
self keysDo:[:aKey | |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1779 |
aBlock value:aKey value:(self at:aKey) |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1780 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1781 |
! |
617 | 1782 |
|
7563 | 1783 |
keysDo:aBlock |
1784 |
"evaluate the argument, aBlock for all keys in the Smalltalk dictionary" |
|
617 | 1785 |
|work| |
1786 |
||
1787 |
%{ /* NOREGISTER - work may not be placed into a register here */ |
|
1688
8a42db1eea60
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
1682
diff
changeset
|
1788 |
__GLOBALKEYS_DO(&aBlock, &work); |
5406 | 1789 |
RETURN (self); |
1790 |
%}. |
|
1791 |
self basicKeys do:[:aKey | |
|
7616 | 1792 |
aBlock value:aKey |
5406 | 1793 |
] |
453 | 1794 |
! ! |
1795 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1796 |
!Smalltalk class methodsFor:'inspecting'! |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1797 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1798 |
inspectorClass |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1799 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1800 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1801 |
"redefined to launch a DictionaryInspector |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1802 |
(instead of the default Inspector)." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1803 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1804 |
^ DictionaryInspectorView |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1805 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1806 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1807 |
!Smalltalk class methodsFor:'message control'! |
453 | 1808 |
|
7563 | 1809 |
silentLoading |
1810 |
"returns the Silentloading class variable." |
|
1811 |
||
1812 |
^ SilentLoading |
|
1813 |
! |
|
1814 |
||
1815 |
silentLoading:aBoolean |
|
1816 |
"{ Pragma: +optSpace }" |
|
1817 |
||
1818 |
"allows access to the Silentloading class variable, which controls |
|
453 | 1819 |
messages from all kinds of system onto the transcript. |
1820 |
You can save a snapshot with this flag set to true, which makes |
|
1821 |
the image come up silent. Can also be set, to read in files unlogged." |
|
1822 |
||
1823 |
|prev| |
|
1824 |
||
1825 |
prev := SilentLoading. |
|
1826 |
SilentLoading := aBoolean. |
|
1827 |
^ prev |
|
1828 |
! ! |
|
1829 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1830 |
!Smalltalk class methodsFor:'misc accessing'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1831 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1832 |
beHeadless:aBoolean |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1833 |
"set/clear the headlessOperation flag." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1834 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1835 |
HeadlessOperation := aBoolean |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1836 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1837 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1838 |
standAloneApp:aBoolean |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1839 |
"set/clear the StandAlone flag." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1840 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1841 |
StandAlone := aBoolean |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1842 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1843 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1844 |
!Smalltalk class methodsFor:'misc stuff'! |
7563 | 1845 |
|
1846 |
addExitBlock:aBlock |
|
1847 |
"{ Pragma: +optSpace }" |
|
1848 |
||
1849 |
"add a block to be executed when Smalltalk finishes. |
|
617 | 1850 |
This feature is currently not used anywhere - but could be useful for |
1851 |
cleanup in stand alone applications." |
|
1852 |
||
1853 |
ExitBlocks isNil ifTrue:[ |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1854 |
ExitBlocks := OrderedCollection with:aBlock |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1855 |
] ifFalse:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1856 |
ExitBlocks add:aBlock |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1857 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1858 |
! |
617 | 1859 |
|
7563 | 1860 |
addImageStartBlock:aBlock |
1861 |
"{ Pragma: +optSpace }" |
|
1862 |
||
1863 |
"add a blocks to be executed in a separate process after |
|
2681 | 1864 |
everything has been initialized. |
1865 |
These blocks will be executed after an image restart." |
|
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1866 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1867 |
ImageStartBlocks isNil ifTrue:[ |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1868 |
ImageStartBlocks := OrderedCollection with:aBlock |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1869 |
] ifFalse:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1870 |
ImageStartBlocks add:aBlock |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1871 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1872 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1873 |
"Created: 9.9.1996 / 16:48:20 / stefan" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1874 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1875 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1876 |
addStartBlock:aBlock |
7563 | 1877 |
"{ Pragma: +optSpace }" |
1878 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1879 |
"add a blocks to be executed in a separate process after |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1880 |
everything has been initialized. These blocks will |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1881 |
be deleted after execution and therefore not be |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1882 |
executed after an image restart. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1883 |
Initial processes are usually started here (see smalltalk.rc / private.rc)." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1884 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1885 |
StartBlocks isNil ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1886 |
StartBlocks := OrderedCollection with:aBlock |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1887 |
] ifFalse:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1888 |
StartBlocks add:aBlock |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1889 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1890 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1891 |
"Created: 9.9.1996 / 16:46:53 / stefan" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1892 |
! |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1893 |
|
7563 | 1894 |
exit |
1895 |
"{ Pragma: +optSpace }" |
|
1896 |
||
1897 |
"finish the Smalltalk system" |
|
1898 |
||
8803 | 1899 |
self exit:0 |
1900 |
"not reached" |
|
1901 |
||
1902 |
"Be careful evaluating this |
|
1903 |
Smalltalk exit |
|
1904 |
" |
|
1905 |
! |
|
1906 |
||
1907 |
exit:statusInteger |
|
1908 |
"{ Pragma: +optSpace }" |
|
1909 |
||
1910 |
"finish the Smalltalk system" |
|
1911 |
||
7563 | 1912 |
ObjectMemory changed:#aboutToExit. "/ for ST/X backward compatibility |
453 | 1913 |
ObjectMemory changed:#aboutToQuit. "/ for ST-80 compatibility |
1914 |
ExitBlocks notNil ifTrue:[ |
|
8803 | 1915 |
ExitBlocks do:[:aBlock | |
1916 |
aBlock value |
|
1917 |
] |
|
1918 |
]. |
|
1919 |
OperatingSystem exit:statusInteger |
|
1920 |
"not reached" |
|
4096
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1921 |
|
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1922 |
"Be careful evaluating this |
8803 | 1923 |
Smalltalk exit:1 |
453 | 1924 |
" |
1925 |
! ! |
|
1926 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1927 |
!Smalltalk class methodsFor:'queries'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1928 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1929 |
allClasses |
7563 | 1930 |
"return an unordered collection of all classes in the system. |
1931 |
Only globally anchored classes are returned |
|
453 | 1932 |
(i.e. anonymous ones have to be aquired by Behavior allSubInstances)" |
1933 |
||
1934 |
|classes| |
|
1935 |
||
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1936 |
"/ you may wonder, what this while is for, here ... |
453 | 1937 |
"/ the reason is that if we modify the class hierarchy in |
4067 | 1938 |
"/ another view (background fileIn), while building up the |
453 | 1939 |
"/ cachedClasses set, this may be flushed (invalidated) by the |
1940 |
"/ other process in the meanwhile. |
|
1941 |
"/ If that happens, we restart the set-building here |
|
1942 |
"/ |
|
1943 |
[(classes := CachedClasses) isNil] whileTrue:[ |
|
8964
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1944 |
CachedClasses := classes := IdentitySet new:NumberOfClassesHint. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1945 |
self keysAndValuesDo:[:eachName :eachGlobal | |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1946 |
(eachGlobal notNil and:[eachGlobal isBehavior]) ifTrue:[ |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1947 |
"/ sigh - would like to skip over aliases |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1948 |
"/ but this cannot be done simply by comparing |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1949 |
"/ the classes name against the store-key |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1950 |
"/ i.e. cannot do: |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1951 |
"/ anObject name == sym ifTrue:[ |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1952 |
"/ classes add:anObject |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1953 |
"/ ] |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1954 |
"/ because that would lead to ignore all java |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1955 |
"/ classes, which are stored under a different |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1956 |
"/ key. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1957 |
|
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1958 |
(eachGlobal name == eachName |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1959 |
or:[eachGlobal isJavaClass]) ifTrue:[ |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1960 |
classes add:eachGlobal |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1961 |
]. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1962 |
] |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1963 |
]. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1964 |
NumberOfClassesHint := classes size. |
453 | 1965 |
]. |
1966 |
^ classes |
|
1967 |
||
8964
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1968 |
" |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1969 |
CachedClasses := nil. |
453 | 1970 |
Smalltalk allClasses |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1971 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1972 |
to get the list sorted by name: |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1973 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1974 |
Smalltalk allClasses asSortedCollection:[:a :b | a name < b name] |
453 | 1975 |
" |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1976 |
|
5278 | 1977 |
"Modified: / 23.2.2000 / 10:49:46 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1978 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1979 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1980 |
allClassesAndMetaclasses |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1981 |
"return an unordered collection of all classes with their metaclasses in the system." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1982 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1983 |
|classes| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1984 |
|
8964
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1985 |
classes := IdentitySet new:NumberOfClassesHint*2. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1986 |
self allClassesDo:[:eachClass | |
8964
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1987 |
classes add:(eachClass theNonMetaclass). |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1988 |
classes add:(eachClass theMetaclass). |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1989 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1990 |
^ classes |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1991 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1992 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1993 |
allClassesWithAllPrivateClasses |
7563 | 1994 |
"return an unordered collection of all classes in the Smalltalk namespace. |
4642 | 1995 |
Only globally anchored classes are returned |
1996 |
(i.e. anonymous ones have to be aquired by Behavior allSubInstances)" |
|
1997 |
||
1998 |
^ self allClasses select:[:aClass | |
|
7616 | 1999 |
|owner| |
2000 |
||
2001 |
(aClass isNameSpace not |
|
2002 |
or:[aClass == Smalltalk]) |
|
2003 |
and:[ |
|
2004 |
owner := aClass topOwningClass. |
|
2005 |
(owner ? aClass) nameSpace == Smalltalk |
|
2006 |
] |
|
4642 | 2007 |
] |
2008 |
||
2009 |
" |
|
2010 |
Smalltalk allClassesWithAllPrivateClasses |
|
2011 |
" |
|
2012 |
! |
|
2013 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2014 |
cellAt:aName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2015 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2016 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2017 |
"return the address of a global cell |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2018 |
- used internally for compiler only" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2019 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2020 |
%{ /* NOCONTEXT */ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2021 |
RETURN ( __GLOBAL_GETCELL(aName) ); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2022 |
%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2023 |
^ self primitiveFailed |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2024 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2025 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2026 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2027 |
classCategoryCompletion:aPartialCategory |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2028 |
"given a partial class category name, return an array consisting of |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2029 |
2 entries: 1st: the best (longest) match |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2030 |
2nd: collection consisting of matching categories" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2031 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2032 |
^ DoWhatIMeanSupport classCategoryCompletion:aPartialCategory in:self |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2033 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2034 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2035 |
Smalltalk classCategoryCompletion:'Sys' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2036 |
Smalltalk classCategoryCompletion:'System' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2037 |
Smalltalk classCategoryCompletion:'System-BinaryStorage' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2038 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2039 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2040 |
|
8570 | 2041 |
classNamed:aString |
2042 |
"return the class with name aString, or nil if absent. |
|
2043 |
To get to the metaClass, append ' class' to the string. |
|
2044 |
To get a nameSpace or private class, prefix the name as required." |
|
2045 |
||
7520
03cbfda8cf8b
allow for namespace::name in #classNamed.
Claus Gittinger <cg@exept.de>
parents:
7432
diff
changeset
|
2046 |
|cls sym nonMeta idx ns nm| |
453 | 2047 |
|
2048 |
"be careful, to not invent new symbols ..." |
|
2049 |
sym := aString asSymbolIfInterned. |
|
2050 |
sym notNil ifTrue:[ |
|
7616 | 2051 |
cls := self at:sym ifAbsent:nil. |
2052 |
cls isBehavior ifTrue:[^ cls]. |
|
2053 |
cls isNil ifTrue:[ |
|
2054 |
idx := sym indexOfSubCollection:'::'. |
|
2055 |
idx ~~ 0 ifTrue:[ |
|
2056 |
ns := sym copyTo:idx-1. |
|
2057 |
nm := sym copyFrom:idx+2. |
|
2058 |
ns := Smalltalk at:ns asSymbol. |
|
2059 |
ns notNil ifTrue:[ |
|
2060 |
ns isNameSpace ifTrue:[ |
|
2061 |
cls := ns at:(nm asSymbol). |
|
2062 |
] ifFalse:[ |
|
2063 |
ns isBehavior ifTrue:[ |
|
2064 |
cls := ns privateClassesAt:(nm asSymbol). |
|
2065 |
] |
|
2066 |
] |
|
2067 |
]. |
|
2068 |
cls isBehavior ifTrue:[^ cls]. |
|
2069 |
]. |
|
2070 |
]. |
|
453 | 2071 |
]. |
1480
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
2072 |
(aString endsWith:' class') ifTrue:[ |
7616 | 2073 |
nonMeta := self classNamed:(aString copyWithoutLast:6). |
2074 |
nonMeta notNil ifTrue:[ |
|
2075 |
^ nonMeta theMetaclass |
|
2076 |
]. |
|
453 | 2077 |
]. |
2078 |
^ nil |
|
2079 |
||
2080 |
" |
|
2081 |
Smalltalk classNamed:'Object' |
|
2082 |
Smalltalk classNamed:'fooBar' |
|
2083 |
Smalltalk classNamed:'true' |
|
1480
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
2084 |
Smalltalk classNamed:'Object class' |
453 | 2085 |
Smalltalk classNamed:'Metaclass' |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
2086 |
Smalltalk classNamed:'Array' |
1480
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
2087 |
Smalltalk classNamed:'Array class' |
453 | 2088 |
" |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
2089 |
|
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
2090 |
"Created: 24.11.1995 / 17:30:22 / cg" |
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
2091 |
"Modified: 24.11.1995 / 17:31:29 / cg" |
1480
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
2092 |
"Modified: 19.6.1996 / 14:22:21 / stefan" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2093 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2094 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2095 |
classNames |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2096 |
"return a collection of all classNames in the system" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2097 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2098 |
^ self allClasses collect:[:aClass | aClass name] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2099 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2100 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2101 |
Smalltalk classNames |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2102 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2103 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2104 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2105 |
classnameCompletion:aPartialClassName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2106 |
"given a partial classname, return an array consisting of |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2107 |
2 entries: 1st: the best (longest) match |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2108 |
2nd: collection consisting of matching names" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2109 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2110 |
^ DoWhatIMeanSupport classnameCompletion:aPartialClassName inEnvironment:self |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2111 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2112 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2113 |
classnameCompletion:aPartialClassName inEnvironment:anEnvironment |
7563 | 2114 |
"given a partial classname, return an array consisting of |
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2115 |
2 entries: 1st: the best (longest) match |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2116 |
2nd: collection consisting of matching names" |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2117 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2118 |
^ DoWhatIMeanSupport classnameCompletion:aPartialClassName inEnvironment:anEnvironment |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2119 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2120 |
" |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2121 |
Smalltalk classnameCompletion:'Arr' |
453 | 2122 |
Smalltalk classnameCompletion:'Arra' |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
2123 |
Smalltalk classnameCompletion:'arra' |
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
2124 |
Smalltalk classnameCompletion:'*rray' |
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2125 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2126 |
Smalltalk classnameCompletion:'Arr cl' |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2127 |
Smalltalk classnameCompletion:'*rray cl' |
453 | 2128 |
" |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
2129 |
|
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
2130 |
"Created: 24.11.1995 / 17:24:45 / cg" |
2523
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
2131 |
"Modified: 3.4.1997 / 18:25:01 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2132 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2133 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2134 |
defaultNameSpace |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2135 |
"return the default namespace, where new classes are installed, |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2136 |
if NO special nameSpace handler is present" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2137 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2138 |
|p| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2139 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2140 |
(Project notNil and:[(p := Project current) notNil]) ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2141 |
^ p defaultNameSpace |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2142 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2143 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2144 |
^ self |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2145 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2146 |
"Created: 19.12.1996 / 23:49:25 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2147 |
"Modified: 2.1.1997 / 20:01:31 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2148 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2149 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2150 |
globalNameCompletion:aPartialGlobalName |
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2151 |
"given a partial globalName, return an array consisting of |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2152 |
2 entries: 1st: the best (longest) match |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2153 |
2nd: collection consisting of matching names" |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2154 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2155 |
^ DoWhatIMeanSupport globalNameCompletion:aPartialGlobalName in:self |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2156 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2157 |
" |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2158 |
Smalltalk globalnameCompletion:'Arr' |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2159 |
Smalltalk globalnameCompletion:'Arra' |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2160 |
Smalltalk globalnameCompletion:'arra' |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2161 |
Smalltalk globalnameCompletion:'*rray' |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2162 |
" |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2163 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2164 |
"Created: 24.11.1995 / 17:24:45 / cg" |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2165 |
"Modified: 3.4.1997 / 18:25:01 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2166 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2167 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2168 |
globalnameCompletion:aPartialGlobalName |
7563 | 2169 |
"given a partial globalName, return an array consisting of |
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2170 |
2 entries: 1st: the best (longest) match |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2171 |
2nd: collection consisting of matching names" |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2172 |
|
8358 | 2173 |
<resource:#obsolete> |
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2174 |
self obsoleteMethodWarning:'use #globalNameCompletion:'. |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2175 |
^ DoWhatIMeanSupport globalNameCompletion:aPartialGlobalName in:self |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2176 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2177 |
" |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2178 |
Smalltalk globalnameCompletion:'Arr' |
5736 | 2179 |
Smalltalk globalnameCompletion:'Arra' |
2180 |
Smalltalk globalnameCompletion:'arra' |
|
2181 |
Smalltalk globalnameCompletion:'*rray' |
|
2182 |
" |
|
2183 |
||
2184 |
"Created: 24.11.1995 / 17:24:45 / cg" |
|
2185 |
"Modified: 3.4.1997 / 18:25:01 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2186 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2187 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2188 |
hasNamespaces |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2189 |
"can be redefined by dummy namespaces/environments, to suppress |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2190 |
the namespace display in a browser (PocketSmalltalk)" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2191 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2192 |
^ true |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2193 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2194 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2195 |
includes:something |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2196 |
"this should come from Collection. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2197 |
will change the inheritance - Smalltalk is actually a collection" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2198 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2199 |
self do:[:element | element = something ifTrue:[^ true]]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2200 |
^ false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2201 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2202 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2203 |
isNameSpace |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2204 |
^ true |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2205 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2206 |
"Created: 11.10.1996 / 18:10:43 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2207 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2208 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2209 |
isTopLevelNameSpace |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2210 |
^ true |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2211 |
! |
7563 | 2212 |
|
2213 |
isTopLevelNamespace |
|
2214 |
"obsolete - use isTopLevelNameSpace" |
|
5365 | 2215 |
|
7432 | 2216 |
<resource:#obsolete> |
2217 |
||
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2218 |
self obsoleteMethodWarning:'use #isTopLevelNameSpace'. |
4458 | 2219 |
^ true |
2220 |
||
2221 |
"Created: 11.10.1996 / 18:10:43 / cg" |
|
2222 |
! |
|
2223 |
||
7563 | 2224 |
methodProtocolCompletion:aPartialProtocolName |
2225 |
"given a partial method protocol name, return an array consisting of |
|
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2226 |
2 entries: 1st: the best (longest) match |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2227 |
2nd: collection consisting of matching protocols" |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2228 |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2229 |
^ DoWhatIMeanSupport methodProtocolCompletion:aPartialProtocolName in:self |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2230 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2231 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2232 |
Smalltalk methodProtocolCompletion:'doc' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2233 |
Smalltalk methodProtocolCompletion:'docu' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2234 |
Smalltalk methodProtocolCompletion:'documenta' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2235 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2236 |
! |
5505
e99e8e9cbfef
added #methodProtocolCompletion:
Claus Gittinger <cg@exept.de>
parents:
5504
diff
changeset
|
2237 |
|
7563 | 2238 |
numberOfGlobals |
2239 |
"return the number of global variables in the system" |
|
2240 |
||
2241 |
|tally "{ Class: SmallInteger }" | |
|
617 | 2242 |
|
2243 |
tally := 0. |
|
2244 |
self do:[:obj | tally := tally + 1]. |
|
2245 |
^ tally |
|
2246 |
||
2247 |
"Smalltalk numberOfGlobals" |
|
2248 |
! |
|
2249 |
||
7563 | 2250 |
referencesAny:aCollection |
2251 |
"redefined, since the references are only kept in the VM's symbol table" |
|
3260 | 2252 |
|
2253 |
self keysAndValuesDo:[:key :val | |
|
7616 | 2254 |
aCollection do:[:anObject | |
2255 |
(key == anObject) ifTrue:[^ true]. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2256 |
(val == anObject ) ifTrue:[^ true]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2257 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2258 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2259 |
^ super referencesAny:aCollection |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2260 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2261 |
"Created: / 2.2.1998 / 16:01:20 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2262 |
! |
3260 | 2263 |
|
7563 | 2264 |
referencesDerivedInstanceOf:aClass |
2265 |
"redefined, since the references are only kept in the VM's symbol table" |
|
617 | 2266 |
|
2267 |
self keysAndValuesDo:[:key :val | |
|
7616 | 2268 |
(key isKindOf:aClass) ifTrue:[^ true]. |
2269 |
(val isKindOf:aClass) ifTrue:[^ true]. |
|
617 | 2270 |
]. |
2271 |
^ super referencesDerivedInstanceOf:aClass |
|
2272 |
! |
|
2273 |
||
7563 | 2274 |
referencesInstanceOf:aClass |
2275 |
"redefined, since the references are only kept in the VM's symbol table" |
|
617 | 2276 |
|
2277 |
self keysAndValuesDo:[:key :val | |
|
7616 | 2278 |
(key isMemberOf:aClass) ifTrue:[^ true]. |
2279 |
(val isMemberOf:aClass) ifTrue:[^ true]. |
|
617 | 2280 |
]. |
2281 |
^ super referencesInstanceOf:aClass |
|
2282 |
! |
|
2283 |
||
7563 | 2284 |
referencesObject:anObject |
2285 |
"redefined, since the references are only kept in the VM's symbol table" |
|
6074
d91c99700e3b
renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents:
6033
diff
changeset
|
2286 |
|
d91c99700e3b
renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents:
6033
diff
changeset
|
2287 |
self keysAndValuesDo:[:key :val | |
7616 | 2288 |
(key == anObject) ifTrue:[^ true]. |
2289 |
(val == anObject ) ifTrue:[^ true]. |
|
6074
d91c99700e3b
renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents:
6033
diff
changeset
|
2290 |
]. |
d91c99700e3b
renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents:
6033
diff
changeset
|
2291 |
^ super referencesObject:anObject |
d91c99700e3b
renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents:
6033
diff
changeset
|
2292 |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2293 |
"Modified: / 3.2.1998 / 14:22:46 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2294 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2295 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2296 |
resolveName:nameIn inClass:aClass |
7563 | 2297 |
"resolve aName as if compiled within aClass; |
3026 | 2298 |
i.e. if it has a private class with this name, return it; |
2299 |
if aName is known within the classes namespace, return that. |
|
2300 |
Otherwise, return a global with that name. |
|
2301 |
This should be used whereever Smalltalk>>at: used to be used, |
|
2302 |
to resolve a global by name." |
|
2303 |
||
4354
8e265dcb2536
fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents:
4334
diff
changeset
|
2304 |
|aName sym cls ns| |
8e265dcb2536
fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents:
4334
diff
changeset
|
2305 |
|
8e265dcb2536
fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents:
4334
diff
changeset
|
2306 |
nameIn isNil ifTrue:[^ nil]. |
4356 | 2307 |
nameIn isBehavior ifTrue:[^ nameIn]. "/ already resolved |
4354
8e265dcb2536
fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents:
4334
diff
changeset
|
2308 |
aName := nameIn. |
8e265dcb2536
fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents:
4334
diff
changeset
|
2309 |
|
8e265dcb2536
fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents:
4334
diff
changeset
|
2310 |
(aName startsWith:'Smalltalk::') ifTrue:[ |
7616 | 2311 |
aName := aName copyFrom:12. |
2312 |
^ self at:(aName asSymbol) ifAbsent:nil. |
|
4354
8e265dcb2536
fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents:
4334
diff
changeset
|
2313 |
]. |
3026 | 2314 |
|
2315 |
sym := aName asSymbol. |
|
2316 |
||
2317 |
cls := aClass privateClassesAt:sym. |
|
2318 |
cls notNil ifTrue:[^ cls]. |
|
2319 |
||
2320 |
ns := aClass nameSpace. |
|
2321 |
(ns notNil and:[ns ~~ Smalltalk]) ifTrue:[ |
|
7616 | 2322 |
ns isNameSpace ifTrue:[ |
2323 |
cls := ns at:sym ifAbsent:nil. |
|
2324 |
] ifFalse:[ |
|
2325 |
cls := ns privateClassesAt:sym |
|
2326 |
]. |
|
2327 |
cls notNil ifTrue:[^ cls]. |
|
3025 | 2328 |
]. |
3026 | 2329 |
^ self at:sym ifAbsent:nil. |
4356 | 2330 |
|
2331 |
"Modified: / 9.7.1999 / 01:18:07 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2332 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2333 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2334 |
selectorCompletion:aPartialSymbolName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2335 |
"given a partial selector, return an array consisting of |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2336 |
2 entries: 1st: the longest match |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2337 |
2nd: collection consisting of matching implemented selectors" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2338 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2339 |
^ DoWhatIMeanSupport selectorCompletion:aPartialSymbolName inEnvironment:self |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2340 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2341 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2342 |
selectorCompletion:aPartialSymbolName inEnvironment:anEnvironment |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2343 |
"given a partial selector, return an array consisting of |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2344 |
2 entries: 1st: the longest match |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2345 |
2nd: collection consisting of matching implemented selectors" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2346 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2347 |
^ DoWhatIMeanSupport selectorCompletion:aPartialSymbolName inEnvironment:anEnvironment |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2348 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2349 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2350 |
Smalltalk selectorCompletion:'at:p' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2351 |
Smalltalk selectorCompletion:'nextP' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2352 |
Smalltalk selectorCompletion:'nextp' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2353 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2354 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2355 |
"Modified: / 7.6.1996 / 08:44:33 / stefan" |
3565
966a108e3765
also do caseless selectorCompletion
Claus Gittinger <cg@exept.de>
parents:
3560
diff
changeset
|
2356 |
"Modified: / 14.6.1998 / 15:54:03 / cg" |
453 | 2357 |
! ! |
2358 |
||
4431 | 2359 |
!Smalltalk class methodsFor:'queries-system'! |
2360 |
||
7563 | 2361 |
dialectName |
8736 | 2362 |
^ #SmalltalkX |
7563 | 2363 |
|
2364 |
" |
|
2365 |
Smalltalk dialectName |
|
2366 |
" |
|
2367 |
! |
|
2368 |
||
2369 |
dialectReleaseVersion |
|
7348 | 2370 |
^ self versionString |
2371 |
||
2372 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2373 |
Smalltalk dialectReleaseVersion |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2374 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2375 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2376 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2377 |
isDolphinSmalltalk |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2378 |
"return false here - this may be useful to write portable |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2379 |
applications - add #isDolphinSmalltalk to your dolphin, |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2380 |
returning true there." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2381 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2382 |
^ false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2383 |
! |
4970 | 2384 |
|
7563 | 2385 |
isSmalltalkMT |
2386 |
"return false here - this may be useful to write portable |
|
2387 |
applications - add #isSmalltalkMT to your smalltalk-MT, |
|
4970 | 2388 |
returning true there." |
2389 |
||
2390 |
^ false |
|
2391 |
! |
|
2392 |
||
7563 | 2393 |
isSmalltalkV |
2394 |
"return false here - this may be useful to write portable |
|
2395 |
applications - add #isSmalltalkV to your smalltalkV, |
|
4431 | 2396 |
returning true there." |
2397 |
||
2398 |
^ false |
|
2399 |
! |
|
2400 |
||
7563 | 2401 |
isSmalltalkX |
2402 |
"return true here - this may be useful to write portable |
|
2403 |
applications - add #isSmalltalkX to your other smalltalks, |
|
4431 | 2404 |
returning false there." |
2405 |
||
2406 |
^ true |
|
2407 |
! |
|
2408 |
||
7563 | 2409 |
isSqueak |
2410 |
"return false here - this may be useful to write portable |
|
2411 |
applications - add #isSqueak to your squeak, |
|
4431 | 2412 |
returning true there." |
2413 |
||
2414 |
^ false |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2415 |
! |
4431 | 2416 |
|
7563 | 2417 |
isVisualAge |
2418 |
"return false here - this may be useful to write portable |
|
2419 |
applications - add #isVisualAge to your visualAge, |
|
4431 | 2420 |
returning true there." |
2421 |
||
2422 |
^ false |
|
2423 |
! |
|
2424 |
||
7563 | 2425 |
isVisualWorks |
2426 |
"return false here - this may be useful to write portable |
|
2427 |
applications - add #isVisualWorks to your visualWorks, |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2428 |
returning true there." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2429 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2430 |
^ false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2431 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2432 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2433 |
!Smalltalk class methodsFor:'startup'! |
1 | 2434 |
|
7563 | 2435 |
displayInitializationDone |
2436 |
"inform the restart, that the display has been initialized" |
|
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2437 |
|
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2438 |
CallbackSignal raiseRequest. |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2439 |
! |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2440 |
|
7563 | 2441 |
mainStartup:graphicalMode |
2442 |
"common start/restart action, if there is a Display, initialize it |
|
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2443 |
and start dispatching; otherwise go into a read-eval-print loop." |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2444 |
|
9012 | 2445 |
|process imageName thisIsARestart idx| |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2446 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2447 |
imageName := ObjectMemory imageName. |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
2448 |
thisIsARestart := imageName notNil. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2449 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2450 |
" |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2451 |
if there is a display, start its event dispatcher |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2452 |
" |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2453 |
Display notNil ifTrue:[ |
8522
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2454 |
Display deviceIOTimeoutErrorSignal handlerBlock:[:ex | |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2455 |
SaveEmergencyImage == true ifTrue:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2456 |
'Display [warning]: broken display connection - emergency save in ''crash.img''.' infoPrintCR. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2457 |
ObjectMemory primSnapShotOn:'crash.img'. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2458 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2459 |
'Display [warning]: broken display connection - exit.' infoPrintCR. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2460 |
self exit. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2461 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2462 |
Display startDispatch. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2463 |
]. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2464 |
|
9016 | 2465 |
idx := CommandLineArguments indexOf:'--browserWindow:'. |
9029 | 2466 |
IsPlugin := (idx ~~ 0). |
2467 |
IsPlugin ifTrue:[ |
|
9018 | 2468 |
self browserWindowStartup. |
9021 | 2469 |
"/ not reached |
9012 | 2470 |
]. |
2471 |
||
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2472 |
Initializing := false. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2473 |
|
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2474 |
"/ start a process, which evaluates all StartBlocks |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2475 |
"/ this used to be done right here (in this system-process), |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2476 |
"/ but lead to trouble, when it suspended. |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2477 |
"/ Therefore, it is now done by an extra user-process. |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2478 |
|
7043
d88be9c553d2
Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents:
7040
diff
changeset
|
2479 |
process := [ |
8522
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2480 |
StartBlocks notNil ifTrue:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2481 |
StartBlocks do:[:aBlock| |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2482 |
aBlock value |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2483 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2484 |
StartBlocks := nil. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2485 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2486 |
ImageStartBlocks notNil ifTrue:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2487 |
ImageStartBlocks do:[:aBlock| |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2488 |
aBlock value |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2489 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2490 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2491 |
StandAlone ifFalse:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2492 |
(SilentLoading == true) ifFalse:[ "i.e. undefined counts as false" |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2493 |
thisIsARestart ifTrue:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2494 |
Transcript cr. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2495 |
Transcript showCR:('Smalltalk restarted from:' |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2496 |
, imageName |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2497 |
, ' (saved ' |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2498 |
, ObjectMemory imageSaveTime printString |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2499 |
, ')' ). |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2500 |
] ifFalse:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2501 |
Transcript showCR:(self hello). |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2502 |
Transcript showCR:(self copyrightString). |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2503 |
Transcript cr. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2504 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2505 |
Transcript cr. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2506 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2507 |
|
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2508 |
DemoMode==true ifTrue:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2509 |
Transcript showCR:'*** Restricted use: ***'. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2510 |
Transcript showCR:'*** This program may be used for education only. ***'. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2511 |
Transcript showCR:'*** Please read the files COPYRIGHT and LICENSE ***'. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2512 |
Transcript showCR:'*** for more details. ***'. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2513 |
Transcript cr. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2514 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2515 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2516 |
|
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2517 |
thisIsARestart ifTrue:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2518 |
"/ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2519 |
"/ the final late notification - users can now assume that |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2520 |
"/ views, forms etc. have been recreated. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2521 |
|
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2522 |
ObjectMemory changed:#returnFromSnapshot. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2523 |
] |
7039
6f1c02381145
Do not keep reference to start block handler process.
Stefan Vogel <sv@exept.de>
parents:
7000
diff
changeset
|
2524 |
|
7040 | 2525 |
] newProcess. |
2526 |
||
7043
d88be9c553d2
Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents:
7040
diff
changeset
|
2527 |
process priority:8. |
d88be9c553d2
Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents:
7040
diff
changeset
|
2528 |
process name:'start block handler'. |
d88be9c553d2
Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents:
7040
diff
changeset
|
2529 |
process beGroupLeader. |
d88be9c553d2
Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents:
7040
diff
changeset
|
2530 |
process resume. |
d88be9c553d2
Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents:
7040
diff
changeset
|
2531 |
process := nil. |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
2532 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
2533 |
|
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2534 |
"/ start a process, which evaluates the startupClass>>startupSelector |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2535 |
"/ message. |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2536 |
|
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2537 |
(StartupClass notNil and:[StartupSelector notNil]) ifTrue:[ |
8522
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2538 |
" |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2539 |
allow more customization by reading an image specific rc-file |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2540 |
" |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2541 |
thisIsARestart ifTrue:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2542 |
(imageName asFilename hasSuffix:'img') ifTrue:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2543 |
imageName := imageName copyWithoutLast:4 |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2544 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2545 |
self fileIn:(imageName , '.rc') |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2546 |
]. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2547 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2548 |
"/ Display notNil ifTrue:[ |
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2549 |
"/ Display exitOnLastClose:true. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2550 |
"/ ]. |
2086 | 2551 |
"/ Processor exitWhenNoMoreUserProcesses:true. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2552 |
|
8522
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2553 |
process := [ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2554 |
StandAlone ifTrue:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2555 |
AbortOperationRequest handle:[:ex | |
8786 | 2556 |
'Smalltalk [info]: aborted - exit.' infoPrintCR. |
8522
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2557 |
OperatingSystem exit:1 |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2558 |
] do:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2559 |
StartupClass perform:StartupSelector withArguments:StartupArguments. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2560 |
] |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2561 |
] ifFalse:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2562 |
StartupClass perform:StartupSelector withArguments:StartupArguments. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2563 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2564 |
|
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2565 |
"/ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2566 |
"/ non-GUI apps exit after the startup; |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2567 |
"/ assume that GUI apps have created & opened some view ... |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2568 |
"/ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2569 |
Display isNil ifTrue:[ |
8786 | 2570 |
'Smalltalk [info]: no Display - exit.' infoPrintCR. |
8522
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2571 |
Smalltalk exit. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2572 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2573 |
"/ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2574 |
"/ GUI apps exit after the last user process has finished |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2575 |
"/ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2576 |
Display exitOnLastClose:true. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2577 |
Processor exitWhenNoMoreUserProcesses:true. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2578 |
] newProcess. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2579 |
process priority:8. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2580 |
process name:'main'. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2581 |
process beGroupLeader. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2582 |
process resume. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2583 |
process := true. "do not refer to process" |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2584 |
]. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2585 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2586 |
" |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2587 |
if view-classes exist, start dispatching; |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2588 |
otherwise go into a read-eval-print loop |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2589 |
" |
4957 | 2590 |
((Display notNil and:[graphicalMode]) |
7043
d88be9c553d2
Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents:
7040
diff
changeset
|
2591 |
or:[process notNil |
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2592 |
or:[HeadlessOperation]]) ifTrue:[ |
8522
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2593 |
Processor dispatchLoop. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2594 |
] ifFalse:[ |
8522
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2595 |
StandAlone ifFalse:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2596 |
self readEvalPrint |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2597 |
] |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2598 |
]. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2599 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2600 |
"done - the last process finished" |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2601 |
|
8786 | 2602 |
'Smalltalk [info]: last process finished - exit.' infoPrintCR. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2603 |
self exit |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2604 |
|
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2605 |
"Created: / 18.7.1996 / 21:07:39 / cg" |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2606 |
"Modified: / 9.9.1996 / 17:42:50 / stefan" |
3483 | 2607 |
"Modified: / 25.5.1998 / 15:02:57 / cg" |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2608 |
! |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2609 |
|
7563 | 2610 |
readEvalPrint |
2611 |
"{ Pragma: +optSpace }" |
|
2612 |
||
2613 |
"simple read-eval-print loop for non-graphical Minitalk" |
|
453 | 2614 |
|
2615 |
|text| |
|
2616 |
||
2617 |
'ST- ' print. |
|
2618 |
Stdin skipSeparators. |
|
2619 |
Stdin atEnd ifFalse:[ |
|
8522
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2620 |
text := Stdin nextChunk. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2621 |
[text notNil] whileTrue:[ |
8675
ceef81bb2d0c
AbortOperationRequest is now a subclass (and child-Exception) of.
Stefan Vogel <sv@exept.de>
parents:
8665
diff
changeset
|
2622 |
AbortAllOperationRequest handle:[:ex | |
8522
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2623 |
'evaluation aborted' printCR |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2624 |
] do:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2625 |
Compiler isNil ifTrue:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2626 |
'No evaluator class available (Compiler == nil)' printCR. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2627 |
^ self |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2628 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2629 |
(Compiler evaluate:text) printCR. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2630 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2631 |
'ST- ' print. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2632 |
text := Stdin nextChunk |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2633 |
]. |
453 | 2634 |
]. |
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
2635 |
'' printCR |
453 | 2636 |
! |
2637 |
||
7563 | 2638 |
restart |
2639 |
"startup after an image has been loaded; |
|
2640 |
there are three change-notifications made to dependents of ObjectMemory, |
|
10 | 2641 |
which allow a stepwise re-init: #earlyRestart, #restarted and #returnFromSnapshot. |
335 | 2642 |
|
3096
881660d6e997
added #earlySystemInitialization change message (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3092
diff
changeset
|
2643 |
#earlySystemInstallation is sent for ST80 compatibility |
881660d6e997
added #earlySystemInitialization change message (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3092
diff
changeset
|
2644 |
|
10 | 2645 |
#earlyRestart is send first, nothing has been setup yet. |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2646 |
(should be used to flush all device dependent entries) |
335 | 2647 |
|
10 | 2648 |
#restarted is send right after. |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2649 |
(should be used to recreate external resources (fds, bitmaps etc) |
335 | 2650 |
|
10 | 2651 |
#returnFromSnapshot is sent last |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2652 |
(should be used to restart processes, reOpen Streams which cannot |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2653 |
be automatically be reopened (i.e. Sockets, Pipes) and so on. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2654 |
(Notice that positionable fileStreams are already reopened and repositioned) |
1 | 2655 |
" |
10 | 2656 |
|
4503
99718971ba26
Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents:
4490
diff
changeset
|
2657 |
|deb insp transcript idx| |
1 | 2658 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2659 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2660 |
"/ when we arrive here, all objects from our previous life |
3971 | 2661 |
"/ have been reloaded - however, some may still contain invalid device |
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2662 |
"/ handles, display information etc. |
3971 | 2663 |
"/ also, dynamically loaded modules have not yet been reloaded yet. |
2664 |
"/ and the concrete OS, concrete FileName etc. are still refering to |
|
2665 |
"/ the previous classes. |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2666 |
|
1 | 2667 |
Initializing := true. |
3499 | 2668 |
AbstractOperatingSystem initializeConcreteClass. |
2669 |
||
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2670 |
ImageRestartTime := Timestamp now. |
335 | 2671 |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2672 |
CommandLine := CommandLineArguments copy. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2673 |
CommandLineArguments := CommandLineArguments asOrderedCollection. |
6842 | 2674 |
CommandName := CommandLineArguments removeFirst. "/ the command |
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2675 |
|
1582 | 2676 |
idx := CommandLineArguments indexOf:'-q'. |
6881 | 2677 |
idx == 0 ifTrue:[ |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2678 |
idx := CommandLineArguments indexOf:'--silent'. |
6881 | 2679 |
]. |
1582 | 2680 |
idx ~~ 0 ifTrue:[ |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2681 |
Object infoPrinting:false. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2682 |
ObjectMemory infoPrinting:false. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2683 |
CommandLineArguments removeAtIndex:idx. |
1582 | 2684 |
]. |
2685 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2686 |
"/ |
3971 | 2687 |
"/ start catching SIGSEGV and SIGBUS |
2688 |
||
2689 |
OperatingSystem enableHardSignalInterrupts. |
|
2690 |
||
2907 | 2691 |
"/ reinit Filename |
2692 |
Filename reinitialize. |
|
2693 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2694 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2695 |
"/ flush cached path directories (may have changed in the meanwhile) |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2696 |
|
329 | 2697 |
self flushPathCaches. |
1 | 2698 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2699 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2700 |
"/ reinit the default streams: Stdin, Stdout and Stderr |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2701 |
"/ after that, we can write to stderr. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2702 |
|
477
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
2703 |
self reinitStandardStreams. |
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
2704 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2705 |
"/ |
4503
99718971ba26
Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents:
4490
diff
changeset
|
2706 |
"/ redirect Transcript to Stderr during startup |
99718971ba26
Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents:
4490
diff
changeset
|
2707 |
|
99718971ba26
Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents:
4490
diff
changeset
|
2708 |
transcript := Transcript. |
99718971ba26
Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents:
4490
diff
changeset
|
2709 |
Transcript := Stderr. |
99718971ba26
Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents:
4490
diff
changeset
|
2710 |
|
99718971ba26
Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents:
4490
diff
changeset
|
2711 |
"/ |
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2712 |
"/ temporary switch back to dumb interface - |
4503
99718971ba26
Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents:
4490
diff
changeset
|
2713 |
"/ to handle errors while view-stuff is not yet reinitialized |
1 | 2714 |
|
2715 |
insp := Inspector. |
|
2716 |
deb := Debugger. |
|
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
2717 |
deb notNil ifTrue:[ |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2718 |
deb reinitialize |
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
2719 |
]. |
1 | 2720 |
Inspector := MiniInspector. |
2721 |
Debugger := MiniDebugger. |
|
2722 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2723 |
"/ reload any dynamically loaded objects. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2724 |
"/ this must be done before doing anything else below, |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2725 |
"/ because the Processor may restart processes which use |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2726 |
"/ this code. |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2727 |
"/ Also, a dynamic object might be registered as dependent of |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2728 |
"/ ObjectFileLoader; therefore, must reload before doing any notifications. |
335 | 2729 |
|
1100
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2730 |
ObjectFileLoader notNil ifTrue:[ |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2731 |
ObjectFileLoader reloadAllRememberedObjectFiles. |
1100
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2732 |
]. |
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2733 |
|
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2734 |
"/ |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2735 |
"/ invalidate all display connections. |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2736 |
"/ This is required to avoid trouble if someone accesses |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2737 |
"/ a display during early startup. |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2738 |
|
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2739 |
Screen notNil ifTrue:[ |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2740 |
Screen allScreens do:[:aDisplay | |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2741 |
aDisplay invalidateConnection |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2742 |
]. |
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2743 |
]. |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2744 |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2745 |
ObjectMemory changed:#earlySystemInstallation. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2746 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2747 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2748 |
"/ reinitialize the Processor - restartable processes |
4109 | 2749 |
"/ are now restarted here (but not yet scheduled). |
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2750 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2751 |
Processor reinitialize. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2752 |
|
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2753 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2754 |
"/ flush device handles & recreate OS resources (if possible) |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2755 |
"/ (mostly view/GC/color & font stuff) |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2756 |
|
3022 | 2757 |
ObjectMemory |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2758 |
changed:#earlyRestart; changed:#restarted. |
1 | 2759 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2760 |
"/ |
3526
78245608c0b8
no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents:
3523
diff
changeset
|
2761 |
"/ start catching SIGINT and SIGQUIT |
78245608c0b8
no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents:
3523
diff
changeset
|
2762 |
|
78245608c0b8
no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents:
3523
diff
changeset
|
2763 |
OperatingSystem enableUserInterrupts. |
6390
41d5c47c33f0
Catch sigPWR and sigHUP on restart
Stefan Vogel <sv@exept.de>
parents:
6366
diff
changeset
|
2764 |
OperatingSystem enableCrashSignalInterrupts. |
3526
78245608c0b8
no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents:
3523
diff
changeset
|
2765 |
|
8958 | 2766 |
"/ give user a chance to re-customize things in smalltalk_r.rc. |
8957 | 2767 |
"/ reading if smalltalk_r.rc may be suppressed by the --faststart argument. |
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2768 |
|
6881 | 2769 |
idx := CommandLineArguments indexOf:'--faststart'. |
8957 | 2770 |
idx == 0 ifTrue:[ |
2771 |
idx := CommandLineArguments indexOf:'--fastStart'. |
|
2772 |
]. |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2773 |
idx ~~ 0 ifTrue:[ |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2774 |
CommandLineArguments removeAtIndex:idx. |
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2775 |
] ifFalse:[ |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2776 |
CallbackSignal := QuerySignal new. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2777 |
[ |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2778 |
Class withoutUpdatingChangesDo:[ |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2779 |
(self fileIn:(self commandName , '_r.rc')) ifFalse:[ |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2780 |
"no _r.rc file where executable is; try default smalltalk_r.rc" |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2781 |
self fileIn:'smalltalk_r.rc' |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2782 |
]. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2783 |
] |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2784 |
] on:CallbackSignal do:[:ex| |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2785 |
"/ now, display and view-stuff works; |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2786 |
"/ back to the previous debugging interface |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2787 |
|
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2788 |
Inspector := insp. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2789 |
Debugger := deb. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2790 |
|
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2791 |
"/ reinstall Transcript, if not changed during restart. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2792 |
"/ if there was no Transcript, go to stderr |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2793 |
|
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2794 |
(transcript notNil and:[Transcript == Stderr]) ifTrue:[ |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2795 |
Transcript := transcript. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2796 |
]. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2797 |
Initializing := false. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2798 |
ex proceed. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2799 |
]. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2800 |
CallbackSignal := nil. |
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2801 |
]. |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2802 |
|
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2803 |
"/ reinitialization (restart) of Display is normally performed |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2804 |
"/ in the restart script. If this has not been run for some reason, |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2805 |
"/ do in now. |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2806 |
Initializing ifTrue:[ |
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2807 |
Display notNil ifTrue:[ |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2808 |
[ |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2809 |
Display reinitializeFor:Screen defaultDisplayName. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2810 |
] on:Screen deviceOpenErrorSignal do:[ |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2811 |
'Smalltalk [error]: Cannot restart connection to: ' errorPrint. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2812 |
Screen defaultDisplayName errorPrintCR. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2813 |
OperatingSystem exit:1. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2814 |
]. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2815 |
]. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2816 |
"/ now, display and view-stuff works; |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2817 |
"/ back to the previous debugging interface |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2818 |
|
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2819 |
Inspector := insp. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2820 |
Debugger := deb. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2821 |
|
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2822 |
"/ reinstall Transcript, if not changed during restart. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2823 |
"/ if there was no Transcript, go to stderr |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2824 |
|
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2825 |
(transcript notNil and:[Transcript == Stderr]) ifTrue:[ |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2826 |
Transcript := transcript. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2827 |
]. |
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2828 |
Initializing := false. |
7 | 2829 |
]. |
8522
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2830 |
Screen notNil ifTrue:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2831 |
"clean up leftover screens (and views) that haven't been reopened. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2832 |
Operate on a copy, since brokenConnection removes us from AllScreens" |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2833 |
Screen allScreens copy do:[:eachDisplay | |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2834 |
eachDisplay isOpen ifFalse:[ |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2835 |
'Smalltalk [info]: cannot reopen secondary display: ' errorPrint. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2836 |
eachDisplay errorPrintCR. |
8524
ad922805e66d
Avoid dangling references in context
Stefan Vogel <sv@exept.de>
parents:
8522
diff
changeset
|
2837 |
eachDisplay cleanupAfterDispatch; brokenConnection. |
8522
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2838 |
] |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2839 |
]. |
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
2840 |
]. |
7 | 2841 |
|
8524
ad922805e66d
Avoid dangling references in context
Stefan Vogel <sv@exept.de>
parents:
8522
diff
changeset
|
2842 |
deb := insp := transcript := nil. "avoid dangling refs" |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2843 |
self mainStartup:true |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2844 |
|
3526
78245608c0b8
no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents:
3523
diff
changeset
|
2845 |
"Modified: / 7.6.1998 / 02:48:00 / cg" |
4503
99718971ba26
Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents:
4490
diff
changeset
|
2846 |
"Modified: / 3.8.1999 / 09:42:21 / stefan" |
1 | 2847 |
! |
2848 |
||
7563 | 2849 |
start |
2850 |
"main startup, if there is a Display, initialize it |
|
2851 |
and start dispatching; otherwise go into a read-eval-print loop." |
|
617 | 2852 |
|
9012 | 2853 |
|idx graphicalMode arg didReadRCFile| |
960
e3b75f50d0cd
changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2854 |
|
e3b75f50d0cd
changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2855 |
graphicalMode := true. |
617 | 2856 |
Initializing := true. |
2857 |
||
2858 |
" |
|
2859 |
while reading patches- and rc-file, do not add things into change-file |
|
2860 |
" |
|
2861 |
Class withoutUpdatingChangesDo:[ |
|
8985
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2862 |
|myName defaultRC prevCatchSetting| |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2863 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2864 |
"/ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2865 |
"/ look for any '-q', '-e' or '-f' command line arguments |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2866 |
"/ and handle them; |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2867 |
"/ read startup and patches file |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2868 |
"/ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2869 |
idx := CommandLineArguments indexOf:'-q'. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2870 |
idx == 0 ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2871 |
idx := CommandLineArguments indexOf:'--silent'. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2872 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2873 |
idx ~~ 0 ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2874 |
Object infoPrinting:false. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2875 |
ObjectMemory infoPrinting:false. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2876 |
CommandLineArguments removeAtIndex:idx. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2877 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2878 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2879 |
StandAlone ifFalse:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2880 |
"/ look for a '-e filename' or '--execute filename' argument |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2881 |
"/ this will force fileIn of filename only, no standard startup. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2882 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2883 |
idx := CommandLineArguments indexOf:'-e'. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2884 |
idx == 0 ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2885 |
idx := CommandLineArguments indexOf:'--execute'. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2886 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2887 |
idx ~~ 0 ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2888 |
arg := CommandLineArguments at:idx + 1. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2889 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2890 |
CommandLineArguments |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2891 |
removeAtIndex:idx+1; removeAtIndex:idx. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2892 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2893 |
arg = '-' ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2894 |
self fileInStream:Stdin |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2895 |
lazy:nil |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2896 |
silent:nil |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2897 |
logged:false |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2898 |
addPath:nil |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2899 |
] ifFalse:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2900 |
self fileIn:arg. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2901 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2902 |
self exit |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2903 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2904 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2905 |
"/ look for a '-E expr' or '--eval expr' argument |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2906 |
"/ this will force evaluation of expr only, no standard startup |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2907 |
idx := CommandLineArguments indexOf:'-E'. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2908 |
idx == 0 ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2909 |
idx := CommandLineArguments indexOf:'--eval'. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2910 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2911 |
idx ~~ 0 ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2912 |
arg := CommandLineArguments at:idx + 1. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2913 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2914 |
CommandLineArguments |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2915 |
removeAtIndex:idx+1; removeAtIndex:idx. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2916 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2917 |
self |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2918 |
fileInStream:arg readStream |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2919 |
lazy:nil |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2920 |
silent:nil |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2921 |
logged:false |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2922 |
addPath:nil. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2923 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2924 |
self exit |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2925 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2926 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2927 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2928 |
"look for a '-f filename' or '--file filename' argument |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2929 |
this will force evaluation of filename instead of smalltalk.rc |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2930 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2931 |
If there is only one argument, which does not start with a '-', |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2932 |
this is the same as -f filename" |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2933 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2934 |
(CommandLineArguments size == 1 |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2935 |
and:[(CommandLineArguments first startsWith:$-) not]) ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2936 |
myName := CommandLineArguments removeFirst. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2937 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2938 |
myName isNil ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2939 |
idx := CommandLineArguments indexOf:'-f'. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2940 |
idx == 0 ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2941 |
idx := CommandLineArguments indexOf:'--file'. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2942 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2943 |
idx ~~ 0 ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2944 |
myName := CommandLineArguments removeAtIndex:idx+1. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2945 |
CommandLineArguments removeAtIndex:idx. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2946 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2947 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2948 |
myName notNil ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2949 |
CommandName := myName. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2950 |
(self secureFileIn:myName) ifFalse:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2951 |
('Smalltalk [error]: startup file ', myName, ' not found.') errorPrintCR. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2952 |
OperatingSystem exit:1. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2953 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2954 |
] ifFalse:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2955 |
"/ look for <command>.rc |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2956 |
"/ if not found, read smalltalk.rc (or stxapp.rc for standAlone operation) |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2957 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2958 |
didReadRCFile := false. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2959 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2960 |
myName := self commandName asFilename withSuffix:'rc'. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2961 |
(didReadRCFile := self secureFileIn:myName) ifFalse:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2962 |
StandAlone ifFalse:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2963 |
defaultRC := 'smalltalk.rc' |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2964 |
] ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2965 |
defaultRC := 'stxapp.rc' |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2966 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2967 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2968 |
didReadRCFile := self secureFileIn:defaultRC. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2969 |
didReadRCFile ifFalse:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2970 |
StandAlone ifFalse:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2971 |
'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2972 |
graphicalMode := false. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2973 |
] |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2974 |
] |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2975 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2976 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2977 |
"/ ('StandAlone is %1' bindWith:StandAlone) printCR. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2978 |
"/ ('Headless is %1' bindWith:HeadlessOperation) printCR. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2979 |
"/ ('Display is %1' bindWith:Display) printCR. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2980 |
"/ ('Screen is %1' bindWith:Screen) printCR. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2981 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2982 |
didReadRCFile ifFalse:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2983 |
StandAlone ifFalse:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2984 |
"/ its a smalltalk - proceed in interpreter. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2985 |
'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2986 |
graphicalMode := false. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2987 |
] ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2988 |
"/ its an application - try harder |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2989 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2990 |
Screen notNil ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2991 |
[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2992 |
Screen openDefaultDisplay:nil. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2993 |
] on:Screen deviceOpenErrorSignal do:[:ex| |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2994 |
('Smalltalk [error]: No Display connection to: ', ex parameter printString) errorPrintCR. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2995 |
'Smalltalk [info]: Either set the DISPLAY environment variable,' infoPrintCR. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2996 |
'Smalltalk [info]: or start smalltalk with a -display argument.' infoPrintCR. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2997 |
HeadlessOperation == true ifFalse:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2998 |
OperatingSystem exit:1. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
2999 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3000 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3001 |
|
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3002 |
Display notNil ifTrue:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3003 |
(self secureFileIn:'display.rc') ifFalse:[ |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3004 |
'Smalltalk [warning]: no display.rc found; screen setting might be wrong.' infoPrintCR. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3005 |
] |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3006 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3007 |
] |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3008 |
] |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3009 |
]. |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3010 |
]. |
617 | 3011 |
]. |
3012 |
||
6841
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
3013 |
StandAlone ifFalse:[ |
8985
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3014 |
" |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3015 |
enable the graphical debugger/inspector |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3016 |
(they could have been (re)defined as autoloaded in the patches file) |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3017 |
" |
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3018 |
self initStandardTools. |
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
3019 |
]. |
617 | 3020 |
|
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3021 |
(Display isNil or:[HeadlessOperation]) ifTrue:[ |
8985
25b8d97917d1
Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents:
8964
diff
changeset
|
3022 |
graphicalMode := false. |
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
3023 |
]. |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
3024 |
|
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
3025 |
self mainStartup:graphicalMode |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
3026 |
|
5146 | 3027 |
"Modified: / 24.12.1999 / 00:26:54 / cg" |
1097 | 3028 |
! ! |
3029 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
3030 |
!Smalltalk class methodsFor:'startup queries'! |
1097 | 3031 |
|
7563 | 3032 |
commandLine |
3033 |
"return the full command line arguments (with which ST/X was started)" |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3034 |
|
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3035 |
^ CommandLine |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3036 |
|
9029 | 3037 |
" |
3038 |
Smalltalk commandLine |
|
3039 |
" |
|
3040 |
||
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3041 |
"Created: 19.7.1996 / 11:09:06 / cg" |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3042 |
! |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3043 |
|
7563 | 3044 |
commandLineArgumentNamed:aString |
3045 |
"extract a named argument from the command line arguments." |
|
6806 | 3046 |
|
3047 |
|args index| |
|
3048 |
||
3049 |
args := self commandLineArguments. |
|
3050 |
index := args indexOf:aString. |
|
3051 |
(index between:1 and:(args size - 1)) ifTrue:[ |
|
7616 | 3052 |
^ args at:index+1 |
6806 | 3053 |
]. |
3054 |
^ nil. |
|
3055 |
||
3056 |
" |
|
3057 |
self commandLineArgumentNamed:'-display' |
|
3058 |
" |
|
3059 |
! |
|
3060 |
||
7563 | 3061 |
commandLineArguments |
3062 |
"return the user command line arguments; |
|
3063 |
This is a collection of strings (separated command line words), |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3064 |
from which the internal startup arguments have already been removed. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3065 |
I.e. if started with: 'smalltalk -I -f xxx foo bar baz', |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3066 |
the commandLineArguments will be #('foo' 'bar' 'baz'). |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3067 |
In contrast, the value returned by #commandLine will be the full set of words." |
1097 | 3068 |
|
3069 |
^ CommandLineArguments |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3070 |
|
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3071 |
"Modified: 19.7.1996 / 11:11:03 / cg" |
1097 | 3072 |
! |
3073 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3074 |
commandName |
9029 | 3075 |
"return the excutables name - this is normally 'stx', |
3076 |
but can be something else for standAlone apps." |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3077 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3078 |
^ CommandName. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3079 |
|
9029 | 3080 |
" |
3081 |
Smalltalk commandName |
|
3082 |
" |
|
3083 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3084 |
"Modified: 19.7.1996 / 11:11:16 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3085 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3086 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3087 |
isHeadless |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3088 |
"return true, if this is a headless application |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3089 |
i.e. no default Display connection is required/used" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3090 |
|
9029 | 3091 |
^ HeadlessOperation ? false |
3092 |
||
3093 |
" |
|
3094 |
Smalltalk isHeadless |
|
3095 |
" |
|
3096 |
! |
|
3097 |
||
3098 |
isPlugin |
|
3099 |
"return true, if this is a plugin application |
|
3100 |
i.e. running in a browserWindow" |
|
3101 |
||
3102 |
^ IsPlugin ? false |
|
3103 |
||
3104 |
" |
|
3105 |
Smalltalk isPlugin |
|
3106 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3107 |
! |
4957 | 3108 |
|
7563 | 3109 |
isStandAloneApp |
3110 |
"return true, if this is a standAlone application |
|
9029 | 3111 |
i.e. a stripped & linked application (such as the webServer) |
3112 |
in contrast to a full smalltalk (development) system." |
|
3113 |
||
3114 |
^ StandAlone ? false |
|
3115 |
||
3116 |
" |
|
3117 |
Smalltalk isStandAloneApp |
|
3118 |
" |
|
617 | 3119 |
! |
3120 |
||
7563 | 3121 |
startupArguments |
9029 | 3122 |
"return the arguments passed to StartupClass when stx gets started. |
3123 |
Usually these are nil, |
|
3124 |
but saving an image with a non-nil StartupClass/StartupSelector/StartupArgs allows for |
|
3125 |
a simple way to configure and create stand-alone applications" |
|
7563 | 3126 |
|
3127 |
^ StartupArguments |
|
9029 | 3128 |
|
3129 |
" |
|
3130 |
Smalltalk startupArguments |
|
3131 |
" |
|
7563 | 3132 |
! |
3133 |
||
3134 |
startupClass |
|
3135 |
"return the class, that will get the start message when smalltalk |
|
9029 | 3136 |
starts and its non-nil. Usually this is nil, |
3137 |
but saving an image with a non-nil StartupClass/StartupSelector/StartupArgs allows for |
|
3138 |
a simple way to configure and create stand-alone applications" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3139 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3140 |
^ StartupClass |
9029 | 3141 |
|
3142 |
" |
|
3143 |
Smalltalk startupClass |
|
3144 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3145 |
! |
8570 | 3146 |
|
7563 | 3147 |
startupClass:aClass selector:aSymbol arguments:anArrayOrNil |
3148 |
"{ Pragma: +optSpace }" |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3149 |
|
617 | 3150 |
"set the class, selector and arguments to be performed when smalltalk |
3151 |
starts. Setting those before saving a snapshot, will make the saved |
|
3152 |
image come up executing your application (instead of the normal mainloop)" |
|
3153 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3154 |
StartupClass := aClass. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3155 |
StartupSelector := aSymbol. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3156 |
StartupArguments := anArrayOrNil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3157 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3158 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3159 |
startupSelector |
9029 | 3160 |
"return the selector, that will be sent to StartupClass. |
3161 |
Usually this is nil, |
|
3162 |
but saving an image with a non-nil StartupClass/StartupSelector allows for |
|
3163 |
a simple way to configure and create stand-alone applications" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3164 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3165 |
^ StartupSelector |
9029 | 3166 |
|
3167 |
" |
|
3168 |
Smalltalk startupSelector |
|
3169 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3170 |
! |
7811 | 3171 |
|
3172 |
wasStartedFromImage |
|
9029 | 3173 |
"return true, if this smalltalk was started from an image, |
3174 |
as opposed to a fresh and clean startup" |
|
3175 |
||
7819 | 3176 |
^ ImageRestartTime notNil |
7811 | 3177 |
|
3178 |
" |
|
3179 |
Smalltalk wasStartedFromImage |
|
3180 |
" |
|
70 | 3181 |
! ! |
3182 |
||
9018 | 3183 |
!Smalltalk class methodsFor:'startup-in-browser'! |
3184 |
||
3185 |
browserWindowStartup |
|
3186 |
|windowIDString numericWindowID windowID params idx process| |
|
3187 |
||
3188 |
idx := CommandLineArguments indexOf:'--browserWindow:'. |
|
3189 |
windowIDString := CommandLineArguments at:idx+1. |
|
3190 |
numericWindowID := Integer fromString:windowIDString. |
|
3191 |
windowID := ExternalAddress newAddress:numericWindowID. |
|
3192 |
||
3193 |
idx := CommandLineArguments indexOf:'--browserParameters:'. |
|
3194 |
idx ~~ 0 ifTrue:[ |
|
3195 |
params := CommandLineArguments copyFrom:idx+1 |
|
3196 |
]. |
|
9022 | 3197 |
|
9018 | 3198 |
'browserWindow is: ' errorPrint. windowID errorPrintCR. |
3199 |
'browserParameters are: ' errorPrint. params errorPrintCR. |
|
3200 |
'Display is: ' errorPrint. Display errorPrintCR. |
|
3201 |
||
3202 |
process := [ |
|
3203 |
self |
|
3204 |
startInBrowserWithWindowID:windowID |
|
3205 |
parameters:params. |
|
3206 |
] newProcess. |
|
3207 |
process priority:8. |
|
3208 |
process name:'browser start handler'. |
|
3209 |
process beGroupLeader. |
|
3210 |
process resume. |
|
3211 |
process := nil. |
|
3212 |
||
9021 | 3213 |
"/ Processor dispatchLoop. |
3214 |
"/ Smalltalk exit. |
|
9018 | 3215 |
! |
3216 |
||
3217 |
startInBrowserWithWindowID:windowID parameters:parameters |
|
3218 |
|v browserTopView| |
|
3219 |
||
9020 | 3220 |
browserTopView := ExternalTopView newWithID:windowID. |
9022 | 3221 |
browserTopView viewBackground:(Color red). |
3222 |
browserTopView clear. |
|
9018 | 3223 |
|
3224 |
v := Workspace new. |
|
3225 |
||
3226 |
browserTopView becomeParentOf:v. |
|
3227 |
||
3228 |
Semaphore new wait. |
|
3229 |
! ! |
|
3230 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
3231 |
!Smalltalk class methodsFor:'system environment'! |
1069 | 3232 |
|
7563 | 3233 |
language |
3234 |
"return the language setting" |
|
3235 |
||
3236 |
^ Language |
|
3237 |
||
3238 |
" |
|
3239 |
Smalltalk language |
|
1307 | 3240 |
" |
3241 |
||
3242 |
"Modified: 26.4.1996 / 17:10:05 / cg" |
|
3243 |
! |
|
3244 |
||
7563 | 3245 |
language:aLanguageSymbol |
3246 |
"set the language" |
|
3247 |
||
3248 |
Language := aLanguageSymbol. |
|
1307 | 3249 |
self changed:#Language |
3250 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3251 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3252 |
Smalltalk language:#de |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3253 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3254 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3255 |
"Modified: 26.4.1996 / 17:13:34 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3256 |
! |
1069 | 3257 |
|
7563 | 3258 |
languageTerritory |
3259 |
"return the language territory setting" |
|
3260 |
||
3261 |
^ LanguageTerritory |
|
3262 |
! |
|
3263 |
||
3264 |
languageTerritory:aTerritorySymbol |
|
3265 |
"set the language territory" |
|
3266 |
||
3267 |
LanguageTerritory := aTerritorySymbol. |
|
1307 | 3268 |
self changed:#LanguageTerritory |
3269 |
||
3270 |
" |
|
3271 |
Time now |
|
3272 |
||
3273 |
Smalltalk languageTerritory:#us. |
|
3274 |
Time now |
|
3275 |
||
3276 |
Smalltalk languageTerritory:#de. |
|
3277 |
Time now |
|
3278 |
" |
|
3279 |
||
3280 |
"Modified: 26.4.1996 / 17:12:39 / cg" |
|
7992 | 3281 |
! |
3282 |
||
3283 |
setLanguage:aLanguageSymbol |
|
3284 |
"set the language withotu change notifications" |
|
3285 |
||
3286 |
Language := aLanguageSymbol. |
|
1069 | 3287 |
! ! |
3288 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
3289 |
!Smalltalk class methodsFor:'system management'! |
70 | 3290 |
|
7563 | 3291 |
compressSources |
3292 |
"{ Pragma: +optSpace }" |
|
3293 |
||
3294 |
"compress the sources file, and remove all method source strings |
|
617 | 3295 |
from the system and replace them by refs to a string in the source file. |
3296 |
This is a bit different in ST/X than in other smalltalks, |
|
3297 |
since we use per-class sourcefiles for the compiled classes, |
|
3298 |
and a mix of in-memory strings and one-for-all sourceFile for |
|
3299 |
incremental compiled methods. |
|
3300 |
Therefore, only those sources which are not coming from compiled |
|
3301 |
methods are put into the 'st.src' file - all others are untouched. |
|
3302 |
This is being automated - so dont care for now." |
|
3303 |
||
7105
44c02807ca41
More openErrorSignal change preparations
Stefan Vogel <sv@exept.de>
parents:
7085
diff
changeset
|
3304 |
|newStream table source pos fileName| |
44c02807ca41
More openErrorSignal change preparations
Stefan Vogel <sv@exept.de>
parents:
7085
diff
changeset
|
3305 |
|
617 | 3306 |
" |
3307 |
first, find all methods which contain either a string-ref |
|
3308 |
or an external string in the 'st.src' file |
|
3309 |
" |
|
3310 |
newStream := 'src.tmp' asFilename writeStream. |
|
3311 |
||
3312 |
table := IdentityDictionary new:100. |
|
3313 |
||
3314 |
Method allSubInstancesDo:[:aMethod | |
|
8760
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3315 |
source := nil. |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3316 |
aMethod sourcePosition notNil ifTrue:[ |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3317 |
aMethod sourceFilename = 'st.src' ifTrue:[ |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3318 |
source := aMethod source. |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3319 |
] |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3320 |
] ifFalse:[ |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3321 |
source := aMethod source |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3322 |
]. |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3323 |
|
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3324 |
source notNil ifTrue:[ |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3325 |
pos := newStream position1Based. |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3326 |
newStream nextChunkPut:source. |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3327 |
|
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3328 |
" |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3329 |
dont change the methods info - maybe some write error |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3330 |
occurs later, in that case we abort and leave everything |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3331 |
untouched. |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3332 |
" |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3333 |
table at:aMethod put:pos |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3334 |
] |
617 | 3335 |
]. |
3336 |
||
3337 |
newStream close. |
|
3338 |
||
3339 |
" |
|
3340 |
now, rename the new source file, |
|
3341 |
" |
|
3342 |
fileName := (ObjectMemory nameForSources). |
|
1693 | 3343 |
'src.tmp' asFilename renameTo:fileName. |
617 | 3344 |
|
3345 |
"good - now go over all changed methods, and change their |
|
3346 |
source reference" |
|
3347 |
||
3348 |
table keysAndValuesDo:[:aMethod :pos | |
|
8760
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3349 |
aMethod localSourceFilename:fileName position:pos. |
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
3350 |
"/ aMethod printCR. |
617 | 3351 |
]. |
3352 |
||
3353 |
" |
|
3354 |
Smalltalk compressSources |
|
3355 |
" |
|
1693 | 3356 |
|
2176
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
3357 |
"Modified: 16.1.1997 / 01:25:58 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3358 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3359 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3360 |
generateSingleSourceFile |
7563 | 3361 |
"{ Pragma: +optSpace }" |
3362 |
||
3363 |
"generate the sources file, and remove all method source strings |
|
3044 | 3364 |
from the system and replace them by refs to a string in the source file. |
3365 |
This makes the image independent from the per-class source files |
|
3366 |
and makes transportation of endUser applications easier, since |
|
3367 |
only 3 files (executable, image and sourceFile) need to be |
|
3368 |
transported." |
|
3369 |
||
3370 |
|newStream table source pos fileName| |
|
3371 |
||
3372 |
newStream := 'src.tmp' asFilename writeStream. |
|
3373 |
||
3374 |
table := IdentityDictionary new:100. |
|
3375 |
||
3376 |
Method allSubInstancesDo:[:aMethod | |
|
8760
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3377 |
source := aMethod source. |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3378 |
source notNil ifTrue:[ |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3379 |
pos := newStream position1Based. |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3380 |
newStream nextChunkPut:source. |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3381 |
|
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3382 |
" |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3383 |
dont change the methods info - maybe some write error |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3384 |
occurs later, in that case we abort and leave everything |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3385 |
untouched. |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3386 |
" |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3387 |
table at:aMethod put:pos |
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3388 |
] |
3044 | 3389 |
]. |
3390 |
||
3391 |
newStream close. |
|
3392 |
||
3393 |
" |
|
3394 |
now, rename the new source file, |
|
3395 |
" |
|
3396 |
fileName := (ObjectMemory nameForSources). |
|
3397 |
'src.tmp' asFilename renameTo:fileName. |
|
3398 |
||
3399 |
"good - now go over all changed methods, and change their |
|
3400 |
source reference" |
|
3401 |
||
3402 |
table keysAndValuesDo:[:aMethod :pos | |
|
8760
36b8199be82b
#checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents:
8736
diff
changeset
|
3403 |
aMethod localSourceFilename:fileName position:pos. |
3044 | 3404 |
"/ aMethod printCR. |
3405 |
]. |
|
3406 |
||
3407 |
" |
|
3408 |
Smalltalk generateSingleSourceFile |
|
3409 |
" |
|
3410 |
||
3411 |
"Modified: 16.1.1997 / 01:25:58 / cg" |
|
3412 |
"Created: 17.10.1997 / 13:00:56 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3413 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3414 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3415 |
installAutoloadedClassNamed:clsName category:cat package:package revision:revisionOrNil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3416 |
"create & install an autoload stub for a class named: clsName, |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3417 |
to be loaded from package. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3418 |
If revisionOrNil is non-nil, set it up to load exactly that revision |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3419 |
(otherwise, the newest revision will be loaded" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3420 |
|
8845
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3421 |
^ self |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3422 |
installAutoloadedClassNamed:clsName |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3423 |
category:cat |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3424 |
package:package |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3425 |
revision:revisionOrNil |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3426 |
numClassInstVars:nil. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3427 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3428 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3429 |
installAutoloadedClassNamed:clsName category:cat package:package revision:revisionOrNil numClassInstVars:numClassInstVarsOrNil |
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3430 |
"create & install an autoload stub for a class named: clsName, |
3915
e32e63ee0d79
extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents:
3866
diff
changeset
|
3431 |
to be loaded from package. |
e32e63ee0d79
extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents:
3866
diff
changeset
|
3432 |
If revisionOrNil is non-nil, set it up to load exactly that revision |
e32e63ee0d79
extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents:
3866
diff
changeset
|
3433 |
(otherwise, the newest revision will be loaded" |
e32e63ee0d79
extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents:
3866
diff
changeset
|
3434 |
|
7565 | 3435 |
|clsSym cls| |
3436 |
||
3437 |
clsSym := clsName asSymbol. |
|
3438 |
||
3439 |
"/ install if not already compiled-in |
|
3440 |
(cls := self at:clsSym) isNil ifTrue:[ |
|
8845
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3441 |
Autoload subclass:clsSym |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3442 |
instanceVariableNames:'' |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3443 |
classVariableNames:'' |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3444 |
poolDictionaries:'' |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3445 |
category:cat |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3446 |
inEnvironment:Smalltalk. |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3447 |
|
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3448 |
cls := self at:clsSym. |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3449 |
cls isNil ifTrue:[ |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3450 |
('Smalltalk [warning]: failed to install ' , clsName , ' as autoloaded.') infoPrintCR. |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3451 |
] ifFalse:[ |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3452 |
cls package:package asSymbol. |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3453 |
revisionOrNil notNil ifTrue:[ |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3454 |
cls setBinaryRevision:revisionOrNil |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3455 |
] |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3456 |
] |
7565 | 3457 |
] ifFalse:[ |
8845
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3458 |
"/ class already present - however, check for category/package change |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3459 |
package ~= cls package ifTrue:[ |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3460 |
cls package:package asSymbol. |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3461 |
]. |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3462 |
cat ~= cls category ifTrue:[ |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3463 |
cls category:cat. |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3464 |
]. |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3465 |
]. |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3466 |
^ cls. |
7565 | 3467 |
|
3468 |
"Created: / 5.11.1998 / 15:10:25 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3469 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3470 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3471 |
installAutoloadedClasses |
7563 | 3472 |
"read the standard abbreviation file; install all classes found there as |
3044 | 3473 |
autoloaded. This takes some time ..." |
3474 |
||
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3475 |
|dirsConsulted p| |
4458 | 3476 |
|
3477 |
"/ new scheme: look for a directory called 'packages' |
|
3478 |
"/ and enumerate its abbrev.stc files... |
|
5067
335c866e150c
walk packagePath when reading abbrevs & autoloaded classes.
Claus Gittinger <cg@exept.de>
parents:
5065
diff
changeset
|
3479 |
dirsConsulted := Set new. |
5162 | 3480 |
|
3481 |
"/ along the package-path |
|
5788 | 3482 |
(p := self packagePath) do:[:aPath | |
8950 | 3483 |
(dirsConsulted includes:aPath) ifFalse:[ |
3484 |
('Smalltalk [info]: installing autoloaded classes found under ''' , aPath ,'''') infoPrintCR. |
|
3485 |
self |
|
3486 |
recursiveInstallAutoloadedClassesFrom:aPath |
|
3487 |
rememberIn:dirsConsulted |
|
3488 |
maxLevels:15 |
|
3489 |
noAutoload:false |
|
3490 |
packageTop:aPath. |
|
3491 |
] |
|
5788 | 3492 |
]. |
3493 |
p size == 0 ifTrue:[ |
|
8950 | 3494 |
'../../../stx' asFilename exists ifTrue:[ |
3495 |
('Smalltalk [info]: installing autoloaded classes found under ''../../..''') infoPrintCR. |
|
3496 |
self |
|
3497 |
recursiveInstallAutoloadedClassesFrom:'../../..' |
|
3498 |
rememberIn:dirsConsulted |
|
3499 |
maxLevels:15 |
|
3500 |
noAutoload:false |
|
3501 |
packageTop:'../../..'. |
|
3502 |
]. |
|
5788 | 3503 |
]. |
3504 |
||
3044 | 3505 |
" |
3506 |
Smalltalk installAutoloadedClasses |
|
3507 |
" |
|
3508 |
||
5096 | 3509 |
"Created: / 14.2.1997 / 17:32:57 / cg" |
3510 |
"Modified: / 13.12.1999 / 11:56:50 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3511 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3512 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3513 |
installAutoloadedClassesFrom:anAbbrevFilePath |
7758 | 3514 |
"read the given abbreviation file; install all classes found there as |
3515 |
autoloaded. This takes some time ..." |
|
3516 |
||
3517 |
|f s| |
|
3518 |
||
3519 |
f := self getSystemFileName:anAbbrevFilePath. |
|
3520 |
f isNil ifTrue:[f := self getPackageFileName:anAbbrevFilePath]. |
|
3521 |
||
3522 |
f notNil ifTrue:[ |
|
3523 |
f := f asFilename. |
|
3524 |
f isDirectory ifTrue:[ |
|
3525 |
f := f construct:'abbrev.stc' |
|
3526 |
]. |
|
3527 |
[ |
|
3528 |
s := f readStream. |
|
3529 |
self installAutoloadedClassesFromStream:s. |
|
3530 |
s close. |
|
3531 |
] on:FileStream openErrorSignal do:[:ex| "do nothing"]. |
|
3532 |
] |
|
3533 |
||
3534 |
" |
|
3535 |
Smalltalk installAutoloadedClassesFrom:'include/abbrev.stc' |
|
3536 |
" |
|
3537 |
||
3538 |
"Modified: / 5.11.1998 / 15:10:51 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3539 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3540 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3541 |
installAutoloadedClassesFromStream:anAbbrevFileStream |
7758 | 3542 |
"read the given abbreviation file; |
3543 |
install all classes found there as autoloaded, and also update the |
|
3544 |
abbreviation (className-to-fileName mapping) table. |
|
3545 |
This takes some time ..." |
|
3546 |
||
8846 | 3547 |
|s2 l abbrevFileName info clsName cls abbrev package cat numClassInstVars words w| |
8845
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3548 |
|
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3549 |
anAbbrevFileStream isFileStream ifTrue:[ |
8846 | 3550 |
abbrevFileName := anAbbrevFileStream pathName. |
3551 |
info := 'declared from: ', abbrevFileName. |
|
8845
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3552 |
]. |
7758 | 3553 |
|
3554 |
KnownPackages isNil ifTrue:[ |
|
8470
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3555 |
KnownPackages := Set new. |
7758 | 3556 |
]. |
3557 |
||
3558 |
"/ yes, create any required nameSpace, without asking user. |
|
3559 |
Class createNameSpaceQuerySignal answer:true do:[ |
|
3560 |
||
8470
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3561 |
[anAbbrevFileStream atEnd] whileFalse:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3562 |
l := anAbbrevFileStream nextLine withoutSeparators. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3563 |
l notEmpty ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3564 |
"/ must do it manually, caring for quoted strings. |
7758 | 3565 |
"/ words := line asCollectionOfWords. |
3566 |
||
8470
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3567 |
words := OrderedCollection new. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3568 |
s2 := l readStream. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3569 |
[s2 atEnd] whileFalse:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3570 |
s2 skipSeparators. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3571 |
s2 peek == $' ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3572 |
s2 next. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3573 |
w := s2 upTo:$'. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3574 |
s2 skipSeparators. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3575 |
] ifFalse:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3576 |
w := s2 upToSeparator |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3577 |
]. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3578 |
words add:w |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3579 |
]. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3580 |
words size < 3 ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3581 |
'Smalltalk [warning]: bad abbrev entry' errorPrint. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3582 |
anAbbrevFileStream isFileStream ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3583 |
' (in ''' errorPrint. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3584 |
anAbbrevFileStream pathName errorPrint. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3585 |
''')' errorPrint |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3586 |
]. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3587 |
': ' errorPrint. l errorPrintCR |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3588 |
] ifFalse:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3589 |
clsName := (words at:1) asSymbol. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3590 |
abbrev := (words at:2). |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3591 |
package := (words at:3) asSymbol. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3592 |
cat := words at:4 ifAbsent:nil. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3593 |
numClassInstVars := words at:5 ifAbsent:'0'. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3594 |
numClassInstVars := Integer readFrom:numClassInstVars onError:[0]. |
7758 | 3595 |
|
3596 |
"/ KnownPackages add:package. |
|
3597 |
||
8470
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3598 |
(cat size == 0) ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3599 |
cat := 'autoloaded' |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3600 |
]. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3601 |
|
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3602 |
"/ on the fly, update the abbreviations |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3603 |
self setFilename:abbrev forClass:clsName package:package. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3604 |
|
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3605 |
"/ ' autoloaded: ' print. clsName print. ' in ' print. cat printCR. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3606 |
|
8845
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3607 |
cls := self |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3608 |
installAutoloadedClassNamed:clsName |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3609 |
category:cat |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3610 |
package:package |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3611 |
revision:nil |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3612 |
numClassInstVars:numClassInstVars. |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3613 |
|
8847 | 3614 |
"/ info notNil ifTrue:[ |
3615 |
"/ cls setComment:info. |
|
3616 |
"/ ]. |
|
8470
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3617 |
] |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3618 |
] |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
3619 |
] |
4458 | 3620 |
] |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3621 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3622 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3623 |
loadBinaries |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3624 |
"return true, if binaries should be loaded into the system, |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3625 |
false if this should be suppressed. The default is false (for now)." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3626 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3627 |
^ LoadBinaries |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3628 |
! |
3044 | 3629 |
|
7758 | 3630 |
loadBinaries:aBoolean |
3631 |
"{ Pragma: +optSpace }" |
|
3632 |
||
3633 |
"turn on/off loading of binary objects" |
|
3044 | 3634 |
|
3635 |
aBoolean ifTrue:[ |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3636 |
(ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]) ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3637 |
LoadBinaries := true. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3638 |
^ self |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3639 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3640 |
'Smalltalk [info]: this system does not support binary loading' infoPrintCR. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3641 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3642 |
LoadBinaries := false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3643 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3644 |
"Modified: 10.1.1997 / 15:11:00 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3645 |
! |
3044 | 3646 |
|
7758 | 3647 |
logDoits |
3648 |
"return true if doits should go into the changes file |
|
3649 |
as well as changes - by default, this is off, since |
|
3650 |
it can blow up the changes file enormously ... |
|
3651 |
" |
|
3652 |
||
3653 |
^ LogDoits |
|
3654 |
||
3655 |
" |
|
3656 |
LogDoits := false |
|
3044 | 3657 |
LogDoits := true |
3658 |
" |
|
3659 |
! |
|
3660 |
||
7758 | 3661 |
logDoits:aBoolean |
3662 |
"{ Pragma: +optSpace }" |
|
3663 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3664 |
"turn on/off logging of doits in the changes file. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3665 |
By default, this is off, since it can blow up the |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3666 |
changes file enormously ... |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3667 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3668 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3669 |
LogDoits := aBoolean |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3670 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3671 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3672 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3673 |
makeBytecodeMethods |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3674 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3675 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3676 |
"walk over all methods and make each a bytecode method |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3677 |
iff it does not contain primitive C code. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3678 |
Experimental and not yet used." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3679 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3680 |
Method allSubInstancesDo:[:aMethod | |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3681 |
|newMethod| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3682 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3683 |
aMethod hasPrimitiveCode ifFalse:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3684 |
newMethod := aMethod asByteCodeMethod. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3685 |
newMethod ~~ aMethod ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3686 |
aMethod becomeSameAs:newMethod |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3687 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3688 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3689 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3690 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3691 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3692 |
Smalltalk makeBytecodeMethods |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3693 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3694 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3695 |
"Modified: 16.1.1997 / 01:25:58 / cg" |
7758 | 3696 |
"Created: 17.10.1997 / 13:52:19 / cg" |
3697 |
! |
|
3698 |
||
3699 |
recursiveInstallAutoloadedClassesFrom:aDirectory rememberIn:dirsConsulted maxLevels:maxLevels noAutoload:noAutoloadIn packageTop:packageTopPath |
|
3700 |
"read all abbrev.stc files from and under aDirectory |
|
3701 |
and install autoloaded classes. |
|
3702 |
If a file called NOAUTOLOAD is found, no classes there and below are installed as autoloaded |
|
3703 |
(however, the directories are searched for packages) |
|
3704 |
If a file called NOPACKAGES is found, no further searching is done in that directory or below." |
|
3705 |
||
3706 |
|abbrevStream dir noAutoloadHere dirName pkgName directoryContents| |
|
3707 |
||
3708 |
maxLevels == 0 ifTrue:[ |
|
3709 |
"/ 'Smalltalk [warning]: max directory nesting reached.' infoPrintCR. |
|
3710 |
^ self |
|
3711 |
]. |
|
3712 |
||
3713 |
dir := aDirectory asFilename. |
|
3714 |
||
3715 |
(dirsConsulted includes:dir pathName) ifTrue:[ |
|
3716 |
^ self |
|
3717 |
]. |
|
3718 |
dirsConsulted add:dir pathName. |
|
3719 |
||
3720 |
(dir construct:'NOPACKAGES') exists ifTrue:[ |
|
3721 |
^ self. |
|
3722 |
]. |
|
3723 |
(dir construct:'NOSUBAUTOLOAD') exists ifTrue:[ |
|
3724 |
^ self. |
|
3725 |
]. |
|
3726 |
noAutoloadHere := noAutoloadIn. |
|
3727 |
noAutoloadHere ifFalse:[ |
|
3728 |
(dir construct:'NOAUTOLOAD') exists ifTrue:[ |
|
3729 |
noAutoloadHere := true. |
|
3730 |
]. |
|
3731 |
] ifTrue:[ |
|
3732 |
(dir construct:'AUTOLOAD') exists ifTrue:[ |
|
3733 |
noAutoloadHere := false. |
|
3734 |
]. |
|
3735 |
]. |
|
3736 |
||
3737 |
((dir construct:'loadAll') exists |
|
3738 |
or:[(dir construct:'abbrev.stc') exists |
|
3739 |
or:[(dir construct:(dir baseName , '.prj')) exists]]) ifTrue:[ |
|
3740 |
KnownPackages isNil ifTrue:[ |
|
3741 |
KnownPackages := Set new. |
|
3742 |
]. |
|
3743 |
dirName := dir pathName. |
|
3744 |
pkgName := dirName copyFrom:(packageTopPath asFilename pathName) size + 1 + 1. |
|
3745 |
KnownPackages add:pkgName |
|
3746 |
]. |
|
3747 |
||
3748 |
"/ |
|
3749 |
"/ suppress installation as autoloaded in this and everything |
|
3750 |
"/ below; however, still traverse the directories to find packages ... |
|
3751 |
"/ |
|
3752 |
noAutoloadHere ifFalse:[ |
|
3753 |
[ |
|
3754 |
abbrevStream := (dir construct:'abbrev.stc') asFilename readStream. |
|
3755 |
self installAutoloadedClassesFromStream:abbrevStream. |
|
3756 |
abbrevStream close. |
|
3757 |
] on:FileStream openErrorSignal do:[:ex| "ignore this file"]. |
|
7085
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
3758 |
]. |
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
3759 |
|
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
3760 |
[ |
7694
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3761 |
directoryContents := dir directoryContents. |
7085
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
3762 |
] on:FileStream openErrorSignal do:[:ex| |
7694
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3763 |
"non-accessable directory: we are done" |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3764 |
^ self |
7085
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
3765 |
]. |
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
3766 |
|
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
3767 |
directoryContents do:[:aFilename | |
7694
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3768 |
|f| |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3769 |
|
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3770 |
(#( |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3771 |
'doc' |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3772 |
'CVS' |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3773 |
'bitmaps' |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3774 |
'resources' |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3775 |
'source' |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3776 |
) includes:aFilename) ifFalse:[ |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3777 |
((dir baseName ~= 'stx') |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3778 |
or:[ |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3779 |
(#( |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3780 |
'configurations' |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3781 |
'include' |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3782 |
'rules' |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3783 |
'stc' |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3784 |
'support' |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3785 |
) includes:aFilename) not]) |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3786 |
ifTrue:[ |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3787 |
f := dir construct:aFilename. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3788 |
f isDirectory ifTrue:[ |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3789 |
self |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3790 |
recursiveInstallAutoloadedClassesFrom:f |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3791 |
rememberIn:dirsConsulted |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3792 |
maxLevels:maxLevels-1 |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3793 |
noAutoload:noAutoloadHere |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3794 |
packageTop:packageTopPath. |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3795 |
] |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3796 |
] |
a154c7582eca
fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents:
7670
diff
changeset
|
3797 |
]. |
4458 | 3798 |
]. |
3799 |
||
5117 | 3800 |
" |
3801 |
Smalltalk installAutoloadedClasses |
|
3802 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3803 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3804 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3805 |
replaceReferencesTo:anObject with:newRef |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3806 |
|toAdd| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3807 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3808 |
toAdd := OrderedCollection new. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3809 |
self keysAndValuesDo:[:key :val | |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3810 |
(key == anObject) ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3811 |
self shouldImplement. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3812 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3813 |
(val == anObject ) ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3814 |
toAdd add:(key -> newRef) |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3815 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3816 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3817 |
toAdd do:[:each | |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3818 |
self at:(each key) put:(each value) |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3819 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3820 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3821 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3822 |
saveEmergencyImage:aBoolean |
7758 | 3823 |
"set/clear the flag which controls if ST/X should save an |
3824 |
emergency image in case of a broken display connection. |
|
3825 |
The default is true. |
|
3826 |
This may be useful, if you work with an unsecure display |
|
3827 |
(serial line), and want to have a chance of proceeding after |
|
3828 |
a crash. In multiheaded applications, this only affects |
|
3829 |
crashes of the master Display connection (the initial connection); |
|
3830 |
errors on other displays are reported to the views and treated |
|
3831 |
like window destroy from the windowManager." |
|
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3832 |
|
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3833 |
SaveEmergencyImage := aBoolean |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3834 |
|
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3835 |
"Modified: / 24.10.1997 / 18:22:26 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3836 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3837 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3838 |
systemOrganization |
7758 | 3839 |
"for partial ST80 compatibility; |
3840 |
In ST80, Smalltalk organization returns a systemOrganizer, which |
|
3841 |
keeps track of class-categories, while all classes return a classOrganizer |
|
3842 |
from #organization, which keeps track of method categories of that class. |
|
3843 |
Since in ST/X, Smalltalk is a class, there is now a conflict. |
|
3844 |
To make a workaround possible, use #systemOrganization when porting |
|
3845 |
VW apps to ST/X to get the class-categories. |
|
3846 |
Read the documentation in SystemOrganizer for more info." |
|
3626
5a69787e857c
added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents:
3624
diff
changeset
|
3847 |
|
5a69787e857c
added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents:
3624
diff
changeset
|
3848 |
^ SystemOrganizer for:nil |
5a69787e857c
added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents:
3624
diff
changeset
|
3849 |
|
5a69787e857c
added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents:
3624
diff
changeset
|
3850 |
"Created: / 20.6.1998 / 12:24:02 / cg" |
5a69787e857c
added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents:
3624
diff
changeset
|
3851 |
"Modified: / 20.6.1998 / 12:41:34 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3852 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3853 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3854 |
!Smalltalk class methodsFor:'system management-fileIn'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3855 |
|
7758 | 3856 |
fileIn:aFileName |
3857 |
"read in the named file - look for it in some standard places; |
|
3858 |
return true if ok, false if failed. |
|
3859 |
This method can load almost anything which makes sense: |
|
7616 | 3860 |
.st - source files |
3861 |
.cls - binary smalltalk bytecode files |
|
3862 |
.so - binary compiled machine code class libraries |
|
3863 |
[.class - java bytecode -- soon to come]" |
|
3044 | 3864 |
|
3865 |
^ self fileIn:aFileName lazy:nil silent:nil logged:false |
|
3866 |
||
3867 |
" |
|
3868 |
Smalltalk fileIn:'source/TicTacToe.st' |
|
4712 | 3869 |
Smalltalk fileIn:'binary/TicTacToe.cls' |
3870 |
Smalltalk fileIn:'binary/TicTacToe.so' |
|
3044 | 3871 |
" |
3872 |
||
3873 |
"Created: 28.10.1995 / 17:06:28 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3874 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3875 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3876 |
fileIn:aFileName inPackage:aPackageID |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3877 |
"read in the named file in a packages directory." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3878 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3879 |
|dir| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3880 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3881 |
dir := self getPackageDirectoryForPackage:aPackageID. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3882 |
dir isNil ifTrue:[^ false]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3883 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3884 |
dir := dir asFilename. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3885 |
^ (self fileIn:(dir construct:aFileName)) |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3886 |
or:[ self fileIn:((dir construct:'source') construct:aFileName) ] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3887 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3888 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3889 |
fileIn:aFileName lazy:lazy |
7758 | 3890 |
"read in the named file - look for it in some standard places; |
3891 |
return true if ok, false if failed. |
|
3892 |
If lazy is true, no code is generated for methods, instead stubs |
|
3893 |
are created which compile themself when first executed. This allows |
|
3894 |
for much faster fileIn (but slows down the first execution later). |
|
3895 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
3896 |
code which is known to be syntactically correct." |
|
3897 |
||
3898 |
^ self fileIn:aFileName lazy:lazy silent:nil logged:false |
|
3899 |
||
3900 |
" |
|
3901 |
Smalltalk fileIn:'source/TicTacToe.st' lazy:true |
|
3044 | 3902 |
" |
3903 |
||
3904 |
"Created: 28.10.1995 / 17:06:36 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3905 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3906 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3907 |
fileIn:aFileName lazy:lazy silent:silent |
7758 | 3908 |
"read in the named file - look for it in some standard places; |
3909 |
return true if ok, false if failed. |
|
3910 |
If lazy is true, no code is generated for methods, instead stubs |
|
3911 |
are created which compile themself when first executed. This allows |
|
3912 |
for much faster fileIn (but slows down the first execution later). |
|
3913 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
3914 |
code which is known to be syntactically correct. |
|
3915 |
If silent is true, no compiler messages are output to the transcript. |
|
3916 |
Giving nil for silent/lazy will use the current settings." |
|
3917 |
||
3918 |
^ self fileIn:aFileName lazy:lazy silent:silent logged:false |
|
3919 |
||
3920 |
"Created: 28.10.1995 / 17:06:41 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3921 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3922 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3923 |
fileIn:aFileNameOrString lazy:lazy silent:silent logged:logged |
7758 | 3924 |
"read in the named file - look for it in some standard places; |
3925 |
return true if ok, false if failed. |
|
3926 |
If lazy is true, no code is generated for methods, instead stubs |
|
3927 |
are created which compile themself when first executed. This allows |
|
3928 |
for much faster fileIn (but slows down the first execution later). |
|
3929 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
3930 |
code which is known to be syntactically correct. |
|
3931 |
If silent is true, no compiler messages are output to the transcript. |
|
3932 |
Giving nil for silent/lazy will use the current settings. |
|
3933 |
This method can load almost anything which makes sense: |
|
3934 |
.st - source files |
|
3935 |
.cls - binary smalltalk bytecode files |
|
3936 |
.so - binary compiled machine code class libraries |
|
3937 |
[.class - java bytecode -- soon to come]" |
|
3938 |
||
3939 |
|fileNameString aStream path morePath bos| |
|
3940 |
||
3941 |
fileNameString := aFileNameOrString asString. |
|
3942 |
||
3943 |
" |
|
3944 |
an object or shared object ? |
|
3945 |
" |
|
3946 |
(ObjectFileLoader notNil |
|
3947 |
and:[ObjectFileLoader hasValidBinaryExtension:fileNameString]) ifTrue:[ |
|
3948 |
"/ LoadBinaries ifFalse:[^ false]. |
|
3949 |
path := self getBinaryFileName:fileNameString. |
|
3950 |
path isNil ifTrue:[ |
|
3951 |
path := self getSystemFileName:fileNameString. |
|
3952 |
]. |
|
3953 |
path isNil ifTrue:[^ false]. |
|
3954 |
^ (ObjectFileLoader loadObjectFile:path) notNil |
|
3955 |
]. |
|
3956 |
||
3957 |
(fileNameString asFilename hasSuffix:'cls') ifTrue:[ |
|
3958 |
BinaryObjectStorage notNil ifTrue:[ |
|
3959 |
aStream := self systemFileStreamFor:fileNameString. |
|
3960 |
"/ path := self getBinaryFileName:fileNameString. |
|
3961 |
"/ path isNil ifTrue:[^ false]. |
|
3962 |
"/ aStream := path asFilename readStream. |
|
3963 |
aStream notNil ifTrue:[ |
|
3964 |
aStream binary. |
|
3965 |
bos := BinaryObjectStorage onOld:aStream. |
|
3966 |
bos next. |
|
3967 |
bos close. |
|
3968 |
^ true |
|
3969 |
]. |
|
3970 |
^ false |
|
3971 |
] |
|
3972 |
]. |
|
3973 |
||
3974 |
(fileNameString startsWith:'source/') ifTrue:[ |
|
3975 |
aStream := self sourceFileStreamFor:(fileNameString copyFrom:8) |
|
3976 |
] ifFalse:[ |
|
3977 |
(fileNameString startsWith:'fileIn/') ifTrue:[ |
|
3978 |
aStream := self fileInFileStreamFor:(fileNameString copyFrom:8) |
|
3979 |
] ifFalse:[ |
|
3980 |
aStream := self systemFileStreamFor:fileNameString. |
|
7616 | 3981 |
aStream isNil ifTrue:[ |
3982 |
OperatingSystem isUNIXlike ifTrue:[ |
|
3983 |
(fileNameString startsWith:'/') ifFalse:[ |
|
3984 |
aStream := self systemFileStreamFor:('lib/' , fileNameString). |
|
3985 |
] |
|
3986 |
] |
|
3987 |
]. |
|
3988 |
(aStream notNil and:[fileNameString includes:$/]) ifTrue:[ |
|
3989 |
"/ temporarily prepend the files directory |
|
3990 |
"/ to the searchPath. |
|
3991 |
"/ This allows fileIn-driver files to refer to local |
|
3992 |
"/ files via a relative path, and drivers to fileIn other |
|
3993 |
"/ drivers ... |
|
3994 |
morePath := aStream pathName asFilename directoryName. |
|
3995 |
] |
|
3996 |
] |
|
3044 | 3997 |
]. |
3998 |
aStream isNil ifTrue:[^ false]. |
|
3999 |
^ self fileInStream:aStream lazy:lazy silent:silent logged:logged addPath:morePath |
|
4000 |
||
4001 |
" |
|
4002 |
Smalltalk fileIn:'source/TicTacToe.st' lazy:true silent:true |
|
4003 |
" |
|
4004 |
||
3952
05c36f8e87b4
fixed fileIn of byteCode (.cls) files
Claus Gittinger <cg@exept.de>
parents:
3915
diff
changeset
|
4005 |
"Modified: / 16.2.1999 / 10:03:26 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4006 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4007 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4008 |
fileIn:aFileName logged:logged |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4009 |
"read in the named file - look for it in some standard places; |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4010 |
return true if ok, false if failed. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4011 |
The argument logged controls, if the changefile is to be updated." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4012 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4013 |
^ self fileIn:aFileName lazy:nil silent:nil logged:logged |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4014 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4015 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4016 |
Smalltalk fileIn:'source/TicTacToe.st' logged:false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4017 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4018 |
! |
7758 | 4019 |
|
4020 |
fileInChanges |
|
4021 |
"read in the last changes file - bringing the system to the state it |
|
70 | 4022 |
had when left the last time. |
4023 |
WARNING: this method is rubbish: it should only read things after the |
|
7616 | 4024 |
last '**snapshot**' - entry |
4025 |
(instead of the complete changes file)." |
|
1 | 4026 |
|
70 | 4027 |
" |
400 | 4028 |
do NOT update the changes file now ... |
70 | 4029 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4030 |
self fileIn:ChangeFileName logged:false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4031 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4032 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4033 |
Smalltalk fileInChanges |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4034 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4035 |
! |
1 | 4036 |
|
7758 | 4037 |
fileInClass:aClassName |
4038 |
"find a source/object file for aClassName and -if found - load it. |
|
4039 |
search is in some standard places trying driver-file (.ld), object-file (.o) and |
|
4040 |
finally source file (.st) in that order. |
|
4041 |
The file is first searched for using the class name, then the abbreviated name." |
|
4042 |
||
4043 |
^ self |
|
4044 |
fileInClass:aClassName |
|
4045 |
package:nil |
|
4046 |
initialize:true |
|
4047 |
lazy:false |
|
4048 |
silent:nil |
|
4049 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4050 |
"Modified: / 9.1.1998 / 14:41:46 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4051 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4052 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4053 |
fileInClass:aClassName fromObject:aFileName |
7758 | 4054 |
"read in the named object file and dynamic-link it into the system |
3044 | 4055 |
- look for it in some standard places. |
4056 |
Only install the named class from this object file. |
|
4057 |
Return true if ok, false if failed." |
|
4058 |
||
4059 |
|path ok| |
|
4060 |
||
4061 |
" |
|
4062 |
check if the dynamic loader class is in |
|
4063 |
" |
|
4064 |
(LoadBinaries not or:[ObjectFileLoader isNil]) ifTrue:[^ false]. |
|
4065 |
||
4066 |
(path := self getBinaryFileName:aFileName) isNil ifTrue:[^ false]. |
|
4067 |
ok := (ObjectFileLoader loadClass:aClassName fromObjectFile:path) notNil. |
|
4068 |
ok ifTrue:[ |
|
7616 | 4069 |
SilentLoading ifFalse:[ |
4070 |
Transcript show:' loaded ' , aClassName , ' from ' ; showCR:aFileName. |
|
4071 |
] |
|
3044 | 4072 |
]. |
4073 |
^ ok |
|
4074 |
||
4075 |
" |
|
4076 |
Smalltalk fileInClass:'AbstractPath' fromObject:'../../goodies/Paths/AbstrPath.so' |
|
4077 |
Smalltalk fileInClass:'ClockView' fromObject:'../../libwidg3/libwidg3.so' |
|
4078 |
" |
|
4079 |
||
4080 |
"Modified: 10.9.1996 / 20:43:52 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4081 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4082 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4083 |
fileInClass:aClassName initialize:doInit |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4084 |
"find a source/object file for aClassName and -if found - load it. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4085 |
search is in some standard places trying driver-file (.ld), object-file (.o) and |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4086 |
finally source file (.st) in that order. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4087 |
The file is first searched for using the class name, then the abbreviated name." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4088 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4089 |
^ self |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4090 |
fileInClass:aClassName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4091 |
package:nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4092 |
initialize:doInit |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4093 |
lazy:false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4094 |
silent:nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4095 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4096 |
"Modified: / 9.1.1998 / 14:42:02 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4097 |
! |
3044 | 4098 |
|
7758 | 4099 |
fileInClass:aClassName initialize:doInit lazy:loadLazy |
4100 |
"find a source/object file for aClassName and -if found - load it. |
|
4101 |
search is in some standard places trying driver-file (.ld), object-file (.o) and |
|
4102 |
finally source file (.st) in that order. |
|
4103 |
The file is first searched for using the class name, then the abbreviated name." |
|
4104 |
||
4105 |
^ self |
|
4106 |
fileInClass:aClassName |
|
4107 |
package:nil |
|
4108 |
initialize:doInit |
|
4109 |
lazy:loadLazy |
|
4110 |
silent:nil |
|
4111 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4112 |
"Modified: / 9.1.1998 / 14:42:19 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4113 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4114 |
|
7758 | 4115 |
fileInClass:aClassName initialize:doInit lazy:loadLazy silent:beSilent |
7563 | 4116 |
"find a source/object file for aClassName and -if found - load it. |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4117 |
Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4118 |
finally source file (.st), in that order. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4119 |
The file is first searched for using the class name, then the abbreviated name. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4120 |
The argument doInit controlls if the class should be sent a #initialize after the |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4121 |
load; loadLazy tells if it should be loaded lazyly. beSilent tells if the compiler |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4122 |
should not send notes to the transcript; it can be true, false or nil, where |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4123 |
nil uses the value from SilentLoading." |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4124 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4125 |
^ self |
7616 | 4126 |
fileInClass:aClassName |
4127 |
package:nil |
|
4128 |
initialize:doInit |
|
4129 |
lazy:loadLazy |
|
4130 |
silent:beSilent |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4131 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4132 |
"Modified: / 9.1.1998 / 14:42:28 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4133 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4134 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4135 |
fileInClass:aClassName package:package initialize:doInit lazy:loadLazy silent:beSilent |
7758 | 4136 |
"find a source/object file for aClassName and -if found - load it. |
4137 |
This is the workhorse for autoloading. |
|
4138 |
Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and |
|
4139 |
finally source file (.st), in that order. |
|
4140 |
The file is first searched for using the class name, then the abbreviated name. |
|
4141 |
The argument doInit controlls if the class should be sent a #initialize after the |
|
4142 |
load; loadLazy tells if it should be loaded lazyly. beSilent tells if the compiler |
|
4143 |
should not send notes to the transcript; it can be true, false or nil, where |
|
4144 |
nil uses the value from SilentLoading." |
|
4145 |
||
7763 | 4146 |
|classFileName alternativeClassFileName libName newClass ok wasLazy wasSilent sharedLibExtension inStream mgr |
7758 | 4147 |
fn packageDir packageFile bos| |
4148 |
||
4149 |
wasLazy := Compiler compileLazy:loadLazy. |
|
4150 |
beSilent notNil ifTrue:[ |
|
7763 | 4151 |
wasSilent := self silentLoading:beSilent. |
4152 |
]. |
|
4153 |
||
4154 |
classFileName := Smalltalk fileNameForClass:aClassName. |
|
4155 |
(classFileName = aClassName) ifTrue:[ |
|
4156 |
"/ no abbrev.stc translation for className |
|
4157 |
(aClassName includes:$:) ifTrue:[ |
|
4158 |
"/ a nameSpace name |
|
4159 |
alternativeClassFileName := classFileName copyFrom:(classFileName lastIndexOf:$:)+1 |
|
4160 |
]. |
|
4161 |
]. |
|
4162 |
||
4163 |
classFileName := classFileName copyReplaceAll:$: with:$_. |
|
7758 | 4164 |
|
4165 |
[ |
|
7763 | 4166 |
Class withoutUpdatingChangesDo: |
4167 |
[ |
|
4168 |
|zarFn zar entry| |
|
4169 |
||
4170 |
ok := false. |
|
4171 |
||
4172 |
package notNil ifTrue:[ |
|
4173 |
packageDir := package asString. |
|
4174 |
packageDir := packageDir copyReplaceAll:$: with:$/. |
|
4175 |
]. |
|
4176 |
||
4177 |
Class packageQuerySignal answer:package |
|
4178 |
do:[ |
|
4179 |
||
4180 |
" |
|
4181 |
first, look for a loader-driver file (in fileIn/xxx.ld) |
|
4182 |
" |
|
4183 |
(ok := self fileIn:('fileIn/' , classFileName , '.ld') lazy:loadLazy silent:beSilent) |
|
4184 |
ifFalse:[ |
|
4185 |
" |
|
4186 |
try abbreviated driver-file (in fileIn/xxx.ld) |
|
4187 |
" |
|
4188 |
alternativeClassFileName notNil ifTrue:[ |
|
4189 |
ok := self fileIn:('fileIn/' , alternativeClassFileName , '.ld') lazy:loadLazy silent:beSilent |
|
4190 |
]. |
|
4191 |
ok ifFalse:[ |
|
4192 |
" |
|
4193 |
then, if dynamic linking is available, |
|
4194 |
" |
|
4195 |
(LoadBinaries and:[ObjectFileLoader notNil]) ifTrue:[ |
|
4196 |
sharedLibExtension := ObjectFileLoader sharedLibraryExtension. |
|
4197 |
||
4198 |
" |
|
4199 |
first look for a class packages shared binary in binary/xxx.o |
|
4200 |
" |
|
4201 |
libName := self libraryFileNameOfClass:aClassName. |
|
4202 |
libName notNil ifTrue:[ |
|
4203 |
(ok := self fileInClass:aClassName fromObject:(libName, sharedLibExtension)) |
|
4204 |
ifFalse:[ |
|
4205 |
sharedLibExtension ~= '.o' ifTrue:[ |
|
4206 |
ok := self fileInClass:aClassName fromObject:(libName, '.o') |
|
4207 |
] |
|
4208 |
]. |
|
4209 |
]. |
|
4210 |
||
4211 |
" |
|
4212 |
then, look for a shared binary in binary/xxx.o |
|
4213 |
" |
|
4214 |
ok ifFalse:[ |
|
4215 |
(ok := self fileInClass:aClassName fromObject:(classFileName, sharedLibExtension)) |
|
4216 |
ifFalse:[ |
|
4217 |
sharedLibExtension ~= '.o' ifTrue:[ |
|
4218 |
ok := self fileInClass:aClassName fromObject:(classFileName, '.o') |
|
4219 |
]. |
|
4220 |
ok ifFalse:[ |
|
4221 |
alternativeClassFileName notNil ifTrue:[ |
|
4222 |
(ok := self fileInClass:aClassName fromObject:(alternativeClassFileName, sharedLibExtension)) |
|
4223 |
ifFalse:[ |
|
4224 |
sharedLibExtension ~= '.o' ifTrue:[ |
|
4225 |
ok := self fileInClass:aClassName fromObject:(alternativeClassFileName, '.o') |
|
4226 |
] |
|
4227 |
] |
|
4228 |
]. |
|
4229 |
]. |
|
4230 |
]. |
|
4231 |
]. |
|
4232 |
]. |
|
4233 |
||
4234 |
" |
|
4235 |
if that did not work, look for a compiled-bytecode file ... |
|
4236 |
" |
|
4237 |
ok ifFalse:[ |
|
4238 |
(ok := self fileIn:(classFileName , '.cls') lazy:loadLazy silent:beSilent) |
|
4239 |
ifFalse:[ |
|
4240 |
alternativeClassFileName notNil ifTrue:[ |
|
4241 |
ok := self fileIn:(alternativeClassFileName , '.cls') lazy:loadLazy silent:beSilent |
|
4242 |
] |
|
4243 |
] |
|
4244 |
]. |
|
4245 |
" |
|
4246 |
if that did not work, and the classes package is known, |
|
4247 |
look for an st-cls file |
|
4248 |
in a package subdir of the source-directory ... |
|
4249 |
" |
|
4250 |
ok ifFalse:[ |
|
4251 |
(packageDir notNil and:[BinaryObjectStorage notNil]) ifTrue:[ |
|
4252 |
packageFile := self getPackageFileName:(packageDir , '/classes/' , classFileName , '.cls'). |
|
4253 |
packageFile isNil ifTrue:[ |
|
4254 |
packageFile := (packageDir , '/classes/' , classFileName , '.cls'). |
|
4255 |
]. |
|
4256 |
(ok := self fileIn:packageFile lazy:loadLazy silent:beSilent) |
|
4257 |
ifFalse:[ |
|
4258 |
alternativeClassFileName notNil ifTrue:[ |
|
4259 |
packageFile := self getPackageFileName:(packageDir , '/classes/' , alternativeClassFileName , '.cls'). |
|
4260 |
packageFile isNil ifTrue:[ |
|
4261 |
packageFile := (packageDir , '/classes/' , alternativeClassFileName , '.cls'). |
|
4262 |
]. |
|
4263 |
ok := self fileIn:packageFile lazy:loadLazy silent:beSilent |
|
4264 |
] |
|
4265 |
]. |
|
4266 |
||
4267 |
zarFn := self getPackageFileName:(packageDir , '/classes.zip'). |
|
4268 |
zarFn notNil ifTrue:[ |
|
4269 |
zar := ZipArchive oldFileNamed:zarFn. |
|
4270 |
zar notNil ifTrue:[ |
|
4271 |
entry := zar extract:(classFileName , '.cls'). |
|
4272 |
(entry isNil and:[alternativeClassFileName notNil]) ifTrue:[ |
|
4273 |
entry := zar extract:(alternativeClassFileName , '.cls'). |
|
4274 |
]. |
|
4275 |
entry notNil ifTrue:[ |
|
4276 |
bos := BinaryObjectStorage onOld:(entry asByteArray readStream). |
|
4277 |
bos next. |
|
4278 |
bos close. |
|
4279 |
ok := true |
|
4280 |
]. |
|
4281 |
] |
|
4282 |
] |
|
4283 |
] |
|
4284 |
]. |
|
4285 |
||
4286 |
" |
|
4287 |
if that did not work, look for an st-source file ... |
|
4288 |
" |
|
4289 |
ok ifFalse:[ |
|
4290 |
fn := classFileName , '.st'. |
|
4291 |
(ok := self fileIn:fn lazy:loadLazy silent:beSilent) |
|
4292 |
ifFalse:[ |
|
4293 |
alternativeClassFileName notNil ifTrue:[ |
|
4294 |
fn := alternativeClassFileName , '.st'. |
|
4295 |
ok := self fileIn:fn lazy:loadLazy silent:beSilent |
|
4296 |
]. |
|
4297 |
ok ifFalse:[ |
|
4298 |
" |
|
4299 |
... and in the standard source-directory |
|
4300 |
" |
|
4301 |
fn := 'source/' , classFileName , '.st'. |
|
4302 |
(ok := self fileIn:fn lazy:loadLazy silent:beSilent) |
|
4303 |
ifFalse:[ |
|
4304 |
alternativeClassFileName notNil ifTrue:[ |
|
4305 |
fn := 'source/' , alternativeClassFileName , '.st'. |
|
4306 |
ok := self fileIn:fn lazy:loadLazy silent:beSilent |
|
4307 |
] |
|
4308 |
] |
|
4309 |
] |
|
4310 |
]. |
|
4311 |
" |
|
4312 |
if that did not work, and the classes package is known, |
|
4313 |
look for an st-source file |
|
4314 |
in a package subdir of the source-directory ... |
|
4315 |
" |
|
4316 |
ok ifFalse:[ |
|
4317 |
packageDir notNil ifTrue:[ |
|
4318 |
packageFile := self getPackageFileName:(packageDir , '/source/' , classFileName , '.st'). |
|
4319 |
packageFile isNil ifTrue:[ |
|
4320 |
packageFile := (packageDir , '/source/' , classFileName , '.st'). |
|
4321 |
]. |
|
4322 |
fn := packageFile. |
|
4323 |
(ok := self fileIn:packageFile lazy:loadLazy silent:beSilent) |
|
4324 |
ifFalse:[ |
|
4325 |
alternativeClassFileName notNil ifTrue:[ |
|
4326 |
packageFile := self getPackageFileName:(packageDir , '/source/' , alternativeClassFileName , '.st'). |
|
4327 |
packageFile isNil ifTrue:[ |
|
4328 |
packageFile := (packageDir , '/source/' , alternativeClassFileName , '.st'). |
|
4329 |
]. |
|
4330 |
fn := packageFile. |
|
4331 |
ok := self fileIn:packageFile lazy:loadLazy silent:beSilent |
|
4332 |
]. |
|
4333 |
ok ifFalse:[ |
|
4334 |
||
4335 |
packageFile := self getPackageFileName:(packageDir , '/' , classFileName , '.st'). |
|
4336 |
packageFile isNil ifTrue:[ |
|
4337 |
packageFile := (packageDir , '/' , classFileName , '.st'). |
|
4338 |
]. |
|
4339 |
fn := packageFile. |
|
4340 |
(ok := self fileIn:packageFile lazy:loadLazy silent:beSilent) |
|
4341 |
ifFalse:[ |
|
4342 |
alternativeClassFileName notNil ifTrue:[ |
|
4343 |
packageFile := self getPackageFileName:(packageDir , '/' , alternativeClassFileName , '.st'). |
|
4344 |
packageFile isNil ifTrue:[ |
|
4345 |
packageFile := (packageDir , '/' , alternativeClassFileName , '.st'). |
|
4346 |
]. |
|
4347 |
fn := packageFile. |
|
4348 |
ok := self fileIn:packageFile lazy:loadLazy silent:beSilent |
|
4349 |
]. |
|
4350 |
ok ifFalse:[ |
|
4351 |
" |
|
4352 |
... and in the standard source-directory |
|
4353 |
" |
|
4354 |
fn := 'source/' , packageDir , '/' , classFileName , '.st'. |
|
4355 |
(ok := self fileIn:fn lazy:loadLazy silent:beSilent) |
|
4356 |
ifFalse:[ |
|
4357 |
alternativeClassFileName notNil ifTrue:[ |
|
4358 |
fn := 'source/' , packageDir , '/' , alternativeClassFileName , '.st'. |
|
4359 |
ok := self fileIn:fn lazy:loadLazy silent:beSilent |
|
4360 |
] |
|
4361 |
] |
|
4362 |
] |
|
4363 |
]. |
|
4364 |
]. |
|
4365 |
]. |
|
4366 |
] |
|
4367 |
]. |
|
4368 |
" |
|
4369 |
if that did not work, and the classes package is known, |
|
4370 |
look for a zipArchive containing a class entry. |
|
4371 |
" |
|
4372 |
ok ifFalse:[ |
|
4373 |
packageDir notNil ifTrue:[ |
|
4374 |
zarFn := self getPackageFileName:(packageDir , '/source.zip'). |
|
4375 |
zarFn isNil ifTrue:[ |
|
4376 |
zarFn := packageDir asFilename withSuffix:'zip'. |
|
4377 |
zarFn := self getSourceFileName:zarFn. |
|
4378 |
]. |
|
4379 |
zarFn notNil ifTrue:[ |
|
4380 |
zar := ZipArchive oldFileNamed:zarFn. |
|
4381 |
zar notNil ifTrue:[ |
|
4382 |
entry := zar extract:(classFileName , '.st'). |
|
4383 |
(entry isNil and:[alternativeClassFileName notNil]) ifTrue:[ |
|
4384 |
entry := zar extract:(alternativeClassFileName , '.st'). |
|
4385 |
]. |
|
4386 |
entry notNil ifTrue:[ |
|
4387 |
fn := zarFn. |
|
4388 |
ok := self |
|
4389 |
fileInStream:(entry asString readStream) |
|
4390 |
lazy:loadLazy |
|
4391 |
silent:beSilent |
|
4392 |
logged:false |
|
4393 |
addPath:nil |
|
4394 |
]. |
|
4395 |
] |
|
4396 |
] |
|
4397 |
] |
|
4398 |
]. |
|
4399 |
||
4400 |
" |
|
4401 |
if that did not work, |
|
4402 |
look for a zipArchive containing a class entry. |
|
4403 |
" |
|
4404 |
ok ifFalse:[ |
|
4405 |
zarFn := self getSourceFileName:'source.zip'. |
|
4406 |
zarFn notNil ifTrue:[ |
|
4407 |
zar := ZipArchive oldFileNamed:zarFn. |
|
4408 |
zar notNil ifTrue:[ |
|
4409 |
entry := zar extract:(zarFn := classFileName , '.st'). |
|
4410 |
(entry isNil and:[alternativeClassFileName notNil]) ifTrue:[ |
|
4411 |
entry := zar extract:(zarFn := alternativeClassFileName , '.st'). |
|
4412 |
]. |
|
4413 |
entry notNil ifTrue:[ |
|
4414 |
fn := zarFn. |
|
4415 |
ok := self |
|
4416 |
fileInStream:(entry asString readStream) |
|
4417 |
lazy:loadLazy |
|
4418 |
silent:beSilent |
|
4419 |
logged:false |
|
4420 |
addPath:nil |
|
4421 |
]. |
|
4422 |
] |
|
4423 |
] |
|
4424 |
]. |
|
4425 |
ok ifFalse:[ |
|
4426 |
" |
|
4427 |
new: if there is a sourceCodeManager, ask it for the classes sourceCode |
|
4428 |
" |
|
4429 |
(mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[ |
|
4430 |
inStream := mgr getMostRecentSourceStreamForClassNamed:aClassName. |
|
4431 |
inStream notNil ifTrue:[ |
|
4432 |
fn := nil. |
|
4433 |
ok := self fileInStream:inStream lazy:loadLazy silent:beSilent logged:false addPath:nil. |
|
4434 |
] |
|
4435 |
]. |
|
4436 |
]. |
|
4437 |
]. |
|
4438 |
]. |
|
4439 |
] |
|
4440 |
] |
|
4441 |
]. |
|
4442 |
||
4443 |
ok ifTrue:[ |
|
4444 |
newClass := self at:(aClassName asSymbol). |
|
4445 |
newClass notNil ifTrue:[ |
|
4446 |
fn notNil ifTrue:[ |
|
4447 |
newClass classFilename isNil ifTrue:[ |
|
4448 |
newClass setClassFilename:fn |
|
4449 |
]. |
|
4450 |
]. |
|
4451 |
||
4452 |
doInit ifTrue:[ |
|
4453 |
newClass initialize |
|
4454 |
] |
|
4455 |
] |
|
4456 |
]. |
|
6421
58dca33cf0fc
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
6403
diff
changeset
|
4457 |
] ensure:[ |
7763 | 4458 |
Compiler compileLazy:wasLazy. |
4459 |
wasSilent notNil ifTrue:[ |
|
4460 |
self silentLoading:wasSilent |
|
4461 |
] |
|
3044 | 4462 |
]. |
4463 |
||
4464 |
^ newClass |
|
4465 |
||
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4466 |
"Created: / 9.1.1998 / 14:40:32 / cg" |
4277
74196836e8df
oops - care for module-prefix when filing in
Claus Gittinger <cg@exept.de>
parents:
4150
diff
changeset
|
4467 |
"Modified: / 5.6.1999 / 14:53:01 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4468 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4469 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4470 |
fileInClassLibrary:aClassLibraryName |
7758 | 4471 |
"find an object file containing a binary class library in some standard places |
4472 |
and load it. This install all of its contained classes. |
|
4712 | 4473 |
Return true if ok, false if not. |
4474 |
Notice: the argument may not have an extension (by purpose); |
|
7616 | 4475 |
the sharedLib extension (.dll / .so / .sl) is added here, to |
4476 |
make the caller independent of the underlying operatingSystem." |
|
4712 | 4477 |
|
4478 |
|path fn| |
|
3044 | 4479 |
|
4480 |
ObjectFileLoader isNil ifTrue:[^ false]. |
|
4712 | 4481 |
|
6837 | 4482 |
fn := aClassLibraryName asFilename withSuffix:(ObjectFileLoader sharedLibrarySuffix). |
6836 | 4483 |
fn := fn pathName. |
4712 | 4484 |
|
4485 |
path := self getBinaryFileName:fn. |
|
4486 |
path isNil ifTrue:[ |
|
7616 | 4487 |
path := self getSystemFileName:fn. |
4712 | 4488 |
]. |
4489 |
path isNil ifTrue:[^ false]. |
|
4490 |
||
4714 | 4491 |
^ (ObjectFileLoader loadObjectFile:path) notNil |
3044 | 4492 |
|
4493 |
" |
|
4494 |
Smalltalk fileInClassLibrary:'libtable' |
|
4495 |
Smalltalk fileInClassLibrary:'binary/libwidg3' |
|
4496 |
" |
|
4497 |
||
4498 |
"Modified: 8.1.1997 / 17:58:56 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4499 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4500 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4501 |
fileInClassLibrary:aClassLibraryName inPackage:packageID |
7758 | 4502 |
"find an object file containing a binary class library in some standard places |
4503 |
and load it. This install all of its contained classes. |
|
4504 |
Return true if ok, false if not. |
|
4505 |
Notice: the argument may not have an extension (by purpose); |
|
7616 | 4506 |
the sharedLib extension (.dll / .so / .sl) is added here, to |
4507 |
make the caller independent of the underlying operatingSystem." |
|
6025 | 4508 |
|
4509 |
|path fn| |
|
4510 |
||
4511 |
ObjectFileLoader isNil ifTrue:[^ false]. |
|
4512 |
||
6837 | 4513 |
fn := aClassLibraryName asFilename withSuffix:(ObjectFileLoader sharedLibrarySuffix). |
4514 |
fn := fn pathName. |
|
6025 | 4515 |
|
4516 |
path := self getPackageDirectoryForPackage:packageID. |
|
4517 |
path isNil ifTrue:[^ false]. |
|
4518 |
path := path asFilename construct:fn. |
|
4519 |
path exists ifFalse:[^ false]. |
|
4520 |
||
4521 |
^ (ObjectFileLoader loadObjectFile:path pathName) notNil |
|
4522 |
||
4523 |
" |
|
4524 |
Smalltalk fileInClassLibrary:'libtable' |
|
4525 |
Smalltalk fileInClassLibrary:'binary/libwidg3' |
|
4526 |
Smalltalk fileInClassLibrary:'refactoryBrowser' inPackage:'stx:goodies/refactoryBrowser' |
|
4527 |
" |
|
4528 |
||
4529 |
"Modified: 8.1.1997 / 17:58:56 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4530 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4531 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4532 |
fileInStream:streamArg |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4533 |
^ self fileInStream:streamArg lazy:nil silent:nil logged:false addPath:nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4534 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4535 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4536 |
fileInStream:streamArg lazy:lazy silent:silent logged:logged addPath:morePath |
7758 | 4537 |
"read sourceCode from aStream; |
4538 |
return true if ok, false if failed. |
|
4539 |
If lazy is true, no code is generated for methods, instead stubs |
|
4540 |
are created which compile themself when first executed. This allows |
|
4541 |
for much faster fileIn (but slows down the first execution later). |
|
4542 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
4543 |
code which is known to be syntactically correct. |
|
4544 |
If silent is true, no compiler messages are output to the transcript. |
|
4545 |
Giving nil for silent/lazy will use the current settings. |
|
4546 |
If morePath is nonNil, it is prepended to the systemPath temporarily during the |
|
4547 |
fileIn. This allows for st-expressions to refer to more files (i.e. fileIn more) |
|
4548 |
using a relative path." |
|
4549 |
||
8445
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4550 |
|inStream decoder wasLazy wasSilent oldSystemPath oldRealPath encoding| |
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4551 |
|
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4552 |
inStream := streamArg. |
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4553 |
inStream isNil ifTrue:[^ false]. |
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4554 |
|
8711
c5f28b4c719d
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
8695
diff
changeset
|
4555 |
encoding := CharacterEncoder guessEncodingOfStream:inStream. |
8445
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4556 |
encoding notNil ifTrue:[ |
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4557 |
decoder := CharacterEncoder encoderFor:encoding. |
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4558 |
inStream := EncodedStream stream:inStream encoder:decoder. |
8712
bcef3a0c0a1d
skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents:
8711
diff
changeset
|
4559 |
inStream skipEncodingChunk. |
8445
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4560 |
]. |
7758 | 4561 |
|
4562 |
lazy notNil ifTrue:[wasLazy := Compiler compileLazy:lazy]. |
|
4563 |
silent notNil ifTrue:[wasSilent := self silentLoading:silent]. |
|
8317
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4564 |
morePath notNil ifTrue:[ |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4565 |
oldSystemPath := SystemPath copy. |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4566 |
SystemPath addFirst:morePath. |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4567 |
oldRealPath := RealSystemPath. |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4568 |
RealSystemPath := nil. |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4569 |
]. |
617 | 4570 |
[ |
8695
8240c22db37b
Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents:
8675
diff
changeset
|
4571 |
(Class updateChangeFileQuerySignal , Class updateChangeListQuerySignal) answer:logged do:[ |
8240c22db37b
Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents:
8675
diff
changeset
|
4572 |
inStream fileIn. |
8317
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4573 |
] |
6421
58dca33cf0fc
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
6403
diff
changeset
|
4574 |
] ensure:[ |
8317
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4575 |
morePath notNil ifTrue:[ |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4576 |
"take care, someone could have changed SystemPath during fileIn!!" |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4577 |
(SystemPath copyFrom:2) = oldSystemPath ifTrue:[ |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4578 |
SystemPath := oldSystemPath. |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4579 |
RealSystemPath := oldRealPath. |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4580 |
] ifFalse:[ |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4581 |
(oldSystemPath includes:morePath) ifFalse:[ |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4582 |
SystemPath remove:morePath ifAbsent:[]. |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4583 |
]. |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4584 |
RealSystemPath := nil. |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4585 |
]. |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4586 |
]. |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4587 |
lazy notNil ifTrue:[Compiler compileLazy:wasLazy]. |
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4588 |
silent notNil ifTrue:[self silentLoading:wasSilent]. |
8445
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4589 |
inStream close |
617 | 4590 |
]. |
4591 |
^ true |
|
4592 |
||
4593 |
" |
|
4594 |
Smalltalk fileInStream:('source/TicTacToe.st' asFilename readStream) lazy:true silent:true |
|
4595 |
" |
|
1896 | 4596 |
|
4597 |
"Modified: 5.11.1996 / 20:03:35 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4598 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4599 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4600 |
isClassLibraryLoaded:name |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4601 |
"return true, if a particular class library is already loaded" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4602 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4603 |
ObjectMemory |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4604 |
binaryModuleInfo |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4605 |
do:[:entry | |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4606 |
entry type == #classLibrary ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4607 |
entry libraryName = name ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4608 |
^ true "/ already loaded |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4609 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4610 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4611 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4612 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4613 |
^ false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4614 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4615 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4616 |
Smalltalk isClassLibraryLoaded:'libbasic' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4617 |
Smalltalk isClassLibraryLoaded:'libwidg3' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4618 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4619 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4620 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4621 |
loadClassLibraryIfAbsent:name |
7758 | 4622 |
"dynamically load a classLibrary, if not already loaded |
4623 |
and the system supports dynamic loading. |
|
4624 |
Return true, if the library is loaded, false if not. |
|
4625 |
This entry is called without system specific filename |
|
3044 | 4626 |
extensions - it is portable among different architectures |
4627 |
as long as corresponding files (x.so / x.dll / x.sl / x.o) |
|
4628 |
are be present ..." |
|
4629 |
||
5881
81a349eab73c
added #isClassLibraryLoaded:
Claus Gittinger <cg@exept.de>
parents:
5878
diff
changeset
|
4630 |
(self isClassLibraryLoaded:name) ifTrue:[ ^ true ]. "/ already loaded |
3044 | 4631 |
^ self fileInClassLibrary:name |
4632 |
||
4633 |
" |
|
4634 |
Smalltalk loadClassLibraryIfAbsent:'libbasic' |
|
4635 |
Smalltalk loadClassLibraryIfAbsent:'libwidg3' |
|
4636 |
" |
|
4637 |
||
4638 |
"Modified: 31.10.1996 / 16:57:24 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4639 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4640 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4641 |
secureFileIn:aFileName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4642 |
"read in the named file, looking for it at standard places. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4643 |
Catch any error during fileIn. Return true if ok, false if failed" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4644 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4645 |
|retVal| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4646 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4647 |
retVal := false. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4648 |
(SignalSet with:AbortOperationRequest with:TerminateProcessRequest) |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4649 |
handle:[:ex | ex return ] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4650 |
do:[ retVal := self fileIn:aFileName ]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4651 |
^ retVal |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4652 |
! |
7758 | 4653 |
|
4654 |
silentFileIn:aFilename |
|
4655 |
"same as fileIn:, but do not output 'compiled...'-messages on Transcript. |
|
4656 |
Main use is during startup." |
|
4657 |
||
4658 |
|wasSilent| |
|
4659 |
||
4660 |
wasSilent := self silentLoading:true. |
|
4661 |
[ |
|
4662 |
self fileIn:aFilename |
|
4663 |
] ensure:[ |
|
4664 |
self silentLoading:wasSilent |
|
4665 |
] |
|
3044 | 4666 |
! ! |
4667 |
||
4668 |
!Smalltalk class methodsFor:'system management-files'! |
|
4669 |
||
7758 | 4670 |
bitmapFileStreamFor:aFileName |
4671 |
"search aFileName in some standard places; |
|
4672 |
return a readonly fileStream or nil if not found. |
|
4673 |
Searches in subdirectories named 'bitmaps' in the SystemPath. |
|
4674 |
Notice: this does not look in the package-specific bitmaps directories." |
|
4675 |
||
4676 |
|aString| |
|
4677 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4678 |
aString := self getBitmapFileName:aFileName. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4679 |
aString notNil ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4680 |
^ aString asFilename readStreamOrNil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4681 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4682 |
^ nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4683 |
! |
7758 | 4684 |
|
4685 |
bitmapFromFileNamed:aFileName forClass:aClass |
|
7563 | 4686 |
"search aFileName in some standard places: |
5089 | 4687 |
first in the redefinable bitmaps path, |
4688 |
then in the classes own package directory if existing. |
|
5040 | 4689 |
Return an image or nil." |
4690 |
||
5089 | 4691 |
^ self imageFromFileNamed:aFileName inPackage:(aClass package) |
5040 | 4692 |
|
4693 |
" |
|
4694 |
Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' forClass:View |
|
4695 |
" |
|
4696 |
! |
|
4697 |
||
7758 | 4698 |
bitmapFromFileNamed:aFileName inPackage:aPackage |
4699 |
"search aFileName in some standard places: |
|
4700 |
first in the redefinable bitmaps path, |
|
4701 |
then in the package directory if existing. |
|
4702 |
Return an image or nil." |
|
4703 |
||
4704 |
^ self imageFromFileNamed:aFileName inPackage:aPackage |
|
4705 |
||
4706 |
" |
|
4707 |
Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview' |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4708 |
Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4709 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4710 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4711 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4712 |
classNameForFile:aFileName |
7758 | 4713 |
"return the className which corresponds to an abbreviated fileName, |
4714 |
or nil if no special translation applies. The given filename arg may |
|
4715 |
include a '.st' suffix (but no other)." |
|
4716 |
||
4717 |
|fn| |
|
4718 |
||
4719 |
(aFileName asFilename hasSuffix:'st') ifTrue:[ |
|
7616 | 4720 |
fn := aFileName copyWithoutLast:3 |
3044 | 4721 |
] ifFalse:[ |
7616 | 4722 |
fn := aFileName |
3044 | 4723 |
]. |
4724 |
^ self filenameAbbreviations keyAtEqualValue:fn ifAbsent:[fn]. |
|
4725 |
||
4726 |
" |
|
4727 |
Smalltalk classNameForFile:'DrawObj' |
|
4728 |
Smalltalk classNameForFile:'DrawObj.st' |
|
4729 |
Smalltalk classNameForFile:'ArrColl.st' |
|
4730 |
Smalltalk classNameForFile:'ArrColl.chg' |
|
4731 |
" |
|
4732 |
||
4733 |
"Modified: 11.12.1995 / 14:51:10 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4734 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4735 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4736 |
constructPathFor:aDirectoryName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4737 |
"search for aDirectory in SystemPath; |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4738 |
return a collection of pathes which include that directory." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4739 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4740 |
^ self realSystemPath select:[:dirName | |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4741 |
|fullPath| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4742 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4743 |
fullPath := dirName asFilename construct:aDirectoryName. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4744 |
"/ fullPath exists and:[fullPath isDirectory and:[fullPath isReadable]] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4745 |
fullPath isDirectory and:[fullPath isReadable] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4746 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4747 |
! |
7758 | 4748 |
|
4749 |
fileInFileStreamFor:aFileName |
|
4750 |
"search aFileName in some standard places; |
|
4751 |
return a readonly fileStream or nil if not found. |
|
4752 |
Searches in subdirectories named 'fileIn' in SystemPath" |
|
4753 |
||
4754 |
|aString| |
|
4755 |
||
4756 |
aString := self getFileInFileName:aFileName. |
|
4757 |
aString notNil ifTrue:[ |
|
4758 |
^ aString asFilename readStreamOrNil |
|
4759 |
]. |
|
4760 |
^ nil |
|
4761 |
! |
|
4762 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4763 |
fileNameForClass:aClassOrClassName |
7758 | 4764 |
"return a filename for aClassOrClassName" |
4765 |
||
4766 |
|cls nm1 nm2| |
|
4767 |
||
4768 |
aClassOrClassName isBehavior ifTrue:[ |
|
8084
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4769 |
nm1 := aClassOrClassName theNonMetaclass name. |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4770 |
nm2 := aClassOrClassName theNonMetaclass nameWithoutPrefix. |
7758 | 4771 |
] ifFalse:[ |
8084
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4772 |
cls := Smalltalk classNamed:aClassOrClassName. |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4773 |
cls notNil ifTrue:[ |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4774 |
nm1 := cls theNonMetaclass name. |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4775 |
nm2 := cls theNonMetaclass nameWithoutPrefix. |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4776 |
] ifFalse:[ |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4777 |
nm1 := aClassOrClassName. |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4778 |
nm2 := (aClassOrClassName copyFrom:(aClassOrClassName lastIndexOf:$:)+1). |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4779 |
]. |
7758 | 4780 |
]. |
4781 |
nm1 := nm1 asSymbol. |
|
4782 |
nm2 := nm2 asSymbol. |
|
4783 |
||
4784 |
CachedAbbreviations notNil ifTrue:[ |
|
8084
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4785 |
(CachedAbbreviations includesKey:nm1) ifTrue:[ |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4786 |
^ CachedAbbreviations at:nm1 |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4787 |
]. |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4788 |
(CachedAbbreviations includesKey:nm2) ifTrue:[ |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4789 |
^ CachedAbbreviations at:nm2 |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4790 |
]. |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4791 |
]. |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4792 |
^ nm1 copyReplaceAll:$: with:$_ |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
4793 |
|
617 | 4794 |
" |
7723
ed4ce2184b37
Fix #filenameForClass: handling of abbreviations
Stefan Vogel <sv@exept.de>
parents:
7704
diff
changeset
|
4795 |
Smalltalk fileNameForClass:#Complex |
617 | 4796 |
Smalltalk fileNameForClass:'SmallInteger' |
3678 | 4797 |
Smalltalk fileNameForClass:'UnixOperatingSystem' |
4746 | 4798 |
Smalltalk fileNameForClass:'Launcher' |
617 | 4799 |
Smalltalk fileNameForClass:'SomeUnknownClass' |
4746 | 4800 |
Smalltalk fileNameForClass:OSI::FTAMOperation |
4801 |
Smalltalk fileNameForClass:'OSI::Foobar' |
|
617 | 4802 |
" |
4803 |
||
6151
e36a9b339582
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6121
diff
changeset
|
4804 |
"Modified: / 5.11.2001 / 16:49:17 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4805 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4806 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4807 |
filenameAbbreviations |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4808 |
"return a dictionary containing the classname-to-filename |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4809 |
mappings. (needed for sys5.3 users, where filenames are limited |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4810 |
to 14 chars)" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4811 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4812 |
CachedAbbreviations isNil ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4813 |
self readAbbreviations |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4814 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4815 |
^ CachedAbbreviations |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4816 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4817 |
"flush with: |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4818 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4819 |
CachedAbbreviations := nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4820 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4821 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4822 |
Smalltalk filenameAbbreviations |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4823 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4824 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4825 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4826 |
flushPathCaches |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4827 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4828 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4829 |
"forget pathCaches - these are collections containing valid directory names, |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4830 |
where system files (resource, bitmaps etc.) are found. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4831 |
A flush is only required, if a new system directory has been created while |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4832 |
the system is active, and those files should override the others |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4833 |
(for example, if you created a private resource directory)" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4834 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4835 |
RealSystemPath := ResourcePath := SourcePath := |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4836 |
BitmapPath := BinaryPath := FileInPath := nil |
2378 | 4837 |
|
4838 |
" |
|
4839 |
Smalltalk flushPathCaches |
|
4840 |
" |
|
617 | 4841 |
! |
4842 |
||
7758 | 4843 |
getBinaryFileName:aFileName |
4844 |
"search aFileName in some standard places |
|
4845 |
(subdirectories named 'binary' in SystemPath); |
|
4846 |
return the absolute filename or nil if none is found." |
|
4847 |
||
4848 |
BinaryPath isNil ifTrue:[ |
|
4849 |
BinaryPath := self constructPathFor:BinaryDirName |
|
617 | 4850 |
]. |
4851 |
||
2928 | 4852 |
^ self searchPath:BinaryPath for:aFileName in:BinaryDirName |
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
4853 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
4854 |
"Modified: 18.7.1996 / 15:53:49 / cg" |
453 | 4855 |
! |
4856 |
||
7758 | 4857 |
getBitmapFileName:aFileName |
4858 |
"search aFileName in some standard places |
|
4859 |
(subdirectories named 'bitmaps' in SystemPath); |
|
4860 |
return the absolute filename or nil if none is found." |
|
4861 |
||
4862 |
|f| |
|
4863 |
||
4864 |
BitmapPath isNil ifTrue:[ |
|
7616 | 4865 |
BitmapPath := self constructPathFor:BitmapDirName |
617 | 4866 |
]. |
4867 |
||
2974 | 4868 |
"/ first, try a bitmaps subdir along the path. |
4869 |
f := self searchPath:BitmapPath for:aFileName in:BitmapDirName. |
|
4870 |
f isNil ifTrue:[ |
|
7616 | 4871 |
"/ then, try it itself along the path. |
4872 |
f := self searchPath:self realSystemPath for:aFileName in:nil |
|
2974 | 4873 |
]. |
4874 |
^ f |
|
617 | 4875 |
|
4876 |
" |
|
4877 |
Smalltalk getBitmapFileName:'SBrowser.xbm' |
|
4878 |
" |
|
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
4879 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
4880 |
"Modified: 18.7.1996 / 15:53:55 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4881 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4882 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4883 |
getFileInFileName:aFileName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4884 |
"search aFileName in some standard places |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4885 |
(subdirectories named 'fileIn' in SystemPath); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4886 |
return the absolute filename or nil if none is found." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4887 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4888 |
FileInPath isNil ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4889 |
FileInPath := self constructPathFor:FileInDirName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4890 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4891 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4892 |
^ self searchPath:FileInPath for:aFileName in:FileInDirName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4893 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4894 |
"Modified: 18.7.1996 / 15:53:59 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4895 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4896 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4897 |
getPackageDirectoryForPackage:aPackageID |
7758 | 4898 |
"search for a particular package; return its directory, or nil" |
5550
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
4899 |
|
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
4900 |
|packageDir| |
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
4901 |
|
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
4902 |
packageDir := aPackageID copyReplaceAll:$: with:$/. |
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
4903 |
self packagePath do:[:aPath | |
7616 | 4904 |
|dir| |
4905 |
||
4906 |
dir := aPath asFilename construct:packageDir. |
|
4907 |
(dir exists and:[dir isDirectory]) ifTrue:[^ dir]. |
|
5550
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
4908 |
]. |
5785
872483483444
oops - getPackageDirectoryForPackage now cares for the case
Claus Gittinger <cg@exept.de>
parents:
5781
diff
changeset
|
4909 |
|
872483483444
oops - getPackageDirectoryForPackage now cares for the case
Claus Gittinger <cg@exept.de>
parents:
5781
diff
changeset
|
4910 |
"/ not found - special case for the stx package ... |
872483483444
oops - getPackageDirectoryForPackage now cares for the case
Claus Gittinger <cg@exept.de>
parents:
5781
diff
changeset
|
4911 |
(aPackageID upTo:$:) = 'stx' ifTrue:[ |
7616 | 4912 |
packageDir := aPackageID copyFrom:(aPackageID indexOf:$:) + 1. |
4913 |
packageDir := '../../' , packageDir. |
|
4914 |
packageDir := packageDir asFilename. |
|
4915 |
(packageDir exists and:[packageDir isDirectory]) ifTrue:[^ packageDir]. |
|
5785
872483483444
oops - getPackageDirectoryForPackage now cares for the case
Claus Gittinger <cg@exept.de>
parents:
5781
diff
changeset
|
4916 |
]. |
5550
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
4917 |
^ nil |
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
4918 |
|
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
4919 |
" |
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
4920 |
Smalltalk getPackageDirectoryForPackage:(Array package) |
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
4921 |
Smalltalk getPackageDirectoryForPackage:'stx:goodies/bitmaps' |
5785
872483483444
oops - getPackageDirectoryForPackage now cares for the case
Claus Gittinger <cg@exept.de>
parents:
5781
diff
changeset
|
4922 |
Smalltalk getPackageDirectoryForPackage:'stx:libview' |
5550
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
4923 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4924 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4925 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4926 |
getPackageFileName:aFileName |
7758 | 4927 |
"search aFileName in some standard places |
4928 |
(packagePath and subdirectories named 'packages' in SystemPath); |
|
4929 |
return the absolute filename or nil if none is found." |
|
4930 |
||
4931 |
|f| |
|
5038
d74e7c71ae75
added package directory handling
Claus Gittinger <cg@exept.de>
parents:
5037
diff
changeset
|
4932 |
|
5051
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
4933 |
"/ search along packagePath ... |
5052 | 4934 |
f := self searchPath:self packagePath for:aFileName in:nil. |
5051
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
4935 |
f isNil ifTrue:[ |
7616 | 4936 |
"/ search under packages-directory along systemPath ... |
4937 |
f := self searchPath:self realSystemPath for:aFileName in:PackageDirName. |
|
4938 |
"/ kludge - allow for stx-directory to be named differently |
|
4939 |
f isNil ifTrue:[ |
|
4940 |
(aFileName startsWith:'stx') ifTrue:[ |
|
4941 |
(aFileName startsWith:'stx' , Filename separator) ifTrue:[ |
|
4942 |
f := '../..' asFilename construct:(aFileName copyFrom:5). |
|
4943 |
f exists ifTrue:[ |
|
4944 |
^ f pathName |
|
4945 |
]. |
|
4946 |
] |
|
4947 |
]. |
|
4948 |
]. |
|
5051
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
4949 |
]. |
5878
b89d789e1705
always return a string from #getPackageFileName
Claus Gittinger <cg@exept.de>
parents:
5860
diff
changeset
|
4950 |
(f notNil and:[(f := f asFilename) exists]) ifTrue:[ |
7616 | 4951 |
^ f pathName |
5878
b89d789e1705
always return a string from #getPackageFileName
Claus Gittinger <cg@exept.de>
parents:
5860
diff
changeset
|
4952 |
]. |
b89d789e1705
always return a string from #getPackageFileName
Claus Gittinger <cg@exept.de>
parents:
5860
diff
changeset
|
4953 |
^ nil |
5038
d74e7c71ae75
added package directory handling
Claus Gittinger <cg@exept.de>
parents:
5037
diff
changeset
|
4954 |
|
d74e7c71ae75
added package directory handling
Claus Gittinger <cg@exept.de>
parents:
5037
diff
changeset
|
4955 |
" |
5051
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
4956 |
Smalltalk getPackageFileName:'stx/libview/resources/normal.style' |
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
4957 |
Smalltalk getPackageFileName:'stx/libview/source.zip' |
5038
d74e7c71ae75
added package directory handling
Claus Gittinger <cg@exept.de>
parents:
5037
diff
changeset
|
4958 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4959 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4960 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4961 |
getResourceFileName:aFileName |
7758 | 4962 |
"search aFileName in some standard places |
8945 | 4963 |
(subdirectories named 'resources' in SystemPath); |
7758 | 4964 |
return the absolute filename or nil if none is found." |
4965 |
||
4966 |
|f| |
|
4967 |
||
4968 |
ResourcePath isNil ifTrue:[ |
|
8945 | 4969 |
ResourcePath := self constructPathFor:ResourceDirName |
7758 | 4970 |
]. |
4971 |
||
4972 |
"/ first, try a resource subdir along the path. |
|
4973 |
f := self searchPath:ResourcePath for:aFileName in:ResourceDirName. |
|
2974 | 4974 |
f isNil ifTrue:[ |
8945 | 4975 |
"/ then, try it itself along the path. |
4976 |
f := self searchPath:self realSystemPath for:aFileName in:nil |
|
2974 | 4977 |
]. |
4978 |
^ f |
|
617 | 4979 |
|
4980 |
" |
|
5038
d74e7c71ae75
added package directory handling
Claus Gittinger <cg@exept.de>
parents:
5037
diff
changeset
|
4981 |
Smalltalk getResourceFileName:'SystemBrowser.rs' |
617 | 4982 |
" |
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
4983 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
4984 |
"Modified: 18.7.1996 / 15:54:03 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4985 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4986 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4987 |
getResourceFileName:aFileName forClass:aClassOrNil |
8570 | 4988 |
"search aFileName in some standard places |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4989 |
(subdirectories named 'resource' in SystemPath); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4990 |
and in aClasses package directory. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4991 |
Return the absolute filename or nil if none is found." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4992 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4993 |
|pkgOrNil| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4994 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4995 |
aClassOrNil notNil ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4996 |
pkgOrNil := aClassOrNil package. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4997 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4998 |
^ self getResourceFileName:aFileName forPackage:pkgOrNil. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4999 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5000 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5001 |
Smalltalk getResourceFileName:'SystemBrowser.rs' forClass:SystemBrowser |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5002 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5003 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5004 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5005 |
getResourceFileName:aFileName forPackage:aPackageIDOrNil |
7758 | 5006 |
"search aFileName in some standard places |
5007 |
(subdirectories named 'resource' in SystemPath); |
|
5008 |
and in a packages directory. |
|
5009 |
Return the absolute filename or nil if none is found." |
|
5010 |
||
5011 |
|f dir packageDir| |
|
5012 |
||
5013 |
f := self getResourceFileName:aFileName. |
|
5014 |
f notNil ifTrue:[^ f]. |
|
5015 |
||
8945 | 5016 |
aPackageIDOrNil isNil ifTrue:[ ^ nil]. |
5017 |
||
5018 |
packageDir := aPackageIDOrNil copyReplaceAll:$: with:$/. |
|
5019 |
self packagePath do:[:aPath | |
|
5020 |
|pD| |
|
5021 |
||
5022 |
pD := aPath asFilename construct:packageDir. |
|
5023 |
pD exists ifTrue:[ |
|
5024 |
f := pD construct:aFileName. |
|
5025 |
f exists ifTrue:[ |
|
5026 |
^ f pathName |
|
5027 |
]. |
|
5028 |
f := (pD construct:'resources') construct:aFileName. |
|
5029 |
f exists ifTrue:[ |
|
5030 |
^ f pathName |
|
5031 |
]. |
|
5032 |
]. |
|
5033 |
]. |
|
5034 |
||
5035 |
dir := Smalltalk getPackageDirectoryForPackage:(aPackageIDOrNil ? 'stx:libview'). |
|
5036 |
dir notNil ifTrue:[ |
|
5037 |
f := (dir asFilename construct:'resources') construct:aFileName. |
|
5038 |
f exists ifTrue:[ |
|
5039 |
^ f pathName |
|
5040 |
]. |
|
5041 |
f := (dir asFilename construct:'styles') construct:aFileName. |
|
5042 |
f exists ifTrue:[ |
|
5043 |
^ f pathName |
|
5044 |
]. |
|
5045 |
]. |
|
5046 |
||
8951 | 5047 |
^ self searchPath:ResourcePath for:aFileName in:('resources/',packageDir). |
5043 | 5048 |
|
5049 |
" |
|
5065 | 5050 |
Smalltalk getResourceFileName:'SystemBrowser.rs' forPackage:'stx:libtool' |
5080 | 5051 |
Smalltalk getResourceFileName:'normal.style' forPackage:'stx:libview' |
8945 | 5052 |
Smalltalk getResourceFileName:'Foo.rs' forPackage:'stx:libview' |
5043 | 5053 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5054 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5055 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5056 |
getSourceFileName:aFileName |
7563 | 5057 |
"search aFileName in some standard places |
5058 |
(subdirectories named 'source' in SystemPath); |
|
736 | 5059 |
return the absolute filename or nil if none is found. |
5060 |
This is used to find a sourceFile for a methods source, |
|
5061 |
if no sourceCodeManager is available." |
|
617 | 5062 |
|
2959 | 5063 |
|f| |
5064 |
||
617 | 5065 |
SourcePath isNil ifTrue:[ |
7616 | 5066 |
SourcePath := self constructPathFor:SourceDirName |
617 | 5067 |
]. |
5068 |
||
2959 | 5069 |
"/ first, try a source subdir along the path. |
4770 | 5070 |
SourcePath notNil ifTrue:[ |
7616 | 5071 |
f := self searchPath:SourcePath for:aFileName in:SourceDirName. |
4770 | 5072 |
]. |
2959 | 5073 |
f isNil ifTrue:[ |
7616 | 5074 |
"/ then, try it itself along the path. |
5075 |
f := self searchPath:self realSystemPath for:aFileName in:nil |
|
2959 | 5076 |
]. |
5077 |
^ f |
|
191 | 5078 |
|
5079 |
" |
|
736 | 5080 |
Smalltalk getSourceFileName:'Smalltalk.st' |
5081 |
Smalltalk getSourceFileName:'ArrColl.st' |
|
191 | 5082 |
" |
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
5083 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
5084 |
"Modified: 18.7.1996 / 15:54:07 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5085 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5086 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5087 |
getSystemFileName:aFileNameOrString |
7758 | 5088 |
"search aFileNameOrString in some standard places; |
5089 |
return the absolute filename or nil if none is found. |
|
5090 |
see comment in Smalltalk>>initSystemPath. |
|
5091 |
This should be used to access resources such as bitmaps, doc-files, |
|
5092 |
and other help files. |
|
5093 |
" |
|
5094 |
||
5095 |
"credits for this method go to Markus ...." |
|
5096 |
||
5097 |
|fn nameString| |
|
5098 |
||
5099 |
fn := aFileNameOrString asFilename. |
|
2933 | 5100 |
nameString := fn name. |
2896 | 5101 |
fn isAbsolute ifTrue:[ |
7616 | 5102 |
"dont use path for absolute file names" |
5103 |
||
5104 |
^ nameString |
|
191 | 5105 |
]. |
5106 |
||
617 | 5107 |
self realSystemPath do:[:dirName | |
7616 | 5108 |
|realName| |
5109 |
||
5110 |
realName := dirName asFilename construct:nameString. |
|
5111 |
"/ |
|
5112 |
"/ here, we also return true if its a directory |
|
5113 |
"/ (Even if unreadable). |
|
5114 |
"/ It could be that the file itself is still readable. |
|
5115 |
"/ |
|
5116 |
(realName isDirectory or:[realName isReadable]) ifTrue: [ |
|
5117 |
^ realName name |
|
5118 |
] |
|
191 | 5119 |
]. |
617 | 5120 |
^ nil |
4150 | 5121 |
|
5122 |
" |
|
5123 |
Smalltalk getSystemFileName:'doc/online/english/TOP.html' |
|
5124 |
Smalltalk getSystemFileName:'bitmaps/SBrowser.xbm' |
|
5125 |
Smalltalk getSystemFileName:'bitmaps/foo' |
|
5126 |
Smalltalk getSystemFileName:'resources/View.rs' |
|
5127 |
Smalltalk getSystemFileName:'resources/iris.style' |
|
5128 |
" |
|
5129 |
||
5130 |
"Modified: / 6.5.1999 / 10:40:37 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5131 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5132 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5133 |
imageFromFileNamed:aFileName forClass:aClass |
7758 | 5134 |
"search aFileName in some standard places: |
5135 |
first in the redefinable bitmaps path, then in the classes |
|
5136 |
own package directory if existing. |
|
5089 | 5137 |
Return an image or nil." |
5138 |
||
5113 | 5139 |
|package nm img| |
5140 |
||
5141 |
package := aClass package. |
|
5142 |
img := self imageFromFileNamed:aFileName inPackage:package. |
|
5143 |
img isNil ifTrue:[ |
|
7616 | 5144 |
package ~= 'stx:goodies' ifTrue:[ |
5145 |
"/ try under the goodies package ... |
|
5146 |
img := Smalltalk imageFromFileNamed:aFileName inPackage:'stx:goodies'. |
|
5147 |
]. |
|
5148 |
img isNil ifTrue:[ |
|
5149 |
(aFileName startsWith:'bitmaps') ifFalse:[ |
|
5150 |
nm := 'bitmaps/' , aFileName. |
|
5151 |
img := Smalltalk imageFromFileNamed:nm forClass:self. |
|
5152 |
img isNil ifTrue:[ |
|
5153 |
img := Smalltalk imageFromFileNamed:nm inPackage:'stx:goodies'. |
|
5154 |
] |
|
5155 |
]. |
|
5156 |
||
5157 |
img isNil ifTrue:[ |
|
5158 |
img := Smalltalk imageFromFileNamed:aFileName inPackage:'stx:goodies'. |
|
5159 |
]. |
|
5160 |
] |
|
5113 | 5161 |
]. |
5162 |
^ img |
|
5089 | 5163 |
|
5164 |
" |
|
5165 |
Smalltalk imageFromFileNamed:'SmalltalkX.xbm' forClass:View |
|
5166 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5167 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5168 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5169 |
imageFromFileNamed:aFileName inPackage:aPackage |
7758 | 5170 |
"search aFileName in some standard places: |
5171 |
first in the redefinable bitmaps path, then in the |
|
5172 |
package directory if existing. |
|
5089 | 5173 |
Return an image or nil." |
5174 |
||
5175 |
|i f dir| |
|
5176 |
||
5177 |
i := Image fromFile:aFileName resolution:100. |
|
5860 | 5178 |
i notNil ifTrue:[^ i]. |
5179 |
||
5180 |
f := self getBitmapFileName:aFileName. |
|
5181 |
f notNil ifTrue:[ |
|
7616 | 5182 |
i := Image fromFile:f. |
5183 |
i notNil ifTrue:[^ i]. |
|
5860 | 5184 |
]. |
5185 |
dir := self projectDirectoryForPackage:aPackage. |
|
5186 |
dir isNil ifTrue:[^ nil]. |
|
5187 |
||
5188 |
((f := aFileName) startsWith:'bitmaps/') ifFalse:[ |
|
7616 | 5189 |
i := Image fromFile:(dir asFilename construct:f). |
5190 |
i notNil ifTrue:[^ i]. |
|
5860 | 5191 |
|
7616 | 5192 |
f := 'bitmaps/' , aFileName. |
5860 | 5193 |
]. |
5194 |
^ Image fromFile:(dir asFilename construct:f). |
|
5089 | 5195 |
|
5196 |
" |
|
5587
4c4d67ad0e51
avoid obsoleteMessage warning (Filename ,)
Claus Gittinger <cg@exept.de>
parents:
5580
diff
changeset
|
5197 |
Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview' |
4c4d67ad0e51
avoid obsoleteMessage warning (Filename ,)
Claus Gittinger <cg@exept.de>
parents:
5580
diff
changeset
|
5198 |
Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool' |
4c4d67ad0e51
avoid obsoleteMessage warning (Filename ,)
Claus Gittinger <cg@exept.de>
parents:
5580
diff
changeset
|
5199 |
Smalltalk imageFromFileNamed:'bitmaps/gifImages/garfield.gif' inPackage:'stx:goodies' |
5089 | 5200 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5201 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5202 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5203 |
libraryFileNameOfClass:aClassOrClassName |
7758 | 5204 |
"for a given class, return the name of a classLibrary which contains |
5205 |
binary code for it. |
|
5206 |
Read the libinfo file 'liblist.stc' (which is created during the compilation process) |
|
5207 |
for an entry for aClassOrClassName. |
|
5208 |
Search for the className in the first col, and return the value found in |
|
5209 |
the 2nd col. |
|
5210 |
Return nil if no entry is found. |
|
5211 |
||
5212 |
A nil returns means that this class is either built-in or not present |
|
5213 |
in a package-class library (i.e. either as separate .o or separate .st file). |
|
5214 |
Otherwise, the returned name is the classLibrary object of that class. |
|
5215 |
The classes code can be loaded from that file if binary loading is supported." |
|
5216 |
||
5217 |
|aStream line words n aClassName| |
|
5218 |
||
5219 |
aClassOrClassName isBehavior ifTrue:[ |
|
5220 |
aClassName := aClassOrClassName name |
|
5221 |
] ifFalse:[ |
|
5222 |
aClassName := aClassOrClassName |
|
617 | 5223 |
]. |
5224 |
aClassName := aClassName asString. |
|
5225 |
||
5226 |
#('include/liblist.stc') "/ filenames |
|
5227 |
with:#(2) "/ column |
|
5228 |
do:[:fileName :col | |
|
5229 |
||
7616 | 5230 |
aStream := self systemFileStreamFor:fileName. |
5231 |
aStream notNil ifTrue:[ |
|
5232 |
[aStream atEnd] whileFalse:[ |
|
5233 |
line := aStream nextLine. |
|
5234 |
line notNil ifTrue:[ |
|
5235 |
(line startsWith:'#') ifFalse:[ |
|
5236 |
words := line asCollectionOfWords. |
|
5237 |
(n := words size) > 1 ifTrue:[ |
|
5238 |
(words at:1) = aClassName ifTrue:[ |
|
5239 |
n >= col ifTrue:[ |
|
5240 |
aStream close. |
|
5241 |
^ (words at:col) withoutSeparators |
|
5242 |
] |
|
5243 |
] |
|
5244 |
] |
|
5245 |
] |
|
5246 |
] |
|
5247 |
]. |
|
5248 |
aStream close |
|
5249 |
]. |
|
617 | 5250 |
]. |
5251 |
||
5252 |
^ nil |
|
5253 |
||
5254 |
" |
|
5255 |
Smalltalk libraryFileNameOfClass:'ClockView' |
|
5256 |
Smalltalk libraryFileNameOfClass:'Bag' |
|
5257 |
" |
|
5258 |
||
5259 |
"Modified: 6.11.1995 / 15:41:39 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5260 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5261 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5262 |
packagePath |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5263 |
"return a collection of additional directorynames, where smalltalk |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5264 |
looks for package directories. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5265 |
Notice, that directories named 'packages' under the systemPath are |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5266 |
always consulted - even if not in the packagePath" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5267 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5268 |
^ PackagePath |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5269 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5270 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5271 |
Smalltalk packagePath |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5272 |
Smalltalk packagePath addLast:'/opt/smalltalk' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5273 |
Smalltalk packagePath addFirst:'/usr/local/otherPackages' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5274 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5275 |
! |
5051
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
5276 |
|
7758 | 5277 |
packagePath:aPath |
5278 |
"set the packagePath; |
|
5279 |
a collection of additional directorynames, where smalltalk |
|
5280 |
looks for package directories. |
|
5281 |
Notice, that directories named 'packages' under the systemPath are |
|
5282 |
always consulted - even if not in the packagePath" |
|
5283 |
||
5284 |
PackagePath := aPath asOrderedCollection |
|
5285 |
||
5286 |
" |
|
5287 |
Smalltalk packagePath:#( '.' '/opt/stx' '/opt/smalltalk' '/usr/local/otherPackages') |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5288 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5289 |
! |
7758 | 5290 |
|
5291 |
projectDirectoryForClass:aClass |
|
5292 |
"given a class, return the path to its package directory; |
|
5293 |
nil if not found." |
|
5294 |
||
5295 |
|pkg| |
|
5296 |
||
5297 |
pkg := aClass package. |
|
5298 |
pkg isNil ifTrue:[^ nil]. |
|
5038
d74e7c71ae75
added package directory handling
Claus Gittinger <cg@exept.de>
parents:
5037
diff
changeset
|
5299 |
|
5040 | 5300 |
^ self projectDirectoryForPackage:pkg. |
5301 |
||
5302 |
" |
|
5303 |
Smalltalk projectDirectoryForClass:Array |
|
5304 |
Smalltalk projectDirectoryForClass:View |
|
5305 |
" |
|
5306 |
! |
|
5307 |
||
7758 | 5308 |
projectDirectoryForPackage:aPackage |
5309 |
"given a packageID, return the path to its package directory; |
|
5310 |
nil if not found." |
|
5311 |
||
5312 |
|prj prjDir| |
|
5313 |
||
5314 |
"/ there might be a package specific resource directory ... |
|
5315 |
"/ in the directory, from which the project was loaded |
|
5316 |
prj := Project projectWithId:aPackage. |
|
5317 |
prj notNil ifTrue:[ |
|
5318 |
prjDir := prj directory. |
|
5319 |
]. |
|
5320 |
(prjDir notNil and:[prjDir asFilename exists]) ifFalse:[ |
|
5321 |
prjDir := Smalltalk getPackageFileName:(aPackage copyReplaceAll:$: with:$/). |
|
5322 |
]. |
|
5323 |
^ prjDir |
|
5324 |
||
5325 |
" |
|
5326 |
Smalltalk projectDirectoryForPackage:'stx:libbasic' |
|
5327 |
Smalltalk projectDirectoryForPackage:'exept:smartcard' |
|
5328 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5329 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5330 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5331 |
readAbbreviations |
7758 | 5332 |
"read classname to filename mappings from include/abbrev.stc. |
5333 |
sigh - all for those poor sys5.3 or MSDOS people with short filenames ..." |
|
5334 |
||
5335 |
"since installAutoloadedClasses also reads all abbreviations, use it" |
|
5336 |
||
5337 |
CachedAbbreviations := IdentityDictionary new. |
|
5338 |
self installAutoloadedClasses. |
|
5339 |
^ CachedAbbreviations. |
|
5340 |
||
5341 |
"/ |aStream f dirsConsulted| |
|
5342 |
"/ |
|
5343 |
"/ CachedAbbreviations := IdentityDictionary new. |
|
5344 |
"/ |
|
5345 |
"/ "/ new scheme: look for a directory called 'packages' |
|
5346 |
"/ "/ and enumerate its abbrev.stc files... |
|
5347 |
"/ dirsConsulted := Set new. |
|
5348 |
"/ f := Smalltalk getSystemFileName:'packages'. |
|
5349 |
"/ f notNil ifTrue:[ |
|
5350 |
"/ f := f asFilename. |
|
5351 |
"/ f isDirectory ifTrue:[ |
|
5352 |
"/ ('Smalltalk [info]: reading all class abbreviations found under ''' , f pathName ,'''') infoPrintCR. |
|
5353 |
"/ self recursiveReadAllAbbreviationsFrom:f. |
|
5354 |
"/ dirsConsulted add:f pathName. |
|
5355 |
"/ ]. |
|
5356 |
"/ ]. |
|
5357 |
"/ |
|
5358 |
"/ "/ and along the package-path |
|
5359 |
"/ self packagePath do:[:aPath | |
|
5360 |
"/ (dirsConsulted includes:aPath) ifFalse:[ |
|
5361 |
"/ ('Smalltalk [info]: reading all class abbreviations found under ''' , aPath ,'''') infoPrintCR. |
|
7613 | 5362 |
"/ self recursiveReadAllAbbreviationsFrom:aPath. |
5363 |
"/ dirsConsulted add:aPath |
|
5364 |
"/ ] |
|
5365 |
"/ ]. |
|
5366 |
"/ |
|
5367 |
"/ "/ old scheme: look for a single file called 'abbrev.stc' in the |
|
5368 |
"/ "/ include directory. This will vanish. |
|
5369 |
"/ |
|
5370 |
"/ aStream := self systemFileStreamFor:'include/abbrev.stc'. |
|
5371 |
"/ aStream notNil ifTrue:[ |
|
5372 |
"/ ('Smalltalk [info]: reading additional abbreviations from ''' , aStream pathName ,'''') infoPrintCR. |
|
5373 |
"/ self readAbbreviationsFromStream:aStream. |
|
5374 |
"/ aStream close. |
|
5375 |
"/"/ ] ifFalse:[ |
|
5376 |
"/"/ ('Smalltalk [warning]: no global''include/abbrev.stc'' file found') infoPrintCR |
|
5377 |
"/ ]. |
|
5378 |
"/ ^ CachedAbbreviations |
|
191 | 5379 |
|
5380 |
" |
|
617 | 5381 |
Smalltalk readAbbreviations |
191 | 5382 |
" |
617 | 5383 |
|
5091 | 5384 |
"Modified: / 10.12.1999 / 17:48:53 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5385 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5386 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5387 |
readAbbreviationsFromStream:aStream |
7758 | 5388 |
"read classname to filename mappings from aStream. |
5389 |
sigh - all for those poor sys5.3 or MSDOS people with short filenames ..." |
|
5390 |
||
8470
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5391 |
|line words nm abbrev pkg s w| |
7758 | 5392 |
|
5393 |
[aStream atEnd] whileFalse:[ |
|
8470
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5394 |
line := aStream nextLine. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5395 |
line notNil ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5396 |
(line startsWith:'#') ifFalse:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5397 |
|
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5398 |
"/ must do it manually, caring for quoted strings. |
7758 | 5399 |
"/ words := line asCollectionOfWords. |
5400 |
||
8470
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5401 |
words := OrderedCollection new. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5402 |
s := line readStream. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5403 |
[s atEnd] whileFalse:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5404 |
s skipSeparators. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5405 |
s peek == $' ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5406 |
s next. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5407 |
w := s upTo:$'. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5408 |
s skipSeparators. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5409 |
] ifFalse:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5410 |
w := s upToSeparator |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5411 |
]. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5412 |
words add:w |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5413 |
]. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5414 |
words size >= 3 ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5415 |
nm := (words at:1) withoutSeparators. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5416 |
abbrev := (words at:2) withoutSeparators. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5417 |
pkg := (words at:3) withoutSeparators. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5418 |
self setFilename:abbrev forClass:nm package:pkg. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5419 |
] ifFalse:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5420 |
('Smalltalk [warning]: malformed line in ' , (aStream pathName)) infoPrintCR. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5421 |
] |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5422 |
] |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5423 |
] |
4420 | 5424 |
]. |
5091 | 5425 |
|
5095
9bbf3cf594e5
no warning for same-abbrev, if packages differ.
Claus Gittinger <cg@exept.de>
parents:
5093
diff
changeset
|
5426 |
"Modified: / 13.12.1999 / 11:54:17 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5427 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5428 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5429 |
realSystemPath |
7758 | 5430 |
"return the realSystemPath - thats the directorynames from |
5431 |
SystemPath which exist and are readable" |
|
5432 |
||
5433 |
|nP| |
|
5434 |
||
5435 |
RealSystemPath isNil ifTrue:[ |
|
5436 |
OperatingSystem isVMSlike ifTrue:[ |
|
5437 |
"/ temporary kludge: since we cannot currently |
|
7616 | 5438 |
"/ check for existance of a name like 'volume:', |
5439 |
"/ leave those in the Path without a check. |
|
5440 |
RealSystemPath := SystemPath select:[:dirName | |
|
5441 |
|f| |
|
5442 |
||
5443 |
f := dirName asFilename. |
|
5444 |
f isVolumeOnly ifTrue:[ |
|
5445 |
true |
|
5446 |
] ifFalse:[ |
|
5447 |
(f isDirectory) and:[f isReadable] |
|
5448 |
] |
|
5449 |
] |
|
5450 |
] ifFalse:[ |
|
5451 |
RealSystemPath := SystemPath select:[:dirName | |
|
5452 |
|f| |
|
5453 |
||
5454 |
f := dirName asFilename. |
|
5455 |
(f isDirectory) and:[f isReadable] |
|
5456 |
]. |
|
5457 |
RealSystemPath := RealSystemPath collect:[:dirName | |
|
5458 |
|f| |
|
5459 |
||
5460 |
f := dirName asFilename pathName. |
|
5461 |
]. |
|
5462 |
"/ remove duplicates (but keep order) |
|
5463 |
nP := OrderedCollection new. |
|
5464 |
RealSystemPath do:[:p | |
|
5465 |
(nP includes:p) ifFalse:[ |
|
5466 |
nP add:p |
|
5467 |
] |
|
5468 |
]. |
|
5469 |
RealSystemPath := nP. |
|
5470 |
]. |
|
617 | 5471 |
]. |
5472 |
^ RealSystemPath |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5473 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5474 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5475 |
recursiveReadAllAbbreviationsFrom:aDirectory |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5476 |
self recursiveReadAllAbbreviationsFrom:aDirectory maxLevels:15 |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5477 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5478 |
|
7758 | 5479 |
recursiveReadAllAbbreviationsFrom:aDirectory maxLevels:maxLevels |
5480 |
"read all abbreviations from and under aDirectory." |
|
5481 |
||
5482 |
|abbrevStream dir directoryContents| |
|
5483 |
||
5484 |
maxLevels == 0 ifTrue:[ |
|
5485 |
"/ 'Smalltalk [warning]: max directory nesting reached.' infoPrintCR. |
|
7616 | 5486 |
^ self |
5075 | 5487 |
]. |
4957 | 5488 |
|
4458 | 5489 |
dir := aDirectory asFilename. |
5057 | 5490 |
dir exists ifFalse:[^ self]. |
4458 | 5491 |
|
7085
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
5492 |
[ |
7616 | 5493 |
abbrevStream := (dir construct:'abbrev.stc') asFilename readStream. |
5494 |
self readAbbreviationsFromStream:abbrevStream. |
|
5495 |
abbrevStream close. |
|
7085
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
5496 |
] on:FileStream openErrorSignal do:[:ex| "ignore this file"]. |
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
5497 |
|
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
5498 |
[ |
7616 | 5499 |
directoryContents := dir directoryContents. |
7085
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
5500 |
] on:FileStream openErrorSignal do:[:ex| |
7616 | 5501 |
"non-accessable directory: we are done" |
5502 |
^ self |
|
7085
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
5503 |
]. |
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
5504 |
|
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
5505 |
directoryContents do:[:aFilename | |
7616 | 5506 |
|f| |
5507 |
||
5508 |
(#( |
|
5509 |
'doc' |
|
5510 |
'CVS' |
|
5511 |
'bitmaps' |
|
5512 |
'resources' |
|
5513 |
'source' |
|
5514 |
) includes:aFilename) ifFalse:[ |
|
5515 |
f := dir construct:aFilename. |
|
5516 |
f isDirectory ifTrue:[ |
|
5517 |
self recursiveReadAllAbbreviationsFrom:f maxLevels:maxLevels-1 |
|
5518 |
] |
|
5519 |
]. |
|
4458 | 5520 |
]. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5521 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5522 |
|
8952 | 5523 |
resourceDirectoryForPackage:aPackage |
5524 |
"given a packageID, return the path to its resource directory; |
|
5525 |
nil if not found." |
|
5526 |
||
5527 |
|prjDir rsrcDir| |
|
5528 |
||
5529 |
prjDir := self projectDirectoryForPackage:aPackage. |
|
5530 |
||
5531 |
(prjDir notNil |
|
5532 |
and:[(prjDir := prjDir asFilename) exists |
|
5533 |
and:[(rsrcDir := prjDir construct:'resources') exists]]) ifTrue:[ |
|
5534 |
^ rsrcDir |
|
5535 |
]. |
|
8953 | 5536 |
rsrcDir := self getSystemFileName:('resources/' , (aPackage copyReplaceAll:$: with:$/)). |
5537 |
rsrcDir notNil ifTrue:[ |
|
5538 |
^ rsrcDir asFilename |
|
5539 |
]. |
|
5540 |
^ nil |
|
8952 | 5541 |
|
5542 |
" |
|
5543 |
Smalltalk resourceDirectoryForPackage:'stx:libbasic' |
|
5544 |
Smalltalk resourceDirectoryForPackage:'exept:expecco' |
|
5545 |
Smalltalk resourceDirectoryForPackage:'exept:smartcard' |
|
5546 |
" |
|
5547 |
! |
|
5548 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5549 |
resourceFileStreamFor:aFileName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5550 |
"search aFileName in some standard places; |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5551 |
return a readonly fileStream or nil if not found. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5552 |
Searches in subdirectories named 'resource' in SystemPath" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5553 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5554 |
^ self resourceFileStreamFor:aFileName forClass:nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5555 |
! |
7758 | 5556 |
|
5557 |
resourceFileStreamFor:aFileName forClass:aClassOrNil |
|
5558 |
"search aFileName in some standard places and in the classes |
|
5559 |
package-resource directory. |
|
5560 |
Return a readonly fileStream or nil if not found. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5561 |
Searches in subdirectories named 'resource' in SystemPath" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5562 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5563 |
|aString| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5564 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5565 |
aString := self getResourceFileName:aFileName forClass:aClassOrNil. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5566 |
aString notNil ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5567 |
^ aString asFilename readStreamOrNil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5568 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5569 |
^ nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5570 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5571 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5572 |
searchPath:aPath for:aFileName in:aDirName |
7758 | 5573 |
"search aPath for a subdirectory named aDirectory with a file |
5574 |
named aFileName" |
|
5575 |
||
5576 |
|f| |
|
5577 |
||
5578 |
((f := aFileName asFilename) isAbsolute |
|
5579 |
or:[f isExplicitRelative]) ifTrue:[ |
|
5580 |
"/ |
|
5581 |
"/ dont use path for absolute or explicit .-relative file names |
|
5582 |
"/ |
|
5583 |
^ aFileName |
|
5584 |
]. |
|
5585 |
||
5586 |
aPath notNil ifTrue:[ |
|
5587 |
aPath do:[:dirName | |
|
5588 |
|realName dir| |
|
5589 |
||
5590 |
dir := dirName asFilename. |
|
5591 |
aDirName notNil ifTrue:[ |
|
5592 |
realName := (dir construct:aDirName) construct:aFileName. |
|
5593 |
] ifFalse:[ |
|
5594 |
realName := dir construct:aFileName. |
|
5595 |
]. |
|
5596 |
(realName isReadable) ifTrue:[ |
|
5597 |
^ realName name |
|
5598 |
] |
|
5599 |
]. |
|
5600 |
]. |
|
5601 |
||
5602 |
^ nil. |
|
5603 |
||
5604 |
"Modified: / 29.4.1999 / 15:06:43 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5605 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5606 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5607 |
setFilename:aFileNameString forClass:aClassNameString package:aPackageNameString |
8470
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5608 |
|classNameSymbol oldAbbrev cls abbrevs| |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5609 |
|
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5610 |
CachedAbbreviations isNil ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5611 |
CachedAbbreviations := IdentityDictionary new. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5612 |
]. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5613 |
|
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5614 |
abbrevs := CachedAbbreviations. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5615 |
aClassNameString ~= aFileNameString ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5616 |
classNameSymbol := aClassNameString asSymbol. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5617 |
oldAbbrev := abbrevs at:classNameSymbol ifAbsent:nil. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5618 |
oldAbbrev notNil ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5619 |
oldAbbrev ~= aFileNameString ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5620 |
StandAlone ifFalse:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5621 |
('Smalltalk [warning]: conflict for: ' , aClassNameString , |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5622 |
' in package ' , aPackageNameString) infoPrintCR. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5623 |
('Smalltalk [warning] overwriting with new: (' , oldAbbrev , ' <-> ' , aFileNameString , ')') |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5624 |
infoPrintCR |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5625 |
] |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5626 |
]. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5627 |
"overwrite old abbreviation with new one, |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5628 |
to allow fixing of bad abbrev files" |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5629 |
]. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5630 |
|
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5631 |
cls := self classNamed:aFileNameString. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5632 |
cls notNil ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5633 |
cls name ~= aClassNameString ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5634 |
"/ ok, there is a class named after this abbrev ... |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5635 |
"/ this is only a conflict, if the other class has no |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5636 |
"/ abbreviation (or the same). |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5637 |
(abbrevs at:(cls name asSymbol) ifAbsent:cls name) = aFileNameString ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5638 |
cls isNameSpace ifFalse:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5639 |
aPackageNameString = cls package ifTrue:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5640 |
StandAlone ifFalse:[ |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5641 |
('Smalltalk [warning]: conflict for: ' , cls name , |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5642 |
' in package ' , aPackageNameString) infoPrintCR. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5643 |
('Smalltalk [warning]: (' , aClassNameString , ' -> ' , aFileNameString |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5644 |
, ')') infoPrintCR |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5645 |
] |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5646 |
] |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5647 |
] |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5648 |
] |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5649 |
] |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5650 |
]. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5651 |
abbrevs at:classNameSymbol put:aFileNameString. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5652 |
] |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5653 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5654 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5655 |
sourceDirectoryNameOfClass:aClassOrClassName |
7758 | 5656 |
"for a given class, return the pathname relative to TOP of the classes source code. |
5657 |
Read the files 'abbrev.stc' and 'liblist.stc' (which are created during the compilation process) |
|
5658 |
for an entry for aClassOrClassName. |
|
5659 |
Search for the className in the first col, and return the value found in |
|
5660 |
the 3rd col. |
|
5661 |
Return nil if no entry is found." |
|
5662 |
||
5663 |
|aStream line words n aClassName| |
|
5664 |
||
5665 |
aClassOrClassName isBehavior ifTrue:[ |
|
5666 |
aClassName := aClassOrClassName name |
|
5667 |
] ifFalse:[ |
|
5668 |
aClassName := aClassOrClassName |
|
5669 |
]. |
|
5670 |
aClassName := aClassName asString. |
|
5671 |
||
5672 |
#('include/abbrev.stc' 'include/liblist.stc') "/ filenames |
|
5673 |
with:#(3 2) "/ column |
|
5674 |
do:[:fileName :col | |
|
5675 |
||
5676 |
aStream := self systemFileStreamFor:fileName. |
|
7616 | 5677 |
aStream notNil ifTrue:[ |
5678 |
[aStream atEnd] whileFalse:[ |
|
5679 |
line := aStream nextLine. |
|
5680 |
line notNil ifTrue:[ |
|
5681 |
(line startsWith:'#') ifFalse:[ |
|
5682 |
words := line asCollectionOfWords. |
|
5683 |
(n := words size) > 1 ifTrue:[ |
|
5684 |
(words at:1) = aClassName ifTrue:[ |
|
5685 |
n >= col ifTrue:[ |
|
5686 |
aStream close. |
|
5687 |
^ (words at:col) withoutSeparators |
|
5688 |
] |
|
5689 |
] |
|
5690 |
] |
|
5691 |
] |
|
5692 |
] |
|
5693 |
]. |
|
5694 |
aStream close |
|
5695 |
]. |
|
617 | 5696 |
]. |
5697 |
||
5698 |
^ nil |
|
191 | 5699 |
|
5700 |
" |
|
617 | 5701 |
Smalltalk sourceDirectoryNameOfClass:'ClockView' |
5702 |
Smalltalk sourceDirectoryNameOfClass:'Bag' |
|
5703 |
Smalltalk sourceDirectoryNameOfClass:'GLWireCubeDemoView' |
|
5704 |
Smalltalk sourceDirectoryNameOfClass:'SomeNonExistingClass' |
|
5705 |
" |
|
5706 |
||
5707 |
"Created: 6.11.1995 / 15:43:30 / cg" |
|
728
50cf1c907c28
again search liblist for a classes source directory
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
5708 |
"Modified: 9.12.1995 / 23:54:14 / cg" |
2033 | 5709 |
"Modified: 3.1.1997 / 11:26:44 / stefan" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5710 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5711 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5712 |
sourceFileStreamFor:aFileName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5713 |
"search aFileName in some standard places; |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5714 |
return a readonly fileStream or nil if not found. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5715 |
Searches in subdirectories named 'source' in SystemPath" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5716 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5717 |
|aString| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5718 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5719 |
aString := self getSourceFileName:aFileName. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5720 |
aString notNil ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5721 |
^ aString asFilename readStreamOrNil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5722 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5723 |
^ nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5724 |
! |
7758 | 5725 |
|
5726 |
systemFileStreamFor:aFileName |
|
5727 |
"search aFileName in some standard places; |
|
5728 |
return a readonly fileStream or nil if not found. |
|
5729 |
see comment in Smalltalk>>initSystemPath" |
|
5730 |
||
5731 |
|aString| |
|
5732 |
||
5733 |
aString := self getSystemFileName:aFileName. |
|
5734 |
aString notNil ifTrue:[ |
|
5735 |
^ aString asFilename readStreamOrNil |
|
617 | 5736 |
]. |
5737 |
^ nil |
|
5738 |
! |
|
5739 |
||
7758 | 5740 |
systemPath |
5741 |
"return a collection of directorynames, where smalltalk |
|
7563 | 5742 |
looks for system files |
617 | 5743 |
(usually in subdirs such as resources, bitmaps, source etc.) |
5744 |
see comment in Smalltalk>>initSystemPath." |
|
5745 |
||
5746 |
^ SystemPath |
|
5747 |
||
5748 |
" |
|
5749 |
Smalltalk systemPath |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5750 |
Smalltalk systemPath addLast:'someOtherDirectoryPath' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5751 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5752 |
! |
617 | 5753 |
|
7758 | 5754 |
systemPath:aPath |
5755 |
"set the collection of directorynames, where smalltalk |
|
5756 |
looks for system files |
|
5757 |
(usually in subdirs such as resources, bitmaps, source etc.) |
|
5758 |
see comment in Smalltalk>>initSystemPath." |
|
5759 |
||
5760 |
SystemPath := aPath. |
|
5761 |
self flushPathCaches |
|
5762 |
||
5763 |
" |
|
5764 |
Smalltalk systemPath |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5765 |
Smalltalk systemPath:(Smalltalk systemPath copy addLast:'someOtherDirectoryPath') |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5766 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5767 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5768 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5769 |
!Smalltalk class methodsFor:'system management-packages'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5770 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5771 |
knownPackages |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5772 |
^ KnownPackages ? #() |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5773 |
! |
7758 | 5774 |
|
5775 |
loadExtensionsForPackage:aPackageId |
|
5776 |
|packageDirName| |
|
5777 |
||
5778 |
packageDirName := aPackageId copyReplaceAll:$: with:$/. |
|
5779 |
||
5780 |
packageDirName := self getPackageFileName:packageDirName. |
|
5781 |
packageDirName isNil ifTrue:[ |
|
5782 |
^ false |
|
5783 |
]. |
|
5784 |
^ self loadExtensionsFromDirectory:packageDirName |
|
5785 |
! |
|
5786 |
||
5787 |
loadExtensionsFromDirectory:packageDirOrString |
|
5788 |
|packageDir f| |
|
5789 |
||
5790 |
packageDir := packageDirOrString asFilename. |
|
5791 |
||
5792 |
f := packageDir construct:'extensions.st'. |
|
5793 |
f exists ifTrue:[ |
|
5794 |
f fileIn. |
|
5795 |
SilentLoading ifFalse:[ |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5796 |
Transcript showCR:('loaded extensions: ' , f pathName). |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5797 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5798 |
^ true |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5799 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5800 |
^ false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5801 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5802 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5803 |
loadPackage:aPackageIdOrPackage |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5804 |
"make certain, that some particular package is loaded into the system. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5805 |
Experimental." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5806 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5807 |
(aPackageIdOrPackage isSymbol |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5808 |
or:[aPackageIdOrPackage isString]) ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5809 |
^ self loadPackageWithId:aPackageIdOrPackage asAutoloaded:false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5810 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5811 |
self shouldImplement. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5812 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5813 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5814 |
Smalltalk loadPackage:'stx:libbasic' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5815 |
Smalltalk loadPackage:'stx:goodies/persistency' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5816 |
Smalltalk loadPackage:'cg:cparser' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5817 |
Smalltalk loadPackage:'cg:rose' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5818 |
" |
7758 | 5819 |
! |
5820 |
||
5821 |
loadPackage:packageId fromAllSourceFilesInDirectory:aDirectory |
|
5822 |
"load all source files found in aDirectory and treat them like |
|
5823 |
a package. Allows for initial import of alien ST-code as a new package. |
|
5824 |
Experimental." |
|
5825 |
||
9028 | 5826 |
|p t new anyFail repeatCount| |
7758 | 5827 |
|
5828 |
"/ problem: dependencies. |
|
5829 |
"/ solution: repeat twice, so that superclasses are present the second time |
|
5830 |
||
5831 |
Class packageQuerySignal answer:packageId asSymbol do:[ |
|
9028 | 5832 |
|any| |
5833 |
||
5834 |
repeatCount := 0. |
|
5835 |
[ |
|
5836 |
repeatCount := repeatCount + 1. |
|
5837 |
anyFail := false. |
|
5838 |
aDirectory directoryContents do:[:file | |
|
5839 |
|fn| |
|
5840 |
||
5841 |
fn := aDirectory construct:file. |
|
5842 |
(fn hasSuffix:'st') ifTrue:[ |
|
5843 |
Metaclass confirmationQuerySignal answer:false |
|
5844 |
do:[ |
|
5845 |
Error |
|
5846 |
handle:[:ex | |
|
5847 |
anyFail := true |
|
5848 |
] |
|
5849 |
do:[ |
|
5850 |
(self fileIn:fn) ifFalse:[ |
|
5851 |
anyFail := true |
|
5852 |
] ifTrue:[ |
|
5853 |
any := true. |
|
5854 |
] |
|
5855 |
] |
|
5856 |
] |
|
5857 |
] |
|
5858 |
]. |
|
5859 |
any ifFalse:[ |
|
5860 |
^ false "/ no file found |
|
5861 |
] |
|
5862 |
] doWhile:[anyFail and:[repeatCount<2]]. |
|
4718 | 5863 |
]. |
5864 |
||
5865 |
new := (p := Project projectWithId:packageId) isNil. |
|
5866 |
new ifTrue:[ p := Project new]. |
|
5867 |
||
5868 |
p name:packageId. |
|
5869 |
p directory:aDirectory. |
|
4726 | 5870 |
p package:packageId. |
4718 | 5871 |
t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'. |
5872 |
p repositoryModule:(t first). |
|
5873 |
p repositoryDirectory:(packageId copyFrom:t first size + 2). |
|
5874 |
p isLoaded:true. |
|
5875 |
||
5876 |
new ifTrue:[Project addLoadedProject:p]. |
|
5877 |
^ anyFail not |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5878 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5879 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5880 |
loadPackage:packageId fromClassLibrary:aFilename |
7758 | 5881 |
"load a package from a compiled classLib. |
5882 |
Experimental." |
|
5883 |
||
5884 |
|p t new| |
|
5885 |
||
5886 |
(self fileIn:aFilename) ifFalse:[ |
|
5887 |
(self fileInClassLibrary:aFilename) ifFalse:[ |
|
5888 |
self warn:'Failed to load the package ', packageId printString. |
|
5889 |
^ false. |
|
5890 |
] |
|
5891 |
]. |
|
5892 |
||
5893 |
new := (p := Project projectWithId:packageId) isNil. |
|
5894 |
new ifTrue:[ p := Project new]. |
|
5895 |
||
5896 |
p name:packageId. |
|
5897 |
p directory:aFilename directory. |
|
5898 |
p package:packageId. |
|
5899 |
t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'. |
|
5900 |
p repositoryModule:(t first). |
|
5901 |
p repositoryDirectory:(packageId copyFrom:t first size + 2). |
|
5902 |
p isLoaded:true. |
|
4723 | 5903 |
|
5904 |
new ifTrue:[Project addLoadedProject:p]. |
|
5905 |
^ true |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5906 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5907 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5908 |
loadPackage:packageId fromLoadAllFile:aFilename |
7758 | 5909 |
"load a package from a loadAll - loader script. |
5910 |
Experimental." |
|
5911 |
||
5912 |
|p t new| |
|
5913 |
||
5914 |
Metaclass confirmationQuerySignal answer:false |
|
5915 |
do:[ |
|
5916 |
(self fileIn:aFilename) ifFalse:[ |
|
5917 |
self warn:'Failed to load the package ', packageId printString. |
|
5918 |
^ false. |
|
5919 |
] |
|
5920 |
]. |
|
5921 |
||
5922 |
new := (p := Project projectWithId:packageId) isNil. |
|
5923 |
new ifTrue:[ p := Project new]. |
|
5924 |
||
5925 |
p name:packageId. |
|
5926 |
p directory:aFilename directory. |
|
5927 |
p package:packageId. |
|
5928 |
t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'. |
|
5929 |
p repositoryModule:(t first). |
|
5930 |
p repositoryDirectory:(packageId copyFrom:t first size + 2). |
|
5931 |
p isLoaded:true. |
|
5932 |
||
5933 |
new ifTrue:[Project addLoadedProject:p]. |
|
5934 |
^ true |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5935 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5936 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5937 |
loadPackage:aPackageId fromProjectFile:f asAutoloaded:doLoadAsAutoloaded |
7758 | 5938 |
"load a package from a .prj spec. |
5939 |
Experimental." |
|
5940 |
||
5941 |
||
5942 |
"/ not yet implemented ... |
|
5943 |
^ false. |
|
5944 |
||
5945 |
"/ |prj fn| |
|
5946 |
"/ |
|
5947 |
"/ prj := Project new loadFromProjectFile:f asFilename pathName. |
|
5948 |
"/ "/ no - also allow for applications to be loaded this way |
|
5949 |
"/ "/ prj type == #library ifFalse:[ ^ false]. |
|
5950 |
"/ self halt. |
|
5951 |
"/ "/ load all prerequisites ... |
|
5952 |
"/ prj prerequisites do:[:aRequiredPackage | |
|
5953 |
"/ self halt. |
|
5954 |
"/ ]. |
|
5955 |
"/ |
|
5956 |
"/ "/ see if there is a class library ... |
|
5957 |
"/ fn := prj directory asFilename construct:(prj name , ObjectFileLoader sharedLibraryExtension). |
|
5958 |
"/ fn exists ifTrue:[ |
|
5959 |
"/ "/ load that classLibrary ... |
|
5960 |
"/ self fileIn:fn pathName. |
|
5961 |
"/ ]. |
|
5962 |
"/ |
|
5963 |
"/ "/ now, for all other classes, file-them in |
|
5601 | 5964 |
"/ "/ or declare as autoloaded ... |
5965 |
"/ |
|
5966 |
"/ prj classes do:[:aClassOrName | |ns| |
|
5967 |
"/ aClassOrName isBehavior ifFalse:[ |
|
5968 |
"/ ((self includesKey:aClassOrName) not |
|
5969 |
"/ and:[(ns := prj defaultNameSpace) isNil |
|
5970 |
"/ or:[ns == self |
|
5971 |
"/ or:[(ns includesKey:aClassOrName) not]]]) |
|
5972 |
"/ ifTrue:[ |
|
5973 |
"/ "/ must load a corresponding source or cls-file |
|
5974 |
"/ self halt. |
|
5975 |
"/ ] |
|
5976 |
"/ ] |
|
5977 |
"/ ]. |
|
5978 |
"/ prj isLoaded:true. |
|
5979 |
"/ prj directory:f asFilename directoryName. |
|
5980 |
"/ Project addLoadedProject:prj. |
|
5981 |
"/ ^ true |
|
4756
76982048a91a
first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents:
4748
diff
changeset
|
5982 |
|
76982048a91a
first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents:
4748
diff
changeset
|
5983 |
" |
76982048a91a
first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents:
4748
diff
changeset
|
5984 |
Smalltalk loadPackage:'exept:osi/asn1' |
76982048a91a
first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents:
4748
diff
changeset
|
5985 |
Smalltalk |
7616 | 5986 |
loadPackage:'exept:osi/asn1' |
5987 |
fromProjectFile:'../../../exept/osi/asn1/asn1.prj' |
|
5988 |
asAutoloaded:false |
|
4756
76982048a91a
first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents:
4748
diff
changeset
|
5989 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5990 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5991 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5992 |
loadPackage:aPackageId fromZIPArchive:f asAutoloaded:doLoadAsAutoloaded |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5993 |
"load a package from a .zip delivery file. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5994 |
Experimental." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5995 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5996 |
"/ not yet implemented ... |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5997 |
^ false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5998 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5999 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6000 |
loadPackageFromAbbrevFile:aPackageId asAutoloaded:doLoadAsAutoloaded |
8378 | 6001 |
|abbrevFile packageDir| |
6002 |
||
6003 |
packageDir := self packageDirectoryForPackageId:aPackageId. |
|
8380 | 6004 |
packageDir isNil ifTrue:[^ false]. |
8378 | 6005 |
|
6006 |
"/ abbrev.stc ? |
|
6007 |
abbrevFile := packageDir construct:'abbrev.stc'. |
|
6008 |
abbrevFile exists ifFalse:[^ false]. |
|
6009 |
||
6010 |
Smalltalk installAutoloadedClassesFrom:abbrevFile pathName. |
|
6011 |
||
6012 |
doLoadAsAutoloaded ifFalse:[ |
|
6013 |
"/ force autoloading... |
|
6014 |
Smalltalk allClassesDo:[:eachClass | |
|
8381 | 6015 |
eachClass package = aPackageId ifTrue:[ eachClass autoload]. |
8378 | 6016 |
]. |
6017 |
]. |
|
6018 |
||
6019 |
self loadExtensionsFromDirectory:packageDir. |
|
6020 |
SilentLoading ifFalse:[ |
|
6021 |
Transcript showCR:('loaded package: ' , aPackageId , ' from abbrev file: ' , abbrevFile pathName). |
|
6022 |
]. |
|
6023 |
^ true |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6024 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6025 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6026 |
loadPackageWithId:aPackageId |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6027 |
"make certain, that some particular package is loaded into the system. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6028 |
Experimental." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6029 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6030 |
^ self loadPackageWithId:aPackageId asAutoloaded:false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6031 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6032 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6033 |
Smalltalk loadPackageWithId:'stx:libbasic' |
7758 | 6034 |
Smalltalk loadPackageWithId:'stx:goodies/persistency' |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6035 |
Smalltalk loadPackageWithId:'cg:cparser' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6036 |
Smalltalk loadPackageWithId:'cg:rose' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6037 |
Smalltalk loadPackageWithId:'detemobil:smc' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6038 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6039 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6040 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6041 |
loadPackageWithId:aPackageId asAutoloaded:doLoadAsAutoloaded |
7758 | 6042 |
"make certain, that some particular package is loaded into the system. |
6043 |
Experimental." |
|
6044 |
||
8379 | 6045 |
|pkg packageDir| |
7758 | 6046 |
|
6047 |
pkg := Project projectWithId:aPackageId. |
|
6048 |
(pkg notNil and:[pkg isLoaded]) ifTrue:[ |
|
8378 | 6049 |
"/ ('Smalltalk [info]: Package ' , aPackageId , ' already loaded.') infoPrintCR. |
6050 |
(doLoadAsAutoloaded |
|
6051 |
or:[pkg areAllClassesLoaded]) ifTrue:[ |
|
6052 |
^ true |
|
6053 |
]. |
|
7758 | 6054 |
]. |
6055 |
||
6056 |
"/ ok; not yet loaded. |
|
6057 |
"/ try to locate the package; try the following: |
|
6058 |
"/ $(packagePath)/<packageDir>/... |
|
6059 |
"/ $(SYSPATH)/packages/<packageDir> |
|
8378 | 6060 |
packageDir := self packageDirectoryForPackageId:aPackageId. |
5051
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
6061 |
packageDir isNil ifTrue:[ |
9028 | 6062 |
(aPackageId includes:$:) ifFalse:[ |
6063 |
"/ assume stx |
|
6064 |
packageDir := self packageDirectoryForPackageId:('stx:',aPackageId). |
|
6065 |
]. |
|
6066 |
]. |
|
6067 |
packageDir isNil ifTrue:[ |
|
8379 | 6068 |
('Smalltalk [warning]: cannot find packageDirectory: ' , packageDir name) errorPrintCR. |
8378 | 6069 |
^ false |
4718 | 6070 |
]. |
6071 |
||
5051
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
6072 |
^ self |
8378 | 6073 |
loadPackageWithId:aPackageId |
6074 |
fromDirectory:packageDir |
|
6075 |
asAutoloaded:doLoadAsAutoloaded |
|
5051
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
6076 |
|
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
6077 |
" |
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
6078 |
Smalltalk loadPackageWithId:'stx:libbasic' |
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
6079 |
Smalltalk loadPackageWithId:'stx:goodies/persistency' |
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
6080 |
Smalltalk loadPackageWithId:'exept:ctypes' |
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
6081 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6082 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6083 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6084 |
loadPackageWithId:aPackageId fromDirectory:packageDirOrString asAutoloaded:doLoadAsAutoloaded |
8378 | 6085 |
|f packageDir packageName shLibName| |
7758 | 6086 |
|
6087 |
packageDir := packageDirOrString asFilename. |
|
8378 | 6088 |
packageName := packageDir baseName. |
7758 | 6089 |
|
6090 |
"/ .prj ? |
|
6091 |
f := (packageDir construct:packageName) withSuffix:'prj'. |
|
6092 |
f exists ifTrue:[ |
|
8370
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6093 |
(self loadPackage:aPackageId fromProjectFile:f asAutoloaded:doLoadAsAutoloaded) ifTrue:[ |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6094 |
SilentLoading ifFalse:[ |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6095 |
Transcript showCR:('Smalltalk [info]: loaded package: ' , aPackageId , ' from project file: ' , f pathName). |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6096 |
]. |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6097 |
^ true |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6098 |
] |
7758 | 6099 |
]. |
6100 |
"/ loadAll ? |
|
6101 |
f := packageDir construct:'loadAll'. |
|
8370
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6102 |
f exists ifFalse:[ |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6103 |
f := packageDir construct:'loadall'. |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6104 |
]. |
7758 | 6105 |
f exists ifTrue:[ |
8370
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6106 |
(self loadPackage:aPackageId fromLoadAllFile:f) ifTrue:[ |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6107 |
SilentLoading ifFalse:[ |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6108 |
Transcript showCR:('loaded package: ' , aPackageId , ' from loadAll file: ' , f pathName). |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6109 |
]. |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6110 |
^ true |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6111 |
] |
7758 | 6112 |
]. |
6113 |
"/ .zip ? |
|
6114 |
f := (packageDir construct:packageName) withSuffix:'zip'. |
|
6115 |
f exists ifTrue:[ |
|
8370
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6116 |
(self loadPackage:aPackageId fromZIPArchive:f asAutoloaded:doLoadAsAutoloaded) ifTrue:[ |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6117 |
SilentLoading ifFalse:[ |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6118 |
Transcript showCR:('loaded package: ' , aPackageId , ' from zip file: ' , f pathName). |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6119 |
]. |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6120 |
^ true |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6121 |
] |
7758 | 6122 |
]. |
6123 |
||
6124 |
shLibName := packageName , ObjectFileLoader sharedLibraryExtension. |
|
6125 |
||
6126 |
"/ .so ? |
|
6127 |
f := packageDir construct:shLibName. |
|
6128 |
f exists ifTrue:[ |
|
8370
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6129 |
(self loadPackage:aPackageId fromClassLibrary:f) ifTrue:[ |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6130 |
SilentLoading ifFalse:[ |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6131 |
Transcript showCR:('loaded package: ' , aPackageId , ' from binary classLib file: ' , f pathName). |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6132 |
]. |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6133 |
doLoadAsAutoloaded ifFalse:[ |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6134 |
"/ force autoloading... |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6135 |
Smalltalk allClassesDo:[:eachClass | |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6136 |
eachClass package == aPackageId ifTrue:[ eachClass autoload]. |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6137 |
]. |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6138 |
]. |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6139 |
^ true |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6140 |
] |
7758 | 6141 |
]. |
6142 |
||
6143 |
"/ abbrev.stc ? |
|
8378 | 6144 |
(self loadPackageFromAbbrevFile:aPackageId asAutoloaded:doLoadAsAutoloaded) ifTrue:[ |
8370
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6145 |
^ true |
7758 | 6146 |
]. |
6147 |
||
6148 |
"/ any .so ? -> load the first one found (maybe not a good idea) |
|
6149 |
packageDir directoryContentsAsFilenamesDo:[:aFilename | |
|
8370
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6150 |
(aFilename hasSuffix:ObjectFileLoader sharedLibrarySuffix) ifTrue:[ |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6151 |
(self loadPackage:aPackageId fromClassLibrary:aFilename) ifTrue:[ |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6152 |
SilentLoading ifFalse:[ |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6153 |
Transcript showCR:('loaded package: ' , aPackageId , ' from binary classLib file: ' , aFilename pathName). |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6154 |
]. |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6155 |
doLoadAsAutoloaded ifFalse:[ |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6156 |
"/ force autoloading... |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6157 |
Smalltalk allClassesDo:[:eachClass | |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6158 |
eachClass package == aPackageId ifTrue:[ eachClass autoload]. |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6159 |
]. |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6160 |
]. |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6161 |
^ true |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6162 |
] |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6163 |
] |
5175
c3e71ead8e06
when loading a package, and a .so file could not be found
Claus Gittinger <cg@exept.de>
parents:
5168
diff
changeset
|
6164 |
]. |
5807
019d25b669e5
in loadPackage, if there is no loadAll file and no
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
6165 |
|
5051
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
6166 |
"/ source files |
4737 | 6167 |
(self loadPackage:aPackageId fromAllSourceFilesInDirectory:packageDir) ifTrue:[ |
8370
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6168 |
SilentLoading ifFalse:[ |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6169 |
Transcript showCR:('loaded package: ' , aPackageId , ' from source files in:' , packageDir pathName). |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6170 |
]. |
27cf91058821
look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents:
8358
diff
changeset
|
6171 |
^ true |
4737 | 6172 |
]. |
6173 |
^ false |
|
6174 |
||
4718 | 6175 |
" |
6176 |
Smalltalk loadPackageWithId:'stx:libbasic' |
|
6177 |
Smalltalk loadPackageWithId:'stx:goodies/persistency' |
|
4722 | 6178 |
Smalltalk loadPackageWithId:'exept:ctypes' |
4718 | 6179 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6180 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6181 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6182 |
packageDirectoryForPackageId:aPackageId |
8378 | 6183 |
|packageDirName packageDir| |
6184 |
||
6185 |
packageDirName := aPackageId copyReplaceAll:$: with:$/. |
|
6186 |
||
6187 |
packageDir := self getPackageFileName:packageDirName. |
|
6188 |
packageDir isNil ifTrue:[ |
|
6189 |
"/ for convenience: try ../../.. as well |
|
6190 |
"/ (when executing in thedevelopment environment) |
|
6191 |
packageDir := '../../..' asFilename construct:packageDirName. |
|
8379 | 6192 |
packageDir exists ifFalse:[ ^ nil]. |
6193 |
]. |
|
6194 |
^ packageDir asFilename |
|
8378 | 6195 |
|
6196 |
" |
|
6197 |
Smalltalk packageDirectoryForPackageId:'stx:libbasic' |
|
6198 |
Smalltalk packageDirectoryForPackageId:'stx:goodies/persistency' |
|
6199 |
Smalltalk packageDirectoryForPackageId:'exept:ctypes' |
|
6200 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6201 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6202 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6203 |
!Smalltalk class methodsFor:'system management-undeclared variables'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6204 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6205 |
clearUndeclaredVariables |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6206 |
"remove all undeclared variables" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6207 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6208 |
(Smalltalk at:#Undeclared) do:[:eachKey | |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6209 |
Smalltalk removeKey:(self undeclaredPrefix , eachKey) asSymbol. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6210 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6211 |
(Smalltalk at:#Undeclared) removeAll. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6212 |
Smalltalk removeKey:#Undeclared. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6213 |
! |
7758 | 6214 |
|
6215 |
undeclaredPrefix |
|
7563 | 6216 |
"the prefix used for undeclared variables" |
6217 |
||
6218 |
^ 'Undeclared:::' |
|
6711 | 6219 |
|
6220 |
"Created: / 31.10.1997 / 01:13:10 / cg" |
|
7758 | 6221 |
! ! |
6222 |
||
6223 |
!Smalltalk class methodsFor:'time-versions'! |
|
6224 |
||
6225 |
configuration |
|
6226 |
"{ Pragma: +optSpace }" |
|
6227 |
||
6228 |
"for developers only: return the configuration, with which |
|
6229 |
this smalltalk was compiled." |
|
6230 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6231 |
%{ /* NOCONTEXT */ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6232 |
extern char *__getConfigurationString(); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6233 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6234 |
RETURN (__MKSTRING(__getConfigurationString() COMMA_SND)); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6235 |
%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6236 |
^ 'unknownOS/unknownCONF:unknownPACK' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6237 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6238 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6239 |
Smalltalk configuration |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6240 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6241 |
! |
453 | 6242 |
|
7758 | 6243 |
copyrightString |
6244 |
"{ Pragma: +optSpace }" |
|
6245 |
||
6246 |
"return a copyright string" |
|
6247 |
||
6248 |
%{ /* NOCONTEXT */ |
|
6249 |
#ifndef __getCopyrightString |
|
6250 |
extern OBJ __getCopyrightString(); |
|
6251 |
#endif |
|
6252 |
||
6253 |
RETURN (__getCopyrightString()); |
|
6254 |
%}. |
|
6255 |
^ self primitiveFailed |
|
6256 |
||
6257 |
" |
|
6258 |
Smalltalk copyrightString |
|
6259 |
" |
|
6260 |
! |
|
6261 |
||
6262 |
distributorString |
|
6263 |
"{ Pragma: +optSpace }" |
|
7563 | 6264 |
|
6265 |
"return a string describing the distributor of this software" |
|
567 | 6266 |
|
6267 |
%{ /* NOCONTEXT */ |
|
829
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
6268 |
#ifndef __getDistributorString |
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
6269 |
extern OBJ __getDistributorString(); |
568 | 6270 |
#endif |
6271 |
||
829
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
6272 |
RETURN (__getDistributorString()); |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6273 |
%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6274 |
^ 'eXept Software AG, Germany' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6275 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6276 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6277 |
Smalltalk distributorString |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6278 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6279 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6280 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6281 |
expirationTime |
7758 | 6282 |
"{ Pragma: +optSpace }" |
6283 |
||
6284 |
"for developers only: return the time when the system will expire. |
|
6285 |
after this time it will not run any longer. |
|
6286 |
It returns nil, if no expiration time has been set (system runs forever :-))" |
|
6287 |
||
6288 |
|exp| |
|
6289 |
||
6290 |
%{ |
|
6291 |
extern unsigned int __getExpirationTime(); |
|
6292 |
||
6293 |
exp = __MKUINT(__getExpirationTime()); |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6294 |
%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6295 |
exp == 0 ifTrue:[ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6296 |
^ nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6297 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6298 |
^ Timestamp new fromOSTime:(exp * 1000). "OSTime is ms since 1970" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6299 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6300 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6301 |
Smalltalk expirationTime |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6302 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6303 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6304 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6305 |
fullVersionString |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6306 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6307 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6308 |
"return a full version string" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6309 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6310 |
^ 'Smalltalk/X release ' , self versionString , ' of ' , self versionDate |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6311 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6312 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6313 |
Smalltalk fullVersionString |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6314 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6315 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6316 |
"Created: / 27.10.1997 / 17:03:09 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6317 |
"Modified: / 27.10.1997 / 17:04:02 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6318 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6319 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6320 |
hello |
7758 | 6321 |
"{ Pragma: +optSpace }" |
6322 |
||
6323 |
"return a greeting string" |
|
6324 |
||
6325 |
"stupid: this should come from a resource file ... |
|
6326 |
but I dont use it here, to allow mini-systems without |
|
6327 |
Resource-stuff." |
|
6328 |
||
6329 |
|proto lang| |
|
6330 |
||
6331 |
lang := Language. |
|
6332 |
(lang == #de) ifTrue:[ |
|
8880 | 6333 |
proto := 'Willkommen bei %1 (Version %2 von %3)' |
7758 | 6334 |
] ifFalse:[ (lang == #fr) ifTrue:[ |
8880 | 6335 |
proto := 'Salut, Bienvenue à %1 (version %2 de %3)' |
7758 | 6336 |
] ifFalse:[ (lang == #it) ifTrue:[ |
8880 | 6337 |
proto := 'Ciao, benvenuto al %1 (versione %2 di %3)' |
7758 | 6338 |
] ifFalse:[ (lang == #es) ifTrue:[ |
8084
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
6339 |
"/ proto := 'Hola, bienvenida a %1 (versión %2 de %3)' |
5641 | 6340 |
] ifFalse:[ (lang == #es) ifTrue:[ |
8084
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
6341 |
"/ proto := 'Oi, benvindo a %1 (versão %2 de %3)' |
5641 | 6342 |
] ifFalse:[ (lang == #no) ifTrue:[ |
8880 | 6343 |
proto := 'Hei, verdenmottakelse til %1 (versjon %2 av %3)' |
5641 | 6344 |
]]]]]]. |
1307 | 6345 |
|
6346 |
"/ ... more needed here ... |
|
6347 |
||
6348 |
proto isNil ifTrue:[ |
|
8880 | 6349 |
proto := 'Hello World - here is %1 version %2 of %3'. |
453 | 6350 |
]. |
1307 | 6351 |
|
6187 | 6352 |
^ proto bindWith:('SmallTalk/X' allBold) |
8880 | 6353 |
with:(self versionString) |
6354 |
with:(self versionDate) |
|
453 | 6355 |
|
6356 |
" |
|
1307 | 6357 |
Smalltalk language:#us. |
6358 |
Smalltalk hello |
|
6359 |
||
6360 |
Smalltalk language:#de. |
|
6361 |
Smalltalk hello |
|
1412 | 6362 |
|
5641 | 6363 |
Smalltalk language:#no. |
6364 |
Smalltalk hello |
|
6365 |
||
1422 | 6366 |
Transcript showCR:(Smalltalk hello) |
6367 |
Stdout showCR:(Smalltalk hello) |
|
453 | 6368 |
" |
1307 | 6369 |
|
1412 | 6370 |
"Modified: 18.5.1996 / 14:25:13 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6371 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6372 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6373 |
imageRestartTime |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6374 |
"return a timestamp for the moment when this image was restarted. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6375 |
If we do not execute from an image (i.e. fresh start), return nil." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6376 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6377 |
^ ImageRestartTime |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6378 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6379 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6380 |
Smalltalk imageStartTime |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6381 |
Smalltalk imageRestartTime |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6382 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6383 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6384 |
"Created: 13.12.1995 / 17:44:20 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6385 |
"Modified: 6.3.1996 / 11:56:35 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6386 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6387 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6388 |
imageSaveTime |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6389 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6390 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6391 |
"return a timestamp for the moment when this image was saved" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6392 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6393 |
^ ObjectMemory imageSaveTime |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6394 |
! |
7758 | 6395 |
|
6396 |
imageStartTime |
|
6397 |
"{ Pragma: +optSpace }" |
|
6398 |
||
6399 |
"return a timestamp for the moment when this system started the first time |
|
6400 |
(i.e. the first initial start without an image)" |
|
6401 |
||
6402 |
^ ImageStartTime |
|
6403 |
||
6404 |
" |
|
6405 |
Smalltalk imageStartTime |
|
6406 |
Smalltalk imageRestartTime |
|
6407 |
" |
|
6408 |
||
6409 |
"Created: 13.12.1995 / 17:44:14 / cg" |
|
6410 |
"Modified: 13.12.1995 / 17:45:47 / cg" |
|
6411 |
! |
|
6412 |
||
6413 |
majorVersionNr |
|
6414 |
"{ Pragma: +optSpace }" |
|
7563 | 6415 |
|
6416 |
"return the major version number. |
|
617 | 6417 |
This is only incremented for very fundamental changes, |
6418 |
which make old object files totally incompatible |
|
6419 |
(for example, if the layout/representation of fundamental |
|
3382 | 6420 |
classes changes). |
6421 |
||
3988 | 6422 |
ST/X revision Naming is: |
7616 | 6423 |
<major>.<minor>.<revision>.<release>" |
7362
1af5f648cdb2
major version bumb (due to class-layout change)
Claus Gittinger <cg@exept.de>
parents:
7348
diff
changeset
|
6424 |
|
1af5f648cdb2
major version bumb (due to class-layout change)
Claus Gittinger <cg@exept.de>
parents:
7348
diff
changeset
|
6425 |
^ 5 |
617 | 6426 |
|
6427 |
" |
|
6428 |
Smalltalk majorVersionNr |
|
6429 |
" |
|
1941
51332fe23542
bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents:
1917
diff
changeset
|
6430 |
|
51332fe23542
bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents:
1917
diff
changeset
|
6431 |
"Modified: 8.11.1996 / 19:59:21 / cg" |
617 | 6432 |
! |
6433 |
||
7758 | 6434 |
minorVersionNr |
6435 |
"{ Pragma: +optSpace }" |
|
6436 |
||
6437 |
"return the minor version number. |
|
6438 |
This is incremented for changes which make some old object |
|
6439 |
files incompatible, or the protocol changes such that some |
|
6440 |
classes need rework. |
|
6441 |
||
6442 |
ST/X revision Naming is: |
|
7981 | 6443 |
<major>.<minor>.<revision>.<release>" |
6444 |
||
8665 | 6445 |
^ 2 |
7758 | 6446 |
|
6447 |
" |
|
6448 |
Smalltalk minorVersionNr |
|
6449 |
" |
|
6450 |
||
6451 |
"Modified: / 3.11.1997 / 14:49:48 / cg" |
|
6452 |
! |
|
6453 |
||
6454 |
releaseIdentification |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6455 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6456 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6457 |
"for developers only: return the release |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6458 |
(to further identify the version in case of errors)" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6459 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6460 |
%{ /* NOCONTEXT */ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6461 |
extern OBJ __getRel(); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6462 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6463 |
RETURN (__getRel()); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6464 |
%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6465 |
^ 'ST/X_experimental' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6466 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6467 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6468 |
Smalltalk releaseIdentification |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6469 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6470 |
! |
7758 | 6471 |
|
6472 |
releaseNr |
|
7563 | 6473 |
"{ Pragma: +optSpace }" |
6474 |
||
6475 |
"return the revision number. |
|
7758 | 6476 |
Incremented for releases which fix bugs/add features but did not find |
6477 |
their way to the outside world. |
|
3988 | 6478 |
|
6479 |
ST/X revision Naming is: |
|
8663 | 6480 |
<major>.<minor>.<revision>.<release>" |
6481 |
||
8960 | 6482 |
^ 1 |
617 | 6483 |
|
6484 |
" |
|
6485 |
Smalltalk releaseNr |
|
6486 |
" |
|
732
29a49feab799
release bump - that seems to be a good one
Claus Gittinger <cg@exept.de>
parents:
728
diff
changeset
|
6487 |
|
29a49feab799
release bump - that seems to be a good one
Claus Gittinger <cg@exept.de>
parents:
728
diff
changeset
|
6488 |
"Created: 10.12.1995 / 01:42:19 / cg" |
617 | 6489 |
! |
6490 |
||
7758 | 6491 |
revisionNr |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6492 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6493 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6494 |
"return the revision number. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6495 |
Incremented for releases which fix bugs/add features |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6496 |
and represent a stable workable version which got published |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6497 |
to the outside world. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6498 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6499 |
ST/X revision Naming is: |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6500 |
<major>.<minor>.<revision>.<release>" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6501 |
|
8959 | 6502 |
^ 7 |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6503 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6504 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6505 |
Smalltalk revisionNr |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6506 |
Smalltalk hello |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6507 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6508 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6509 |
"Modified: / 19.6.1998 / 04:29:10 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6510 |
! |
617 | 6511 |
|
7758 | 6512 |
timeStamp |
6513 |
"return a string useful for timestamping a file. |
|
6514 |
The returned string is padded with spaces for a constant |
|
6515 |
length (to avoid changing a files size in fileOut with unchanged |
|
6516 |
class)." |
|
6517 |
||
6518 |
^ ('''' , self timeStampString , '''') paddedTo:80 with:(Character space) |
|
6519 |
! |
|
6520 |
||
6521 |
timeStamp:aStream |
|
6522 |
"write a string useful for timestamping a file onto aStream. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6523 |
ST80 compatibility" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6524 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6525 |
aStream nextPutAll:(self timeStamp). |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6526 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6527 |
"Created: / 18.6.1998 / 17:22:58 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6528 |
! |
7758 | 6529 |
|
6530 |
timeStampString |
|
6531 |
"return a string useful for timestamping a file." |
|
6532 |
||
7962 | 6533 |
|dateString| |
6534 |
||
8115 | 6535 |
dateString := String streamContents:[:s | Date today printOn:s language:#en]. "/ MUST be english !!!! |
7962 | 6536 |
|
7758 | 6537 |
^ ('From Smalltalk/X, Version:' , (Smalltalk versionString) , ' on ' |
7962 | 6538 |
, dateString , ' at ' , Time now printString |
7758 | 6539 |
) |
6540 |
! |
|
6541 |
||
6542 |
versionDate |
|
6543 |
"{ Pragma: +optSpace }" |
|
6544 |
||
6545 |
"return the executables build date - thats the date when the smalltalk |
|
6546 |
executable was built" |
|
6547 |
||
6548 |
%{ /* NOCONTEXT */ |
|
6549 |
extern char *__getBuildDateString(); |
|
6550 |
||
6551 |
RETURN (__MKSTRING(__getBuildDateString() COMMA_SND) ); |
|
6552 |
%}. |
|
6553 |
^ 'today' |
|
6554 |
||
6555 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6556 |
Smalltalk versionDate |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6557 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6558 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6559 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6560 |
versionString |
7758 | 6561 |
"{ Pragma: +optSpace }" |
6562 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6563 |
"return the version string" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6564 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6565 |
^ (self majorVersionNr printString , |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6566 |
'.', |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6567 |
self minorVersionNr printString , |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6568 |
'.', |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6569 |
self revisionNr printString) |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6570 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6571 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6572 |
Smalltalk versionString |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6573 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6574 |
! |
7758 | 6575 |
|
6576 |
vmMajorVersionNr |
|
6577 |
"{ Pragma: +optSpace }" |
|
6578 |
||
6579 |
"return the VMs major version number." |
|
6580 |
%{ |
|
8913 | 6581 |
RETURN (__mkSmallInteger(4)); |
7758 | 6582 |
%}. |
6583 |
^ 4 |
|
6584 |
||
6585 |
" |
|
6586 |
Smalltalk vmMajorVersionNr |
|
6587 |
" |
|
2 | 6588 |
! ! |
453 | 6589 |
|
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
6590 |
!Smalltalk class methodsFor:'documentation'! |
630 | 6591 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
6592 |
version |
9029 | 6593 |
^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.698 2005-12-21 13:39:49 cg Exp $' |
630 | 6594 |
! ! |