author | Claus Gittinger <cg@exept.de> |
Mon, 12 Jan 1998 14:14:31 +0100 | |
changeset 3155 | 35befc38f4f1 |
parent 3096 | 881660d6e997 |
child 3260 | 10e5199831ee |
permissions | -rw-r--r-- |
1 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1988 by Claus Gittinger |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
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 |
||
13 |
Object subclass:#Smalltalk |
|
3033 | 14 |
instanceVariableNames:'' |
15 |
classVariableNames:'StartBlocks ImageStartBlocks ExitBlocks CachedClasses SystemPath |
|
16 |
StartupClass StartupSelector StartupArguments CommandLine |
|
17 |
CommandLineArguments CachedAbbreviations SilentLoading |
|
18 |
Initializing StandAlone LogDoits LoadBinaries RealSystemPath |
|
19 |
ResourcePath SourcePath BitmapPath BinaryPath FileInPath |
|
20 |
BinaryDirName ResourceDirName SourceDirName BitmapDirName |
|
21 |
FileInDirName ChangeFileName ImageStartTime ImageRestartTime |
|
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
22 |
DemoMode SyntaxHilighting SaveEmergencyImage' |
3033 | 23 |
poolDictionaries:'' |
24 |
category:'System-Support' |
|
1 | 25 |
! |
26 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
27 |
!Smalltalk class methodsFor:'documentation'! |
70 | 28 |
|
617 | 29 |
copyright |
30 |
" |
|
31 |
COPYRIGHT (c) 1988 by Claus Gittinger |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
32 |
All Rights Reserved |
617 | 33 |
|
34 |
This software is furnished under a license and may be used |
|
35 |
only in accordance with the terms of that license and with the |
|
36 |
inclusion of the above copyright notice. This software may not |
|
37 |
be provided or otherwise made available to, or used by, any |
|
38 |
other person. No title to or ownership of the software is |
|
39 |
hereby transferred. |
|
40 |
" |
|
95 | 41 |
! |
42 |
||
70 | 43 |
documentation |
44 |
" |
|
45 |
This is one of the central classes in the system; |
|
46 |
it provides all system-startup, shutdown and maintenance support. |
|
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
47 |
Also global variables are (conceptionally) kept here. |
70 | 48 |
|
49 |
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
|
50 |
- my implementation of globals is totally different |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
51 |
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
|
52 |
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
|
53 |
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
|
54 |
functions found there. |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
55 |
|
70 | 56 |
However, it provides the known enumeration protocol. |
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
57 |
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
|
58 |
to inherit more collection stuff ... |
70 | 59 |
|
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
60 |
|
1286 | 61 |
[Instance variables:] |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
62 |
none - all handling is done in the VM |
1286 | 63 |
|
64 |
[Class variables:] |
|
65 |
||
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
66 |
StartBlocks <Collection> blocks to be executed in a separate process after |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
67 |
everything has been initialized. These blocks will |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
68 |
be deleted after execution and therefore not be |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
69 |
executed after an image restart. Initial processes |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
70 |
are usually started here. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
71 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
72 |
ImageStartBlocks |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
73 |
<Collection> blocks to be executed in a separate process after |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
74 |
everything has been initialized. These blocks will be |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
75 |
executed after an image restart. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
76 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
77 |
ExitBlocks <Collection> blocks to evaluate before system is |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
78 |
left. Not currently used (GNU-ST compatibility). |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
79 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
80 |
SystemPath <Collection> path to search for system files (sources, bitmaps etc) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
81 |
Set to a default here, but typically changed from some |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
82 |
startup.rc file |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
83 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
84 |
StartupClass <Class> class and selector, where the system starts up |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
85 |
StartupSelector <Symbol> (right after VM initialization) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
86 |
StartupArguments <Array> If an image is saved while those being nonNil, |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
87 |
the image will come up there. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
88 |
Allows for customized images to be |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
89 |
generated from a standard ST/X. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
90 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
91 |
CommandLine <String> Unix (OS-) command line |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
92 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
93 |
CommandLineArguments <Array> Unix (OS-) command line arguments broken into words |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
94 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
95 |
SilentLoading <Boolean> suppresses messages during fileIn and in compiler |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
96 |
(can be set to true from a customized main.c) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
97 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
98 |
Initializing <Boolean> true while (re-)initializing |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
99 |
Controls the behavior of certain error |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
100 |
reporters (for example: suppress dialogBoxes) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
101 |
while the system is not yet fit for full operation. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
102 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
103 |
StandAlone <Boolean> true, if this is a standalone app; |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
104 |
if true the process scheduler watches for |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
105 |
which processes are still running, and |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
106 |
exits ST/X, when the last non-background |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
107 |
and non-system process exits. |
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
108 |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
109 |
LogDoits <Boolean> if true, doits are also logged in the changes |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
110 |
file. Default is false, since the changes file |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
111 |
may become huge if every tiny doIt is saved there ... |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
112 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
113 |
LoadBinaries <Boolean> if true, we attempt to load classes rom a binary |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
114 |
file, if present. If false, this is always suppressed. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
115 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
116 |
SaveEmergencyImage <Boolean> if true (the default), an emergency image |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
117 |
is saved, if the main Display looses its |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
118 |
connection. This is useful if you have a |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
119 |
flaky display connection (serial line) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
120 |
and want to have your stuff saved automatically |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
121 |
in case of a broken connection. |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
122 |
|
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
123 |
strictly private classVariables (helpers): |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
124 |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
125 |
CachedClasses <Collection> known classes (cached for faster class enumeration) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
126 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
127 |
CachedAbbreviations |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
128 |
<Dictionary> className to filename mappings |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
129 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
130 |
RealSystemPath <Collection> cached collection of directories along the path |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
131 |
which really exist. Caching avoids long checks |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
132 |
for existing directories on broken NFS volumes. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
133 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
134 |
SourcePath <Collection> cached names of really existing directories |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
135 |
BitmapPath These are remembered, since in NFS systems, |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
136 |
ResourcePath the time to lookup files may become long |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
137 |
BinaryPath (especially, if some directories are on machines |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
138 |
FileInPath which are not up ...). |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
139 |
Therefore, the set of really |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
140 |
existing directories is cached when the SystemPath |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
141 |
is walked the first time. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
142 |
A consequence is that you have to invoke |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
143 |
flushSystemPath, when you create any of those |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
144 |
directories while running |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
145 |
(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
|
146 |
|
1286 | 147 |
|
148 |
[author:] |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
149 |
Claus Gittinger |
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
150 |
|
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
151 |
[see also:] |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
152 |
ObjectMemory |
70 | 153 |
" |
1 | 154 |
! ! |
155 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
156 |
!Smalltalk class methodsFor:'initialization'! |
1 | 157 |
|
617 | 158 |
initGlobalsFromEnvironment |
159 |
"setup globals from the shell-environment" |
|
160 |
||
161 |
|envString i langString terrString| |
|
162 |
||
163 |
" |
|
164 |
extract Language and LanguageTerritory from LANG variable. |
|
994
6163ae7aaf9b
territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
165 |
valid are for example: english_us / us_us / us |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
166 |
english / en_en / en |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
167 |
german / de_de / de |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
168 |
german_austria |
617 | 169 |
" |
170 |
||
171 |
Language := #english. |
|
994
6163ae7aaf9b
territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
172 |
LanguageTerritory := #us. |
617 | 173 |
|
174 |
envString := OperatingSystem getEnvironment:'LANG'. |
|
175 |
envString notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
176 |
envString isEmpty ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
177 |
i := envString indexOf:$_. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
178 |
(i == 0) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
179 |
langString := envString. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
180 |
terrString := envString |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
181 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
182 |
langString := envString copyTo:(i - 1). |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
183 |
terrString := envString copyFrom:(i + 1) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
184 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
185 |
Language := langString asLowercase asSymbol. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
186 |
LanguageTerritory := terrString asLowercase asSymbol |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
187 |
] |
617 | 188 |
]. |
189 |
||
190 |
" |
|
191 |
Smalltalk initGlobalsFromEnvironment |
|
192 |
" |
|
994
6163ae7aaf9b
territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
193 |
|
6163ae7aaf9b
territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
194 |
"Modified: 22.2.1996 / 16:59:12 / cg" |
617 | 195 |
! |
196 |
||
197 |
initInterrupts |
|
198 |
"initialize interrupts" |
|
199 |
||
200 |
OperatingSystem enableUserInterrupts. |
|
201 |
OperatingSystem enableHardSignalInterrupts. |
|
202 |
||
203 |
ObjectMemory userInterruptHandler:self. |
|
204 |
ObjectMemory signalInterruptHandler:self. |
|
205 |
ObjectMemory recursionInterruptHandler:self. |
|
206 |
||
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
207 |
" |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
208 |
Smalltalk initInterrupts |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
209 |
" |
2873
5bc8c81c4a34
Catch fpExeceptionInterrupt after image restart.
Stefan Vogel <sv@exept.de>
parents:
2844
diff
changeset
|
210 |
|
5bc8c81c4a34
Catch fpExeceptionInterrupt after image restart.
Stefan Vogel <sv@exept.de>
parents:
2844
diff
changeset
|
211 |
"Modified: 20.8.1997 / 09:35:49 / stefan" |
617 | 212 |
! |
213 |
||
214 |
initStandardStreams |
|
215 |
"initialize some well-known streams" |
|
216 |
||
217 |
Stdout := NonPositionableExternalStream forStdout. |
|
218 |
Stderr := NonPositionableExternalStream forStderr. |
|
219 |
Stdin := NonPositionableExternalStream forStdin. |
|
220 |
Printer := PrinterStream. |
|
221 |
Transcript := Stderr |
|
222 |
||
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
223 |
" |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
224 |
Smalltalk initStandardStreams |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
225 |
" |
617 | 226 |
! |
227 |
||
228 |
initStandardTools |
|
229 |
"predefine some tools which we will need later |
|
230 |
- if the view-classes exist, |
|
231 |
they will redefine Inspector and Debugger for graphical interfaces" |
|
232 |
||
233 |
"redefine debug-tools, if view-classes exist" |
|
234 |
||
235 |
Display notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
236 |
InspectorView notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
237 |
Inspector := InspectorView |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
238 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
239 |
DebugView notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
240 |
Debugger := DebugView |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
241 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
242 |
Display initialize |
617 | 243 |
] |
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
244 |
|
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
245 |
" |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
246 |
Smalltalk initStandardTools |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
247 |
" |
617 | 248 |
! |
249 |
||
250 |
initSystemPath |
|
251 |
"setup path where system files are searched for. |
|
252 |
the default path is set to: |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
253 |
. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
254 |
.. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
255 |
$HOME (if defined) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
256 |
$HOME/.smalltalk (if defined & existing) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
257 |
$SMALLTALK_LIBDIR (if defined & existing) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
258 |
$STX_LIBDIR (if defined & existing) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
259 |
/usr/local/lib/smalltalk (if existing) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
260 |
/usr/lib/smalltalk (if existing) |
617 | 261 |
|
262 |
of course, it is possible to add entries from the 'smalltalk.rc' |
|
263 |
startup file; add expressions such as: |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
264 |
Smalltalk systemPath addFirst:'/foo/bar/baz'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
265 |
or: |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
266 |
Smalltalk systemPath addLast:'/fee/foe/foo'. |
617 | 267 |
" |
268 |
||
2912 | 269 |
|p homePath userPrivateSTXDir| |
617 | 270 |
|
2928 | 271 |
ChangeFileName := 'changes'. |
272 |
OperatingSystem isVMSlike ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
273 |
BitmapDirName := 'bitmaps.dir'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
274 |
BinaryDirName := 'binary.dir'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
275 |
SourceDirName := 'source.dir'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
276 |
ResourceDirName := 'resources.dir'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
277 |
FileInDirName := 'filein.dir'. |
2928 | 278 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
279 |
BitmapDirName := 'bitmaps'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
280 |
BinaryDirName := 'binary'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
281 |
SourceDirName := 'source'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
282 |
ResourceDirName := 'resources'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
283 |
FileInDirName := 'fileIn'. |
2928 | 284 |
]. |
285 |
||
680 | 286 |
SystemPath isNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
287 |
homePath := OperatingSystem getHomeDirectory. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
288 |
homePath isNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
289 |
homePath := Filename currentDirectory name |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
290 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
291 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
292 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
293 |
the path is set to search files first locally |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
294 |
- this allows private stuff to override global stuff |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
295 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
296 |
SystemPath := OrderedCollection new. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
297 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
298 |
"/ the current (default) directory |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
299 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
300 |
SystemPath add:(Filename currentDirectory name). |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
301 |
OperatingSystem isVMSlike ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
302 |
SystemPath add:'..'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
303 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
304 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
305 |
"/ the users home (login) directory |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
306 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
307 |
SystemPath add:homePath. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
308 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
309 |
"/ a users private smalltalk directory in its home (login) directory |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
310 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
311 |
OperatingSystem isUNIXlike ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
312 |
userPrivateSTXDir := homePath asFilename constructString:'.smalltalk'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
313 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
314 |
userPrivateSTXDir := homePath asFilename constructString:'smalltalk'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
315 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
316 |
(userPrivateSTXDir asFilename isDirectory) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
317 |
SystemPath add:userPrivateSTXDir |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
318 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
319 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
320 |
"/ SMALLTALK_LIBDIR and/or STX_LIBDIR from the environment |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
321 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
322 |
p := OperatingSystem getEnvironment:'SMALLTALK_LIBDIR'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
323 |
p notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
324 |
SystemPath add:p |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
325 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
326 |
p := OperatingSystem getEnvironment:'STX_LIBDIR'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
327 |
p notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
328 |
SystemPath add:p |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
329 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
330 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
331 |
"/ standard locations: |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
332 |
"/ UNIX: |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
333 |
"/ /usr/local/lib/smalltalk |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
334 |
"/ /usr/lib/smalltalk |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
335 |
"/ VMS: |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
336 |
"/ stx$root:[lib] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
337 |
"/ stx$lib: |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
338 |
"/ MSDOS: |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
339 |
"/ \smalltalk (this will change to ...Programs\Smalltalk) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
340 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
341 |
OperatingSystem isVMSlike ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
342 |
SystemPath add:'stx$lib:'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
343 |
SystemPath add:'stx$root:[lib]'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
344 |
SystemPath add:'stx$root:'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
345 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
346 |
OperatingSystem isUNIXlike ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
347 |
('/usr/local/lib/smalltalk' asFilename isDirectory) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
348 |
SystemPath add:'/usr/local/lib/smalltalk' |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
349 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
350 |
('/usr/lib/smalltalk' asFilename isDirectory) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
351 |
SystemPath add:'/usr/lib/smalltalk' |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
352 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
353 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
354 |
('\smalltalk' asFilename isDirectory) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
355 |
SystemPath add:'\smalltalk' |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
356 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
357 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
358 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
359 |
self flushPathCaches |
680 | 360 |
] |
617 | 361 |
|
362 |
" |
|
363 |
Smalltalk initSystemPath |
|
364 |
Smalltalk systemPath |
|
365 |
" |
|
366 |
! |
|
367 |
||
368 |
initUserPreferences |
|
369 |
"setup other stuff" |
|
370 |
||
371 |
LogDoits := false. |
|
372 |
LoadBinaries := false. |
|
2844
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
373 |
SyntaxHilighting := false. |
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
374 |
SaveEmergencyImage := true. |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
375 |
|
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
376 |
"Modified: / 24.10.1997 / 18:22:47 / cg" |
617 | 377 |
! |
378 |
||
379 |
initializeModules |
|
380 |
"perform module specific initialization and |
|
381 |
send #initialize to all classes. |
|
382 |
Notice: this is not called when an image is restarted" |
|
383 |
%{ |
|
1688
8a42db1eea60
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
1682
diff
changeset
|
384 |
__init_registered_modules__(3); |
1481 | 385 |
@global(DemoMode) = __getDemoMode() ? true : false; |
617 | 386 |
%} |
387 |
! |
|
388 |
||
325 | 389 |
initializeSystem |
24 | 390 |
"initialize all other classes; setup dispatcher processes etc. |
211 | 391 |
This one is the first entry into the smalltalk world right after startup, |
392 |
ususally followed by Smalltalk>>start. |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
393 |
Notice: |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
394 |
this is not called when an image is restarted; in this |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
395 |
case the show starts in Smalltalk>>restart." |
211 | 396 |
|
348 | 397 |
SilentLoading := false. |
398 |
Initializing := true. |
|
399 |
||
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
400 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
401 |
"/ define low-level debugging tools - graphical classes are not prepared yet |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
402 |
"/ to handle things. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
403 |
"/ This will bring us into the MiniDebugger when an error occurs |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
404 |
"/ during startup |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
405 |
"/ |
211 | 406 |
Inspector := MiniInspector. |
407 |
Debugger := MiniDebugger. |
|
1 | 408 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
409 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
410 |
"/ start catching SIGSEGV and SIGBUS |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
411 |
"/ |
713
32540afb8ffc
setup SIGSEGV/SIGBUS handling early - to catch those during startup
Claus Gittinger <cg@exept.de>
parents:
706
diff
changeset
|
412 |
OperatingSystem enableHardSignalInterrupts. |
32540afb8ffc
setup SIGSEGV/SIGBUS handling early - to catch those during startup
Claus Gittinger <cg@exept.de>
parents:
706
diff
changeset
|
413 |
|
1 | 414 |
self initGlobalsFromEnvironment. |
415 |
||
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
416 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
417 |
"/ 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
|
418 |
"/ 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
|
419 |
"/ |
1 | 420 |
Object initialize. |
423 | 421 |
Signal initialize. |
2907 | 422 |
Filename initialize. |
326 | 423 |
ObjectMemory initialize. |
2504
ece15ffbcb69
Initialize OperatingSystem early (needed for some signals).
Stefan Vogel <sv@exept.de>
parents:
2485
diff
changeset
|
424 |
OperatingSystem initialize. |
596
ecb1d732dade
require Stream to be initialized before ExternalStream is
Claus Gittinger <cg@exept.de>
parents:
592
diff
changeset
|
425 |
Stream initialize. |
1 | 426 |
ExternalStream initialize. |
211 | 427 |
|
428 |
self initStandardStreams. "/ setup Stdin, Stdout etc. |
|
1 | 429 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
430 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
431 |
"/ sorry, path must be set before ... |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
432 |
"/ 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
|
433 |
"/ |
1 | 434 |
self initSystemPath. |
435 |
||
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
436 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
437 |
"/ must init display here - some classes (Color, Form) need it during initialize |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
438 |
"/" |
1 | 439 |
Workstation notNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
440 |
Workstation initialize |
1 | 441 |
]. |
442 |
||
443 |
Compiler := ByteCodeCompiler. |
|
444 |
Compiler isNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
445 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
446 |
ByteCodeCompiler is not in the system (i.e. has not been linked in) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
447 |
this allows at least immediate evaluations for runtime systems without compiler |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
448 |
NOTICE: a parser is always needed, otherwise we cannot read resource files etc. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
449 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
450 |
Compiler := Parser |
1 | 451 |
]. |
452 |
||
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
453 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
454 |
"/ another one, to be initialized before others |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
455 |
"/ |
2077
6b5dc412dd15
must initialize Processor before doing modulInits
Claus Gittinger <cg@exept.de>
parents:
2076
diff
changeset
|
456 |
ProcessorScheduler initialize. |
6b5dc412dd15
must initialize Processor before doing modulInits
Claus Gittinger <cg@exept.de>
parents:
2076
diff
changeset
|
457 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
458 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
459 |
"/ now, finally, initialize all other classes |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
460 |
"/ |
325 | 461 |
self initializeModules. |
462 |
||
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
463 |
ImageStartTime := AbsoluteTime now. |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
464 |
|
321 | 465 |
Display notNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
466 |
Display initialize. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
467 |
Display initializeDeviceResources. |
321 | 468 |
]. |
70 | 469 |
self initInterrupts. |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
470 |
self initUserPreferences. |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
471 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
472 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
473 |
"/ 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
|
474 |
"/ 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
|
475 |
"/ (especially: streams and signals can now be used) |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
476 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
477 |
ObjectMemory changed:#initialized. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
478 |
|
2504
ece15ffbcb69
Initialize OperatingSystem early (needed for some signals).
Stefan Vogel <sv@exept.de>
parents:
2485
diff
changeset
|
479 |
"Modified: 8.1.1997 / 19:58:12 / stefan" |
2907 | 480 |
"Modified: 7.9.1997 / 23:34:44 / cg" |
325 | 481 |
! |
1 | 482 |
|
617 | 483 |
isInitialized |
484 |
"this returns true, if the system is properly initialized; |
|
485 |
i.e. false during startup. Especially, the whole viewing stuff is |
|
486 |
not working correctly until initialized." |
|
487 |
||
488 |
^ Initializing not |
|
1 | 489 |
! |
490 |
||
477
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
491 |
reinitStandardStreams |
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
492 |
"reinitialize some well-known streams. |
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
493 |
Tis must be done very early during startup, to allow for |
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
494 |
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
|
495 |
(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
|
496 |
|
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
497 |
Stdout reOpen. Stderr reOpen. Stdin reOpen. |
161 | 498 |
! ! |
499 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
500 |
!Smalltalk class methodsFor:'accessing'! |
453 | 501 |
|
3083 | 502 |
associationAt:aKey |
503 |
"return a key-value association for aKey. |
|
504 |
Since ST/X's Smalltalk as no real dictionary, this is |
|
505 |
simulated here." |
|
506 |
||
507 |
|val| |
|
508 |
||
509 |
val := self at:aKey ifAbsent:nil. |
|
510 |
val isNil ifTrue:[^ nil]. |
|
511 |
^ Association key:aKey value:val |
|
512 |
||
513 |
"Created: / 1.11.1997 / 13:27:20 / cg" |
|
514 |
! |
|
515 |
||
453 | 516 |
at:aKey |
517 |
"retrieve the value stored under aKey, a symbol. |
|
1956 | 518 |
Return nil if not present |
519 |
(this will be changed to trigger an error - better use #at:ifAbsent:)" |
|
453 | 520 |
|
521 |
%{ /* NOCONTEXT */ |
|
522 |
RETURN ( __GLOBAL_GET(aKey) ); |
|
523 |
%} |
|
524 |
! |
|
525 |
||
526 |
at:aKey ifAbsent:aBlock |
|
527 |
"retrieve the value stored at aKey. |
|
528 |
If there is nothing stored under this key, return the value of |
|
529 |
the evaluation of aBlock." |
|
530 |
||
531 |
(self includesKey:aKey) ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
532 |
^ self at:aKey |
453 | 533 |
]. |
534 |
^ aBlock value |
|
535 |
||
536 |
" |
|
537 |
Smalltalk at:#fooBar <- returns nil |
|
538 |
Smalltalk at:#fooBar ifAbsent:['sorry'] <- no error |
|
539 |
" |
|
540 |
! |
|
541 |
||
542 |
at:aKey put:aValue |
|
1222 | 543 |
"store the argument aValue under aKey, a symbol. |
544 |
Return aValue (sigh)." |
|
453 | 545 |
|
546 |
|oldValue| |
|
547 |
||
548 |
%{ |
|
549 |
oldValue = __GLOBAL_SET(aKey, aValue, (OBJ *)0); |
|
550 |
%}. |
|
551 |
CachedClasses notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
552 |
oldValue isBehavior ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
553 |
oldValue name == aKey ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
554 |
CachedClasses remove:oldValue ifAbsent:[] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
555 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
556 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
557 |
aValue isBehavior ifTrue:[ |
1956 | 558 |
"/ aValue isMeta ifTrue:[ |
559 |
"/ "/ this should not happen |
|
560 |
"/ ('SMALLTALK: store a Metaclass: ' , aValue name , ' as ' , aKey) infoPrintCR. |
|
561 |
"/ ]. |
|
562 |
||
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
563 |
aValue name == aKey ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
564 |
CachedClasses add:aValue |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
565 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
566 |
CachedClasses := nil |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
567 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
568 |
]. |
453 | 569 |
]. |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
570 |
^ aValue. |
1955 | 571 |
"/ |
572 |
"/%{ /* NOCONTEXT */ |
|
573 |
"/ (void) __GLOBAL_SET(aKey, aValue, (OBJ *)0); |
|
574 |
"/%}. |
|
575 |
"/ CachedClasses := nil. |
|
576 |
"/ ^ aValue |
|
1222 | 577 |
|
578 |
"Modified: 19.4.1996 / 11:31:49 / cg" |
|
453 | 579 |
! |
580 |
||
617 | 581 |
includesKey:aKey |
582 |
"return true, if the key is known" |
|
453 | 583 |
|
584 |
%{ /* NOCONTEXT */ |
|
617 | 585 |
RETURN ( __GLOBAL_KEYKNOWN(aKey) ); |
453 | 586 |
%} |
587 |
! |
|
588 |
||
589 |
keyAtValue:anObject |
|
590 |
"return the symbol under which anObject is stored - or nil" |
|
591 |
||
592 |
self keysDo:[:aKey | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
593 |
(self at:aKey) == anObject ifTrue:[^ aKey] |
453 | 594 |
]. |
595 |
^ nil |
|
596 |
||
597 |
"Smalltalk keyAtValue:Object" |
|
598 |
! |
|
599 |
||
600 |
keys |
|
601 |
"return a collection with all keys in the Smalltalk dictionary" |
|
602 |
||
603 |
|keys| |
|
604 |
||
605 |
keys := IdentitySet new. |
|
606 |
self keysDo:[:k | keys add:k]. |
|
607 |
^ keys |
|
617 | 608 |
! |
609 |
||
610 |
removeKey:aKey |
|
878
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
611 |
"remove the association stored under the key-argument from the globals dictionary. |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
612 |
WARNING: |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
613 |
this is somewhat dangerous: conceptionally, the association is removed, |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
614 |
to which machine & byte compiled code refers if it accesses a global. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
615 |
If there are still global accesses in some literalArray or from machine-compiled code, |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
616 |
it continues to reference the globals value via that obsolete association and gets a nil |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
617 |
value. (which is correct) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
618 |
However, if that global is later reintroduced, a new association will be created and |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
619 |
the new global now referenced via the new association. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
620 |
The old accesses will still see nil, although the globals value is actually non-nil |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
621 |
(this is questionable). |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
622 |
To avoid this problem, the #removeClass: method never removed the key." |
617 | 623 |
|
624 |
CachedClasses := nil. |
|
625 |
||
626 |
%{ /* NOCONTEXT */ |
|
627 |
RETURN ( __GLOBAL_REMOVE(aKey) ); |
|
628 |
%} |
|
2705
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
629 |
! |
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
630 |
|
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
631 |
values |
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
632 |
"return a collection with all values in the Smalltalk dictionary" |
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
633 |
|
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
634 |
|values| |
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
635 |
|
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
636 |
values := OrderedCollection new. |
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
637 |
self do:[:v | values add:v]. |
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
638 |
^ values |
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
639 |
|
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
640 |
"Created: 20.6.1997 / 16:58:28 / cg" |
453 | 641 |
! ! |
642 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
643 |
!Smalltalk class methodsFor:'binary storage'! |
453 | 644 |
|
2476 | 645 |
addGlobalsForBinaryStorageTo:globalDictionary |
453 | 646 |
|pools| |
647 |
||
648 |
pools := Set new. |
|
2465
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
649 |
|
879 | 650 |
self keysAndValuesDo:[:key :value | |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
651 |
(key includes:$:) ifFalse:[ "/ skip classVars |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
652 |
(value ~~ self |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
653 |
and:[value notNil]) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
654 |
value isClass ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
655 |
value addGlobalsForBinaryStorageTo:globalDictionary. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
656 |
pools addAll:value sharedPools |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
657 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
658 |
globalDictionary at:(key->value) put:self |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
659 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
660 |
value notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
661 |
globalDictionary at:value put:self |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
662 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
663 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
664 |
] |
453 | 665 |
]. |
666 |
||
667 |
pools do:[:poolDictionary| |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
668 |
poolDictionary addGlobalsForBinaryStorageTo:globalDictionary |
453 | 669 |
] |
2465
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
670 |
|
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
671 |
"Modified: 19.3.1997 / 18:15:25 / cg" |
2476 | 672 |
"Created: 21.3.1997 / 15:40:31 / cg" |
453 | 673 |
! |
674 |
||
879 | 675 |
storeBinaryDefinitionOf:anObject on:stream manager:manager |
453 | 676 |
|string| |
677 |
||
678 |
anObject class == Association ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
679 |
string := 'Smalltalk associationAt: ', anObject key storeString |
453 | 680 |
] ifFalse: [ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
681 |
string := 'Smalltalk at: ', (self keyAtValue: anObject) storeString |
453 | 682 |
]. |
683 |
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
|
684 |
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
|
685 |
"/ 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
|
686 |
|
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
687 |
"Modified: 19.3.1997 / 18:49:14 / cg" |
453 | 688 |
! ! |
689 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
690 |
!Smalltalk class methodsFor:'browsing'! |
453 | 691 |
|
617 | 692 |
browseAllCallsOn:aSelectorSymbol |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
693 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
694 |
|
617 | 695 |
"startup a browser for all methods sending a particular message" |
696 |
||
697 |
SystemBrowser browseAllCallsOn:aSelectorSymbol |
|
698 |
||
699 |
" |
|
700 |
Smalltalk browseAllCallsOn:#at:put: |
|
701 |
" |
|
702 |
! |
|
703 |
||
704 |
browseAllSelect:aBlock |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
705 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
706 |
|
617 | 707 |
"startup a browser for all methods for which aBlock returns true" |
708 |
||
709 |
SystemBrowser browseAllSelect:aBlock |
|
710 |
||
711 |
" |
|
712 |
Smalltalk browseAllSelect:[:m | m literals isNil] |
|
713 |
" |
|
714 |
! |
|
715 |
||
453 | 716 |
browseChanges |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
717 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
718 |
|
453 | 719 |
"startup a changes browser" |
720 |
||
721 |
ChangesBrowser notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
722 |
ChangesBrowser open |
453 | 723 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
724 |
self warn:'no ChangesBrowser built in' |
453 | 725 |
] |
726 |
||
727 |
" |
|
728 |
Smalltalk browseChanges |
|
729 |
" |
|
730 |
! |
|
731 |
||
732 |
browseImplementorsOf:aSelectorSymbol |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
733 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
734 |
|
453 | 735 |
"startup a browser for all methods implementing a particular message" |
736 |
||
737 |
SystemBrowser browseImplementorsOf:aSelectorSymbol |
|
738 |
||
739 |
" |
|
740 |
Smalltalk browseImplementorsOf:#at:put: |
|
741 |
" |
|
2844
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
742 |
! |
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
743 |
|
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
744 |
syntaxHilighting |
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
745 |
^ SyntaxHilighting |
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
746 |
|
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
747 |
"Created: 8.8.1997 / 10:55:22 / cg" |
453 | 748 |
! ! |
749 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
750 |
!Smalltalk class methodsFor:'class management'! |
453 | 751 |
|
752 |
flushCachedClasses |
|
753 |
CachedClasses := nil |
|
754 |
! |
|
755 |
||
756 |
removeClass:aClass |
|
757 |
"remove the argument, aClass from the smalltalk dictionary; |
|
758 |
we have to flush the caches since these methods are now void. |
|
759 |
Also, class variables of aClass are removed." |
|
760 |
||
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
761 |
|sym cSym names oldName| |
453 | 762 |
|
763 |
oldName := aClass name. |
|
764 |
sym := oldName asSymbol. |
|
765 |
((self at:sym) == aClass) ifFalse:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
766 |
"check other name ..." |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
767 |
(self includes:aClass) ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
768 |
'Smalltalk [warning]: no such class: ' errorPrint. oldName errorPrintCR. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
769 |
^ self |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
770 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
771 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
772 |
the class has changed its name - without telling me ... |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
773 |
what should be done in this case ? |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
774 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
775 |
'Smalltalk [warning]: class ' errorPrint. oldName errorPrint. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
776 |
' has changed its name' errorPrintCR. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
777 |
^ self |
453 | 778 |
]. |
779 |
||
780 |
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
|
781 |
|
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
782 |
"/ |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
783 |
"/ 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
|
784 |
"/ |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
785 |
"/ self removeKey:sym. "/ remove key - this actually fails, if there are |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
786 |
"/ still compiled code references." |
453 | 787 |
|
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
788 |
"remove private classes" |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
789 |
|
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
790 |
aClass privateClassesSorted do:[:somePrivateClass | |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
791 |
aClass privateClassesAt:(somePrivateClass nameWithoutPrefix) asSymbol put:nil. |
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
792 |
]. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
793 |
|
453 | 794 |
"remove class variables" |
795 |
||
796 |
names := aClass classVariableString asCollectionOfWords. |
|
797 |
names do:[:name | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
798 |
cSym := (sym , ':' , name) asSymbol. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
799 |
self at:cSym asSymbol put:nil. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
800 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
801 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
802 |
"/ see comment in removeKey: on why we dont remove it here |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
803 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
804 |
"/ self removeKey:cSym |
453 | 805 |
]. |
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
806 |
|
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
807 |
|
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
808 |
"/ actually could get along with less flushing |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
809 |
"/ (entries for aClass and subclasses only) |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
810 |
"/ 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
|
811 |
"/ 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
|
812 |
"/ expensive then cache flushing. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
813 |
"/ |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
814 |
"/ aClass allSubclassesDo:[:aSubclass | |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
815 |
"/ ObjectMemory flushInlineCachesForClass:aSubclass. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
816 |
"/ ObjectMemory flushMethodCacheFor:aSubclass |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
817 |
"/ ]. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
818 |
"/ ObjectMemory flushInlineCachesForClass:aClass. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
819 |
"/ ObjectMemory flushMethodCacheFor:aClass |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
820 |
|
453 | 821 |
ObjectMemory flushInlineCaches. |
822 |
ObjectMemory flushMethodCache. |
|
823 |
||
824 |
aClass addChangeRecordForClassRemove:oldName. |
|
825 |
self changed:#classRemove with:aClass. |
|
826 |
||
1655 | 827 |
aClass category:#'* removed *'. |
828 |
||
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
829 |
"Modified: 22.3.1997 / 16:14:05 / cg" |
617 | 830 |
! |
831 |
||
832 |
renameClass:aClass to:newName |
|
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
833 |
"rename aClass to newName. Most of the work is in |
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
834 |
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
|
835 |
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
|
836 |
|
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
837 |
|oldName oldSym newSym names oldCVSym newCVSym value oldNameToNewName |
2319
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
838 |
oldNameSpace newNameSpace oldBaseName privateClasses| |
617 | 839 |
|
840 |
oldName := aClass name. |
|
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
841 |
aClass isPrivate ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
842 |
oldNameSpace := aClass topOwningClass nameSpace. |
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
843 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
844 |
oldNameSpace := aClass nameSpace. |
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
845 |
]. |
2319
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
846 |
oldBaseName := aClass nameWithoutNameSpacePrefix. |
617 | 847 |
oldSym := oldName asSymbol. |
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
848 |
privateClasses := aClass privateClassesSorted. |
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
849 |
|
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
850 |
((self at:oldSym) ~~ aClass) ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
851 |
'Smalltalk [warning]: rename failed - name is different from key' errorPrintCR. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
852 |
^ self |
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
853 |
]. |
617 | 854 |
|
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
855 |
"/ rename the class |
617 | 856 |
|
1847
6e567214b167
care for className being a symbol, when renaming classes
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
857 |
newSym := newName asSymbol. |
6e567214b167
care for className being a symbol, when renaming classes
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
858 |
aClass setName:newSym. |
617 | 859 |
|
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
860 |
"/ store it in Smalltalk |
617 | 861 |
|
862 |
self at:oldSym put:nil. |
|
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
863 |
|
878
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
864 |
"/ |
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
865 |
"/ 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
|
866 |
"/ |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
867 |
"/ self removeKey:oldSym. |
617 | 868 |
self at:newSym put:aClass. |
869 |
||
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
870 |
"/ 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
|
871 |
|
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
872 |
oldNameToNewName := IdentityDictionary new. |
617 | 873 |
|
874 |
names := aClass classVariableString asCollectionOfWords. |
|
875 |
names do:[:name | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
876 |
oldCVSym := (oldSym , ':' , name) asSymbol. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
877 |
value := self at:oldCVSym. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
878 |
self at:oldCVSym put:nil. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
879 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
880 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
881 |
"/ see comment in #removeKey: on why we dont remove it it here |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
882 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
883 |
"/ self removeKey:cSym. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
884 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
885 |
newCVSym := (newSym , ':' , name) asSymbol. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
886 |
self at:newCVSym put:value. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
887 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
888 |
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
|
889 |
]. |
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
890 |
|
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
891 |
"/ 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
|
892 |
|
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
893 |
oldNameToNewName keysAndValuesDo:[:oldNameSym :newNameSym | |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
894 |
aClass withAllSubclasses do:[:aSubClass | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
895 |
aSubClass class methodDictionary do:[:aMethod | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
896 |
aMethod changeLiteral:oldNameSym to:newNameSym |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
897 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
898 |
aSubClass methodDictionary do:[:aMethod | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
899 |
aMethod changeLiteral:oldNameSym to:newNameSym |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
900 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
901 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
902 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
903 |
"/ and also in privateClasses ? ... |
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
904 |
|
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
905 |
"/ privateClasses size > 0 ifTrue:[ |
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
906 |
"/ privateClasses do:[:aPrivateClass | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
907 |
"/ aPrivateClass withAllSubclasses do:[:aSubClass | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
908 |
"/ aSubClass class methodDictionary do:[:aMethod | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
909 |
"/ aMethod changeLiteral:oldNameSym to:newNameSym |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
910 |
"/ ]. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
911 |
"/ aSubClass methodDictionary do:[:aMethod | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
912 |
"/ aMethod changeLiteral:oldNameSym to:newNameSym |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
913 |
"/ ] |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
914 |
"/ ]. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
915 |
"/ ] |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
916 |
"/ ] |
617 | 917 |
]. |
918 |
||
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
919 |
aClass addChangeRecordForClassRename:oldSym to:newSym. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
920 |
|
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
921 |
aClass isPrivate ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
922 |
newNameSpace := aClass topOwningClass nameSpace. |
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
923 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
924 |
newNameSpace := aClass nameSpace. |
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
925 |
]. |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
926 |
|
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
927 |
privateClasses size > 0 ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
928 |
"/ must rename privateClasses as well |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
929 |
privateClasses do:[:aPrivateClass | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
930 |
self renameClass:aPrivateClass |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
931 |
to:(newSym , '::' , aPrivateClass nameWithoutPrefix). |
2514 | 932 |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
933 |
Transcript showCR:'recompiling methods in ''' , newNameSpace name , ''' accessing ''' , oldName , '::' , aPrivateClass nameWithoutPrefix , ''' ...'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
934 |
Class class |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
935 |
recompileGlobalAccessorsTo:(oldName , '::' , aPrivateClass nameWithoutPrefix) asSymbol |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
936 |
in:newNameSpace |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
937 |
except:nil. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
938 |
] |
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
939 |
]. |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
940 |
|
2319
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
941 |
oldNameSpace ~~ newNameSpace ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
942 |
"/ all those referencing the class from the old nameSpace |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
943 |
"/ must be recompiled ... |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
944 |
"/ (to now access the global from smalltalk) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
945 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
946 |
oldNameSpace ~~ Smalltalk ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
947 |
Transcript showCR:'recompiling methods in ''' , oldNameSpace name , ''' accessing ''' , oldName , ''' ...'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
948 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
949 |
Class class |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
950 |
recompileGlobalAccessorsTo:oldName asSymbol |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
951 |
in:oldNameSpace |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
952 |
except:nil. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
953 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
954 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
955 |
"/ all referencing the class in the new namespace |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
956 |
"/ as well; to now access the new class. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
957 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
958 |
(newNameSpace notNil and:[newNameSpace ~~ Smalltalk]) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
959 |
Transcript showCR:'recompiling methods in ''' , newNameSpace name , ''' accessing ''' , oldBaseName , ''' ...'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
960 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
961 |
Class class |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
962 |
recompileGlobalAccessorsTo:oldBaseName asSymbol |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
963 |
in:newNameSpace |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
964 |
except:nil. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
965 |
]. |
2514 | 966 |
|
967 |
||
2319
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
968 |
]. |
617 | 969 |
|
970 |
"Created: 29.10.1995 / 19:58:32 / cg" |
|
1480
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
971 |
"Modified: 18.6.1996 / 14:20:50 / stefan" |
2677
909ae9953e34
metaclasses no longer have a name
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
972 |
"Modified: 5.6.1997 / 09:49:59 / cg" |
453 | 973 |
! ! |
974 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
975 |
!Smalltalk class methodsFor:'copying'! |
453 | 976 |
|
617 | 977 |
deepCopy |
1410 | 978 |
"redefined to return self - there is only one Smalltalk dictionary" |
453 | 979 |
|
980 |
^ self |
|
1410 | 981 |
|
982 |
"Modified: 18.5.1996 / 12:13:33 / cg" |
|
453 | 983 |
! |
984 |
||
985 |
deepCopyUsing:aDictionary |
|
1410 | 986 |
"redefined to return self - there is only one Smalltalk dictionary" |
453 | 987 |
|
988 |
^ self |
|
1410 | 989 |
|
990 |
"Modified: 18.5.1996 / 12:13:36 / cg" |
|
453 | 991 |
! |
992 |
||
617 | 993 |
shallowCopy |
1410 | 994 |
"redefined to return self - there is only one Smalltalk dictionary" |
617 | 995 |
|
996 |
^ self |
|
1410 | 997 |
|
998 |
"Modified: 18.5.1996 / 12:13:39 / cg" |
|
617 | 999 |
! |
1000 |
||
1001 |
simpleDeepCopy |
|
1410 | 1002 |
"redefined to return self - there is only one Smalltalk dictionary" |
453 | 1003 |
|
1004 |
^ self |
|
1410 | 1005 |
|
1006 |
"Modified: 18.5.1996 / 12:13:42 / cg" |
|
453 | 1007 |
! ! |
1008 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1009 |
!Smalltalk class methodsFor:'debugging ST/X'! |
453 | 1010 |
|
1011 |
debugBreakPoint |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1012 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1013 |
|
453 | 1014 |
"call the dummy debug function, on which a breakpoint |
1015 |
can be put in adb, sdb, dbx or gdb. |
|
1016 |
WARNING: this method is for debugging only |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1017 |
it will be removed without notice." |
453 | 1018 |
%{ |
2212 | 1019 |
__PATCHUPCONTEXTS(__context); |
808
1919838112d1
renamed debugBreakPoint -> __debugBreakPoint__
Claus Gittinger <cg@exept.de>
parents:
796
diff
changeset
|
1020 |
__debugBreakPoint__(); |
453 | 1021 |
%} |
1022 |
! |
|
1023 |
||
617 | 1024 |
exitWithCoreDump |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1025 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1026 |
|
617 | 1027 |
"abort program and dump core" |
1028 |
||
1029 |
%{ /* NOCONTEXT */ |
|
1030 |
abort(); |
|
1031 |
/* NEVER RETURNS */ |
|
1032 |
%} |
|
1033 |
! |
|
1034 |
||
1035 |
fatalAbort |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1036 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1037 |
|
617 | 1038 |
"report a fatal-error, print a stack backtrace and exit with core dump. |
1039 |
(You may turn off the stack print with debugPrinting:false)" |
|
1040 |
%{ |
|
1041 |
__fatal0(__context, "fatalAbort"); |
|
1042 |
/* NEVER RETURNS */ |
|
1043 |
%} |
|
1044 |
! |
|
1045 |
||
1046 |
fatalAbort:aMessage |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1047 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1048 |
|
617 | 1049 |
"report a fatal-error; print a stack backtrace and exit with core dump |
1050 |
(You may turn off the stack print with debugPrinting:false)" |
|
1051 |
||
1052 |
%{ |
|
1053 |
char *msg; |
|
1054 |
||
1055 |
if (__isString(aMessage)) |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1056 |
msg = (char *) __stringVal(aMessage); |
617 | 1057 |
else |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1058 |
msg = "fatalAbort"; |
617 | 1059 |
|
1060 |
__fatal0(__context, msg); |
|
1061 |
/* NEVER RETURNS */ |
|
1062 |
%} |
|
1063 |
! |
|
1064 |
||
453 | 1065 |
printPolyCaches |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1066 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1067 |
|
453 | 1068 |
"dump poly caches. |
1069 |
WARNING: this method is for debugging only |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1070 |
it will be removed without notice" |
453 | 1071 |
%{ |
1072 |
__dumpILCCaches(); |
|
1073 |
%} |
|
1074 |
! |
|
1075 |
||
1076 |
printStackBacktrace |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1077 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1078 |
|
453 | 1079 |
"print a stack backtrace - then continue. |
1080 |
(You may turn off the stack print with debugPrinting:false) |
|
1081 |
WARNING: this method is for debugging only |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1082 |
it will be removed without notice" |
453 | 1083 |
|
1084 |
%{ |
|
1085 |
__printStack(__context); |
|
1086 |
%} |
|
1087 |
"Smalltalk printStackBacktrace" |
|
1088 |
! |
|
1089 |
||
1090 |
printSymbols |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1091 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1092 |
|
453 | 1093 |
"dump the internal symbol table. |
1094 |
WARNING: this method is for debugging only |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1095 |
it will be removed without notice" |
453 | 1096 |
%{ |
790
73131541a373
debug functions is only available if compiled with -DDEBUG
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
1097 |
#ifdef DEBUG |
453 | 1098 |
__dumpSymbols(); |
790
73131541a373
debug functions is only available if compiled with -DDEBUG
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
1099 |
#endif |
453 | 1100 |
%} |
1101 |
! |
|
1102 |
||
785
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1103 |
sendTraceOff |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1104 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1105 |
|
785
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1106 |
"turns tracing of message sends off. |
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1107 |
WARNING: this method is for debugging only |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1108 |
it may be removed without notice" |
785
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1109 |
|
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1110 |
%{ /* NOCONTEXT */ |
796
28cde02334c8
use functional interface to set/clear messageTrace
Claus Gittinger <cg@exept.de>
parents:
790
diff
changeset
|
1111 |
__setMessageTrace__(0); |
785
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1112 |
%} |
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1113 |
! |
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1114 |
|
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1115 |
sendTraceOn |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1116 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1117 |
|
785
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1118 |
"turns tracing of message sends on. |
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1119 |
WARNING: this method is for debugging only |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1120 |
it may be removed without notice" |
785
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1121 |
|
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1122 |
%{ /* NOCONTEXT */ |
796
28cde02334c8
use functional interface to set/clear messageTrace
Claus Gittinger <cg@exept.de>
parents:
790
diff
changeset
|
1123 |
__setMessageTrace__(1); |
785
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1124 |
%} |
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1125 |
! |
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1126 |
|
453 | 1127 |
statistic |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1128 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1129 |
|
453 | 1130 |
"print some statistic data. |
1131 |
WARNING: this method is for debugging only |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1132 |
it may be removed without notice" |
453 | 1133 |
|
1134 |
%{ /* NOCONTEXT */ |
|
1135 |
__STATISTIC__(); |
|
1136 |
%} |
|
1137 |
! ! |
|
1138 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1139 |
!Smalltalk class methodsFor:'enumerating'! |
453 | 1140 |
|
1141 |
allBehaviorsDo:aBlock |
|
1142 |
"evaluate the argument, aBlock for all classes in the system" |
|
1143 |
||
1144 |
CachedClasses isNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1145 |
self allClasses |
453 | 1146 |
]. |
1147 |
CachedClasses do:aBlock |
|
1148 |
||
1149 |
" |
|
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1150 |
Smalltalk allBehaviorsDo:[:aClass | aClass name printCR] |
453 | 1151 |
" |
1152 |
! |
|
1153 |
||
1154 |
allClassesDo:aBlock |
|
1155 |
"evaluate the argument, aBlock for all classes in the system. |
|
1156 |
Backward compatibility - use #allBehaviorsDo: for ST-80 compatibility." |
|
1157 |
||
1158 |
^ self allBehaviorsDo:aBlock |
|
1159 |
||
1160 |
" |
|
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1161 |
Smalltalk allClassesDo:[:aClass | aClass name printCR] |
453 | 1162 |
" |
1163 |
! |
|
1164 |
||
1299 | 1165 |
allClassesInCategory:aCategory |
1166 |
"return a collection of for all classes in aCategory; |
|
1167 |
The order of the classes is not defined." |
|
1168 |
||
1169 |
|coll| |
|
1170 |
||
1171 |
coll := OrderedCollection new. |
|
1172 |
self allClassesInCategory:aCategory do:[:aClass | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1173 |
coll add:aClass |
1299 | 1174 |
]. |
1175 |
^ coll |
|
1176 |
||
1177 |
" |
|
1178 |
Smalltalk allClassesInCategory:'Views-Basic' |
|
1179 |
" |
|
1180 |
||
1181 |
"Modified: 25.4.1996 / 18:06:13 / cg" |
|
1182 |
! |
|
1183 |
||
453 | 1184 |
allClassesInCategory:aCategory do:aBlock |
1185 |
"evaluate the argument, aBlock for all classes in the aCategory; |
|
1186 |
The order of the classes is not defined." |
|
1187 |
||
1188 |
aCategory notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1189 |
self allBehaviorsDo:[:aClass | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1190 |
aClass isMeta ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1191 |
(aClass category = aCategory) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1192 |
aBlock value:aClass |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1193 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1194 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1195 |
] |
453 | 1196 |
] |
1197 |
||
1198 |
" |
|
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1199 |
Smalltalk allClassesInCategory:'Views-Basic' do:[:aClass | aClass name printCR] |
453 | 1200 |
" |
1201 |
! |
|
1202 |
||
1203 |
allClassesInCategory:aCategory inOrderDo:aBlock |
|
1204 |
"evaluate the argument, aBlock for all classes in aCategory; |
|
1205 |
superclasses come first - then subclasses" |
|
1206 |
||
1207 |
|classes| |
|
1208 |
||
1209 |
aCategory notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1210 |
classes := OrderedCollection new. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1211 |
self allBehaviorsDo:[:aClass | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1212 |
aClass isMeta ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1213 |
(aClass category = aCategory) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1214 |
classes add:aClass |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1215 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1216 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1217 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1218 |
classes topologicalSort:[:a :b | b isSubclassOf:a]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1219 |
classes do:aBlock |
453 | 1220 |
] |
1221 |
||
1222 |
" |
|
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1223 |
Smalltalk allClassesInCategory:'Views-Basic' inOrderDo:[:aClass | aClass name printCR] |
453 | 1224 |
" |
617 | 1225 |
! |
1226 |
||
1227 |
allKeysDo:aBlock |
|
1228 |
"evaluate the argument, aBlock for all keys in the Smalltalk dictionary" |
|
1229 |
||
1230 |
^ self keysDo:aBlock |
|
1231 |
! |
|
1232 |
||
1233 |
associationsDo:aBlock |
|
1234 |
"evaluate the argument, aBlock for all key/value pairs |
|
1235 |
in the Smalltalk dictionary" |
|
1236 |
||
1237 |
self keysDo:[:aKey | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1238 |
aBlock value:(aKey -> (self at:aKey)) |
617 | 1239 |
] |
1240 |
||
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1241 |
"Smalltalk associationsDo:[:assoc | assoc printCR]" |
617 | 1242 |
! |
1243 |
||
1244 |
do:aBlock |
|
1245 |
"evaluate the argument, aBlock for all values in the Smalltalk dictionary" |
|
1246 |
||
1247 |
|work| |
|
1248 |
||
1249 |
%{ /* 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
|
1250 |
__GLOBALS_DO(&aBlock, &work); |
617 | 1251 |
%} |
1252 |
! |
|
1253 |
||
1254 |
keysAndValuesDo:aBlock |
|
1255 |
"evaluate the two-arg block, aBlock for all keys and values" |
|
1256 |
||
1257 |
self keysDo:[:aKey | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1258 |
aBlock value:aKey value:(self at:aKey) |
617 | 1259 |
] |
1260 |
! |
|
1261 |
||
1262 |
keysDo:aBlock |
|
1263 |
"evaluate the argument, aBlock for all keys in the Smalltalk dictionary" |
|
1264 |
|work| |
|
1265 |
||
1266 |
%{ /* 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
|
1267 |
__GLOBALKEYS_DO(&aBlock, &work); |
617 | 1268 |
%} |
453 | 1269 |
! ! |
1270 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1271 |
!Smalltalk class methodsFor:'inspecting'! |
453 | 1272 |
|
1273 |
inspectorClass |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1274 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1275 |
|
453 | 1276 |
"redefined to launch a DictionaryInspector |
1277 |
(instead of the default Inspector)." |
|
1278 |
||
1279 |
^ DictionaryInspectorView |
|
1280 |
! ! |
|
1281 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1282 |
!Smalltalk class methodsFor:'message control'! |
453 | 1283 |
|
1284 |
silentLoading |
|
1285 |
"returns the Silentloading class variable." |
|
1286 |
||
1287 |
^ SilentLoading |
|
1288 |
! |
|
1289 |
||
1290 |
silentLoading:aBoolean |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1291 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1292 |
|
453 | 1293 |
"allows access to the Silentloading class variable, which controls |
1294 |
messages from all kinds of system onto the transcript. |
|
1295 |
You can save a snapshot with this flag set to true, which makes |
|
1296 |
the image come up silent. Can also be set, to read in files unlogged." |
|
1297 |
||
1298 |
|prev| |
|
1299 |
||
1300 |
prev := SilentLoading. |
|
1301 |
SilentLoading := aBoolean. |
|
1302 |
^ prev |
|
1303 |
! ! |
|
1304 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1305 |
!Smalltalk class methodsFor:'misc stuff'! |
453 | 1306 |
|
617 | 1307 |
addExitBlock:aBlock |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1308 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1309 |
|
617 | 1310 |
"add a block to be executed when Smalltalk finishes. |
1311 |
This feature is currently not used anywhere - but could be useful for |
|
1312 |
cleanup in stand alone applications." |
|
1313 |
||
1314 |
ExitBlocks isNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1315 |
ExitBlocks := OrderedCollection with:aBlock |
617 | 1316 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1317 |
ExitBlocks add:aBlock |
617 | 1318 |
] |
1319 |
! |
|
1320 |
||
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1321 |
addImageStartBlock:aBlock |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1322 |
"{ Pragma: +optSpace }" |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1323 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1324 |
"add a blocks to be executed in a separate process after |
2681 | 1325 |
everything has been initialized. |
1326 |
These blocks will be executed after an image restart." |
|
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1327 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1328 |
ImageStartBlocks isNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1329 |
ImageStartBlocks := OrderedCollection with:aBlock |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1330 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1331 |
ImageStartBlocks add:aBlock |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1332 |
] |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1333 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1334 |
"Created: 9.9.1996 / 16:48:20 / stefan" |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1335 |
! |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1336 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1337 |
addStartBlock:aBlock |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1338 |
"{ Pragma: +optSpace }" |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1339 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1340 |
"add a blocks to be executed in a separate process after |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1341 |
everything has been initialized. These blocks will |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1342 |
be deleted after execution and therefore not be |
2681 | 1343 |
executed after an image restart. |
1344 |
Initial processes are usually started here (see smalltalk.rc / private.rc)." |
|
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1345 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1346 |
StartBlocks isNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1347 |
StartBlocks := OrderedCollection with:aBlock |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1348 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1349 |
StartBlocks add:aBlock |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1350 |
] |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1351 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1352 |
"Created: 9.9.1996 / 16:46:53 / stefan" |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1353 |
! |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1354 |
|
453 | 1355 |
exit |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1356 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1357 |
|
453 | 1358 |
"finish Smalltalk system" |
1359 |
||
1360 |
ObjectMemory changed:#aboutToQuit. "/ for ST-80 compatibility |
|
1361 |
ExitBlocks notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1362 |
ExitBlocks do:[:aBlock | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1363 |
aBlock value |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1364 |
] |
453 | 1365 |
]. |
1366 |
OperatingSystem exit |
|
1367 |
||
1368 |
" |
|
1369 |
Smalltalk exit |
|
1370 |
" |
|
1371 |
! |
|
1372 |
||
1373 |
sleep:aDelay |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1374 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1375 |
|
453 | 1376 |
"wait for aDelay seconds. |
1377 |
OBSOLETE: this is historical leftover and will be removed" |
|
1378 |
||
1379 |
OperatingSystem sleep:aDelay |
|
1380 |
! ! |
|
1381 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1382 |
!Smalltalk class methodsFor:'queries'! |
453 | 1383 |
|
1384 |
allClasses |
|
1385 |
"return an unordered collection of all classes in the system. |
|
1386 |
Only globally anchored classes are returned |
|
1387 |
(i.e. anonymous ones have to be aquired by Behavior allSubInstances)" |
|
1388 |
||
1389 |
|classes| |
|
1390 |
||
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1391 |
"/ you may wonder, what this while is for, here ... |
453 | 1392 |
"/ the reason is that if we modify the class hierarchy in |
1393 |
"/ anothe view (background fileIn), while building up the |
|
1394 |
"/ cachedClasses set, this may be flushed (invalidated) by the |
|
1395 |
"/ other process in the meanwhile. |
|
1396 |
"/ If that happens, we restart the set-building here |
|
1397 |
"/ |
|
1398 |
[(classes := CachedClasses) isNil] whileTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1399 |
CachedClasses := classes := IdentitySet new:800. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1400 |
self do:[:anObject | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1401 |
anObject notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1402 |
anObject isBehavior ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1403 |
classes add:anObject |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1404 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1405 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1406 |
] |
453 | 1407 |
]. |
1408 |
^ classes |
|
1409 |
||
1410 |
" |
|
1411 |
Smalltalk allClasses |
|
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1412 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1413 |
to get the list sorted by name: |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1414 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1415 |
Smalltalk allClasses asSortedCollection:[:a :b | a name < b name] |
453 | 1416 |
" |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1417 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1418 |
"Modified: 13.12.1995 / 14:52:50 / cg" |
453 | 1419 |
! |
1420 |
||
617 | 1421 |
cellAt:aName |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1422 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1423 |
|
617 | 1424 |
"return the address of a global cell |
1425 |
- used internally for compiler only" |
|
1426 |
||
1427 |
%{ /* NOCONTEXT */ |
|
1428 |
RETURN ( __GLOBAL_GETCELL(aName) ); |
|
1429 |
%} |
|
1430 |
! |
|
1431 |
||
453 | 1432 |
classNamed:aString |
1433 |
"return the class with name aString, or nil if absent. |
|
1480
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
1434 |
To get to the metaClass, append ' class' to the string." |
453 | 1435 |
|
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1436 |
|cls sym meta| |
453 | 1437 |
|
1438 |
"be careful, to not invent new symbols ..." |
|
1439 |
sym := aString asSymbolIfInterned. |
|
1440 |
sym notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1441 |
cls := self at:sym ifAbsent:[]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1442 |
cls isBehavior ifTrue:[^ cls] |
453 | 1443 |
]. |
1480
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
1444 |
(aString endsWith:' class') ifTrue:[ |
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
1445 |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1446 |
meta := self classNamed:(aString copyWithoutLast:6). |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1447 |
meta notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1448 |
^ meta class |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1449 |
]. |
453 | 1450 |
]. |
1451 |
^ nil |
|
1452 |
||
1453 |
" |
|
1454 |
Smalltalk classNamed:'Object' |
|
1455 |
Smalltalk classNamed:'fooBar' |
|
1456 |
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
|
1457 |
Smalltalk classNamed:'Object class' |
453 | 1458 |
Smalltalk classNamed:'Metaclass' |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1459 |
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
|
1460 |
Smalltalk classNamed:'Array class' |
453 | 1461 |
" |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1462 |
|
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1463 |
"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
|
1464 |
"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
|
1465 |
"Modified: 19.6.1996 / 14:22:21 / stefan" |
453 | 1466 |
! |
1467 |
||
1468 |
classNames |
|
1469 |
"return a collection of all classNames in the system" |
|
1470 |
||
1471 |
^ self allClasses collect:[:aClass | aClass name] |
|
1472 |
||
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1473 |
" |
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1474 |
Smalltalk classNames |
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1475 |
" |
453 | 1476 |
! |
1477 |
||
1478 |
classnameCompletion:aPartialClassName |
|
1479 |
"given a partial classname, return an array consisting of |
|
1480 |
2 entries: 1st: collection consisting of matching names |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1481 |
2nd: the best (longest) match" |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1482 |
|
2523
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1483 |
|searchName matches ignCaseMatches best isMatchString| |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1484 |
|
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1485 |
searchName := aPartialClassName. |
2379 | 1486 |
searchName isEmpty ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1487 |
^ Array with:searchName with:#() |
2379 | 1488 |
]. |
1489 |
||
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1490 |
(searchName at:1) isLowercase ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1491 |
searchName := searchName copy asUppercaseFirst |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1492 |
]. |
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1493 |
|
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1494 |
isMatchString := searchName includesMatchCharacters. |
1451 | 1495 |
matches := OrderedCollection new. |
2523
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1496 |
ignCaseMatches := OrderedCollection new. |
453 | 1497 |
self allClassesDo:[:aClass | |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1498 |
|className addIt| |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1499 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1500 |
className := aClass name. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1501 |
aClass isMeta ifFalse:[ |
1451 | 1502 |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1503 |
isMatchString ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1504 |
addIt := searchName match:className |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1505 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1506 |
addIt := className startsWith:searchName |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1507 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1508 |
addIt ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1509 |
matches add:aClass name |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1510 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1511 |
"/ try ignoring case |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1512 |
isMatchString ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1513 |
addIt := searchName match:className ignoreCase:true |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1514 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1515 |
addIt := className asLowercase startsWith:searchName asLowercase |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1516 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1517 |
addIt ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1518 |
ignCaseMatches add:aClass name |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1519 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1520 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1521 |
] |
453 | 1522 |
]. |
1451 | 1523 |
|
453 | 1524 |
matches isEmpty ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1525 |
matches := ignCaseMatches |
2523
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1526 |
]. |
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1527 |
|
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1528 |
matches isEmpty ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1529 |
^ Array with:searchName with:(Array with:searchName) |
453 | 1530 |
]. |
1531 |
matches size == 1 ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1532 |
^ Array with:matches first with:(matches asArray) |
453 | 1533 |
]. |
1451 | 1534 |
matches := matches asSortedCollection. |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1535 |
isMatchString ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1536 |
best := searchName. |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1537 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1538 |
best := matches longestCommonPrefix. |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1539 |
]. |
453 | 1540 |
^ Array with:best with:matches asArray |
1541 |
||
1542 |
" |
|
1543 |
Smalltalk classnameCompletion:'Arr' |
|
1544 |
Smalltalk classnameCompletion:'Arra' |
|
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1545 |
Smalltalk classnameCompletion:'arra' |
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1546 |
Smalltalk classnameCompletion:'*rray' |
453 | 1547 |
" |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1548 |
|
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1549 |
"Created: 24.11.1995 / 17:24:45 / cg" |
2523
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1550 |
"Modified: 3.4.1997 / 18:25:01 / cg" |
453 | 1551 |
! |
1552 |
||
2004
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1553 |
defaultNameSpace |
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1554 |
"return the default namespace, where new classes are installed, |
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1555 |
if NO special nameSpace handler is present" |
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1556 |
|
2029
55ddf4c547ab
ask the current project for the defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
2004
diff
changeset
|
1557 |
|p| |
55ddf4c547ab
ask the current project for the defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
2004
diff
changeset
|
1558 |
|
55ddf4c547ab
ask the current project for the defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
2004
diff
changeset
|
1559 |
(Project notNil and:[(p := Project current) notNil]) ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1560 |
^ p defaultNameSpace |
2029
55ddf4c547ab
ask the current project for the defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
2004
diff
changeset
|
1561 |
]. |
55ddf4c547ab
ask the current project for the defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
2004
diff
changeset
|
1562 |
|
2004
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1563 |
^ self |
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1564 |
|
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1565 |
"Created: 19.12.1996 / 23:49:25 / cg" |
2029
55ddf4c547ab
ask the current project for the defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
2004
diff
changeset
|
1566 |
"Modified: 2.1.1997 / 20:01:31 / cg" |
2004
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1567 |
! |
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1568 |
|
617 | 1569 |
includes:something |
1570 |
"this should come from Collection. |
|
1571 |
will change the inheritance - Smalltalk is actually a collection" |
|
1572 |
||
1573 |
self do:[:element | element = something ifTrue:[^ true]]. |
|
1574 |
^ false |
|
1575 |
! |
|
1576 |
||
1706 | 1577 |
isNamespace |
1578 |
^ true |
|
1579 |
||
1580 |
"Created: 11.10.1996 / 18:10:43 / cg" |
|
1581 |
! |
|
1582 |
||
617 | 1583 |
numberOfGlobals |
1584 |
"return the number of global variables in the system" |
|
1585 |
||
1586 |
|tally "{ Class: SmallInteger }" | |
|
1587 |
||
1588 |
tally := 0. |
|
1589 |
self do:[:obj | tally := tally + 1]. |
|
1590 |
^ tally |
|
1591 |
||
1592 |
"Smalltalk numberOfGlobals" |
|
1593 |
! |
|
1594 |
||
1595 |
references:anObject |
|
1596 |
"redefined, since the references are only kept in the VM's symbol table" |
|
1597 |
||
1598 |
self keysAndValuesDo:[:key :val | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1599 |
(key == anObject) ifTrue:[^ true]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1600 |
(val == anObject ) ifTrue:[^ true]. |
617 | 1601 |
]. |
1602 |
^ super references:anObject |
|
1603 |
! |
|
1604 |
||
1605 |
referencesDerivedInstanceOf:aClass |
|
1606 |
"redefined, since the references are only kept in the VM's symbol table" |
|
1607 |
||
1608 |
self keysAndValuesDo:[:key :val | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1609 |
(key isKindOf:aClass) ifTrue:[^ true]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1610 |
(val isKindOf:aClass) ifTrue:[^ true]. |
617 | 1611 |
]. |
1612 |
^ super referencesDerivedInstanceOf:aClass |
|
1613 |
! |
|
1614 |
||
1615 |
referencesInstanceOf:aClass |
|
1616 |
"redefined, since the references are only kept in the VM's symbol table" |
|
1617 |
||
1618 |
self keysAndValuesDo:[:key :val | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1619 |
(key isMemberOf:aClass) ifTrue:[^ true]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1620 |
(val isMemberOf:aClass) ifTrue:[^ true]. |
617 | 1621 |
]. |
1622 |
^ super referencesInstanceOf:aClass |
|
1623 |
! |
|
1624 |
||
3026 | 1625 |
resolveName:aName inClass:aClass |
1626 |
"resolve aName as if compiled within aClass; |
|
1627 |
i.e. if it has a private class with this name, return it; |
|
1628 |
if aName is known within the classes namespace, return that. |
|
1629 |
Otherwise, return a global with that name. |
|
1630 |
This should be used whereever Smalltalk>>at: used to be used, |
|
1631 |
to resolve a global by name." |
|
1632 |
||
1633 |
|sym cls ns| |
|
1634 |
||
1635 |
aName isNil ifTrue:[^ nil]. |
|
1636 |
aName isBehavior ifTrue:[^ aName]. "/ already resolved |
|
1637 |
||
1638 |
sym := aName asSymbol. |
|
1639 |
||
1640 |
cls := aClass privateClassesAt:sym. |
|
1641 |
cls notNil ifTrue:[^ cls]. |
|
1642 |
||
1643 |
ns := aClass nameSpace. |
|
1644 |
(ns notNil and:[ns ~~ Smalltalk]) ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1645 |
ns isNamespace ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1646 |
cls := ns at:sym ifAbsent:nil. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1647 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1648 |
cls := ns privateClassesAt:sym |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1649 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1650 |
cls notNil ifTrue:[^ cls]. |
3025 | 1651 |
]. |
3026 | 1652 |
^ self at:sym ifAbsent:nil. |
3025 | 1653 |
! |
1654 |
||
453 | 1655 |
selectorCompletion:aPartialSymbolName |
1656 |
"given a partial selector, return an array consisting of |
|
1657 |
2 entries: 1st: collection consisting of matching implemented selectors |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1658 |
2nd: the longest match" |
453 | 1659 |
|
1660 |
|matches best| |
|
1661 |
||
1662 |
matches := IdentitySet new. |
|
1663 |
self allClassesDo:[:aClass | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1664 |
aClass methodDictionary keysAndValuesDo:[:aSelector :aMethod | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1665 |
(aSelector startsWith:aPartialSymbolName) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1666 |
matches add:aSelector |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1667 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1668 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1669 |
aClass class methodDictionary keysAndValuesDo:[:aSelector :aMethod | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1670 |
(aSelector startsWith:aPartialSymbolName) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1671 |
matches add:aSelector |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1672 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1673 |
] |
453 | 1674 |
]. |
1675 |
matches := matches asSortedCollection. |
|
1676 |
matches isEmpty ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1677 |
^ Array with:aPartialSymbolName with:(Array with:aPartialSymbolName) |
453 | 1678 |
]. |
1679 |
matches size == 1 ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1680 |
^ Array with:matches first with:(matches asArray) |
453 | 1681 |
]. |
1682 |
best := matches longestCommonPrefix. |
|
1683 |
^ Array with:best with:matches asArray |
|
1684 |
||
1685 |
" |
|
1686 |
Smalltalk selectorCompletion:'at:p' |
|
1687 |
Smalltalk selectorCompletion:'nextP' |
|
1688 |
" |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1455
diff
changeset
|
1689 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1455
diff
changeset
|
1690 |
"Modified: 7.6.1996 / 08:44:33 / stefan" |
2894 | 1691 |
"Modified: 29.8.1997 / 08:00:35 / cg" |
453 | 1692 |
! ! |
1693 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1694 |
!Smalltalk class methodsFor:'startup'! |
1 | 1695 |
|
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1696 |
mainStartup:graphicalMode |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1697 |
"common start/restart action, if there is a Display, initialize it |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1698 |
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
|
1699 |
|
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1700 |
|mainProcess standAloneProcess imageName thisIsARestart| |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1701 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1702 |
imageName := ObjectMemory imageName. |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1703 |
thisIsARestart := imageName notNil. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1704 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1705 |
" |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1706 |
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
|
1707 |
" |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1708 |
Display notNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1709 |
Display deviceIOErrorSignal handlerBlock:[:ex | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1710 |
SaveEmergencyImage == true ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1711 |
'Display [warning]: broken display connection - emergency save in ''crash.img''.' infoPrintCR. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1712 |
ObjectMemory primSnapShotOn:'crash.img'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1713 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1714 |
'Display [warning]: broken display connection - exit.' infoPrintCR. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1715 |
Smalltalk exit. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1716 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1717 |
Display startDispatch. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1718 |
]. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1719 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1720 |
Initializing := false. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1721 |
|
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
1722 |
"/ 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
|
1723 |
"/ 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
|
1724 |
"/ 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
|
1725 |
"/ 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
|
1726 |
|
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1727 |
mainProcess := [ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1728 |
StartBlocks notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1729 |
StartBlocks do:[:aBlock| |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1730 |
aBlock value |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1731 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1732 |
StartBlocks := nil. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1733 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1734 |
ImageStartBlocks notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1735 |
ImageStartBlocks do:[:aBlock| |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1736 |
aBlock value |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1737 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1738 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1739 |
StandAlone ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1740 |
(SilentLoading == true) ifFalse:[ "i.e. undefined counts as false" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1741 |
thisIsARestart ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1742 |
Transcript cr. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1743 |
Transcript showCR:('Smalltalk restarted from:' |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1744 |
, imageName |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1745 |
, ' (saved ' |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1746 |
, ObjectMemory imageSaveTime printString |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1747 |
, ')' ). |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1748 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1749 |
Transcript showCR:(self hello). |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1750 |
Transcript showCR:(self copyrightString). |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1751 |
Transcript cr. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1752 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1753 |
Transcript cr. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1754 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1755 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1756 |
DemoMode ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1757 |
Transcript showCR:'*** Restricted use: ***'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1758 |
Transcript showCR:'*** This program may be used for education only. ***'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1759 |
Transcript showCR:'*** Please read the files COPYRIGHT and LICENSE ***'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1760 |
Transcript showCR:'*** for more details. ***'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1761 |
Transcript cr. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1762 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1763 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1764 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1765 |
thisIsARestart ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1766 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1767 |
"/ the final late notification - users can now assume that |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1768 |
"/ views, forms etc. have been recreated. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1769 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1770 |
ObjectMemory changed:#returnFromSnapshot. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1771 |
] |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1772 |
|
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1773 |
] newProcess. |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1774 |
mainProcess priority:8. |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1775 |
mainProcess name:'start block handler'. |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1776 |
mainProcess beGroupLeader. |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1777 |
mainProcess resume. |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1778 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1779 |
|
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
1780 |
"/ 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
|
1781 |
"/ message. |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
1782 |
|
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1783 |
(StartupClass notNil and:[StartupSelector notNil]) ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1784 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1785 |
allow more customization by reading an image specific rc-file |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1786 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1787 |
thisIsARestart ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1788 |
(imageName asFilename hasSuffix:'img') ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1789 |
imageName := imageName copyWithoutLast:4 |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1790 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1791 |
self fileIn:(imageName , '.rc') |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1792 |
]. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1793 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1794 |
"/ Display notNil ifTrue:[ |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1795 |
"/ Display class exitOnLastClose:true. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1796 |
"/ ]. |
2086 | 1797 |
"/ Processor exitWhenNoMoreUserProcesses:true. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1798 |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1799 |
standAloneProcess := [ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1800 |
StartupClass perform:StartupSelector withArguments:StartupArguments. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1801 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1802 |
"/ non-GUI apps exit after the startup; |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1803 |
"/ assume that GUI apps have created & opened some view ... |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1804 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1805 |
Display isNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1806 |
Smalltalk exit. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1807 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1808 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1809 |
"/ GUI apps exit after the last user process has finished |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1810 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1811 |
Display class exitOnLastClose:true. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1812 |
Processor exitWhenNoMoreUserProcesses:true. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1813 |
] newProcess. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1814 |
standAloneProcess priority:8. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1815 |
standAloneProcess name:'main'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1816 |
standAloneProcess beGroupLeader. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1817 |
standAloneProcess resume. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1818 |
]. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1819 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1820 |
" |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1821 |
if view-classes exist, start dispatching; |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1822 |
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
|
1823 |
" |
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
1824 |
((Display notNil and:[graphicalMode]) or:[standAloneProcess notNil]) ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1825 |
Processor dispatchLoop. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1826 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1827 |
StandAlone ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1828 |
self readEvalPrint |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1829 |
] |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1830 |
]. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1831 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1832 |
"done - the last process finished" |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1833 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1834 |
self exit |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1835 |
|
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
1836 |
"Created: / 18.7.1996 / 21:07:39 / cg" |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
1837 |
"Modified: / 9.9.1996 / 17:42:50 / stefan" |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
1838 |
"Modified: / 24.10.1997 / 18:23:16 / cg" |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1839 |
! |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1840 |
|
453 | 1841 |
readEvalPrint |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1842 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1843 |
|
453 | 1844 |
"simple read-eval-print loop for non-graphical Minitalk" |
1845 |
||
1846 |
|text| |
|
1847 |
||
1848 |
'ST- ' print. |
|
1849 |
Stdin skipSeparators. |
|
1850 |
Stdin atEnd ifFalse:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1851 |
text := Stdin nextChunk. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1852 |
[text notNil] whileTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1853 |
AbortSignal handle:[:ex | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1854 |
'evaluation aborted' printCR |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1855 |
] do:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1856 |
(Compiler evaluate:text) printCR. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1857 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1858 |
'ST- ' print. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1859 |
text := Stdin nextChunk |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1860 |
]. |
453 | 1861 |
]. |
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1862 |
'' printCR |
453 | 1863 |
! |
1864 |
||
1 | 1865 |
restart |
24 | 1866 |
"startup after an image has been loaded; |
10 | 1867 |
there are three change-notifications made to dependents of ObjectMemory, |
1868 |
which allow a stepwise re-init: #earlyRestart, #restarted and #returnFromSnapshot. |
|
335 | 1869 |
|
3096
881660d6e997
added #earlySystemInitialization change message (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3092
diff
changeset
|
1870 |
#earlySystemInstallation is sent for ST80 compatibility |
881660d6e997
added #earlySystemInitialization change message (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3092
diff
changeset
|
1871 |
|
10 | 1872 |
#earlyRestart is send first, nothing has been setup yet. |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1873 |
(should be used to flush all device dependent entries) |
335 | 1874 |
|
10 | 1875 |
#restarted is send right after. |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1876 |
(should be used to recreate external resources (fds, bitmaps etc) |
335 | 1877 |
|
10 | 1878 |
#returnFromSnapshot is sent last |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1879 |
(should be used to restart processes, reOpen Streams which cannot |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1880 |
be automatically be reopened (i.e. Sockets, Pipes) and so on. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1881 |
(Notice that positionable fileStreams are already reopened and repositioned) |
1 | 1882 |
" |
10 | 1883 |
|
1581 | 1884 |
|deb insp idx| |
1 | 1885 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1886 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1887 |
"/ when we arrive here, all objects from our previous life |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1888 |
"/ have been reloaded - however, these contain invalid device |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1889 |
"/ handles, display information etc. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1890 |
"/ also, dynamically loaded modules have not yet been reloaded. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1891 |
|
1 | 1892 |
Initializing := true. |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1893 |
ImageRestartTime := AbsoluteTime now. |
335 | 1894 |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
1895 |
CommandLine := CommandLineArguments copy. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
1896 |
CommandLineArguments := CommandLineArguments asOrderedCollection. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
1897 |
CommandLineArguments removeAtIndex:1. "/ the command |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
1898 |
|
1582 | 1899 |
idx := CommandLineArguments indexOf:'-q'. |
1900 |
idx ~~ 0 ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1901 |
Object infoPrinting:false. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1902 |
ObjectMemory infoPrinting:false. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1903 |
CommandLineArguments removeAtIndex:idx. |
1582 | 1904 |
]. |
1905 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1906 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1907 |
"/ invalidate the display connection. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1908 |
"/ This is required to avoid trouble if someone accesses |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1909 |
"/ the Display during early startup. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1910 |
|
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1911 |
Display notNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1912 |
Display class allScreens do:[:aDisplay | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1913 |
aDisplay invalidateConnection |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1914 |
]. |
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1915 |
]. |
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1916 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1917 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1918 |
"/ start catching SIGSEGV and SIGBUS |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1919 |
|
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1920 |
OperatingSystem enableHardSignalInterrupts. |
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1921 |
|
2907 | 1922 |
"/ reinit Filename |
1923 |
Filename reinitialize. |
|
1924 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1925 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1926 |
"/ 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
|
1927 |
|
329 | 1928 |
self flushPathCaches. |
1 | 1929 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1930 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1931 |
"/ 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
|
1932 |
"/ 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
|
1933 |
|
477
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
1934 |
self reinitStandardStreams. |
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
1935 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1936 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1937 |
"/ temporary switch back to dumb interface - |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1938 |
"/ to handle errors while view-stuff is not yet reinitialized" |
1 | 1939 |
|
1940 |
insp := Inspector. |
|
1941 |
deb := Debugger. |
|
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1942 |
deb notNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1943 |
deb reinitialize |
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1944 |
]. |
1 | 1945 |
Inspector := MiniInspector. |
1946 |
Debugger := MiniDebugger. |
|
1947 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1948 |
"/ 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
|
1949 |
"/ 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
|
1950 |
"/ 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
|
1951 |
"/ this code. |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1952 |
"/ 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
|
1953 |
"/ ObjectFileLoader; therefore, must reload before doing any notifications. |
335 | 1954 |
|
1100
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1955 |
ObjectFileLoader notNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1956 |
ObjectFileLoader reloadAllRememberedObjectFiles. |
1100
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1957 |
]. |
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1958 |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1959 |
ObjectMemory changed:#earlySystemInstallation. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1960 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1961 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1962 |
"/ reinitialize the Processor - restartable processes |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1963 |
"/ are now prepared to restart, when the dispatch starts. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1964 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1965 |
Processor reinitialize. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1966 |
|
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1967 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1968 |
"/ 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
|
1969 |
"/ (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
|
1970 |
|
3022 | 1971 |
ObjectMemory |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1972 |
changed:#earlyRestart; changed:#restarted. |
1 | 1973 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1974 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1975 |
"/ some class must be reinitialized before all others ... |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1976 |
"/ - sorry, but order is important |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1977 |
"/ |
62 | 1978 |
Workstation notNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
1979 |
Workstation reinitialize. |
62 | 1980 |
]. |
1 | 1981 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1982 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1983 |
"/ start catching SIGINT and SIGQUIT |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1984 |
|
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1985 |
OperatingSystem enableUserInterrupts. |
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1986 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1987 |
"/ |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1988 |
"/ done later now - when display connection is working |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1989 |
"/ |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1990 |
"/ "/ |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1991 |
"/ "/ the final late notification - users can now assume that |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1992 |
"/ "/ views, forms etc. have been recreated. |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1993 |
"/ |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1994 |
"/ ObjectMemory changed:#returnFromSnapshot. |
1 | 1995 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1996 |
"/ now, display and view-stuff works; |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1997 |
"/ back to the previous debugging interface |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1998 |
|
1 | 1999 |
Inspector := insp. |
2000 |
Debugger := deb. |
|
2001 |
||
2002 |
Initializing := false. |
|
2003 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2004 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2005 |
"/ if there is no Transcript, go to stderr |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2006 |
|
1 | 2007 |
Transcript isNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2008 |
Transcript := Stderr |
1 | 2009 |
]. |
2010 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2011 |
"/ give user a chance to re-customize things |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2012 |
"/ reading if smalltalk_r.rc may be suppressed by the |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2013 |
"/ -fastStart argument. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2014 |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2015 |
idx := CommandLineArguments indexOf:'-faststart'. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2016 |
idx ~~ 0 ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2017 |
CommandLineArguments removeAtIndex:idx. |
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2018 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2019 |
Class withoutUpdatingChangesDo:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2020 |
(self fileIn:(self commandName , '_r.rc')) ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2021 |
"no _r.rc file where executable is; try default smalltalk_r.rc" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2022 |
self fileIn:'smalltalk_r.rc' |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2023 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2024 |
] |
7 | 2025 |
]. |
2026 |
||
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2027 |
self mainStartup:true |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2028 |
|
3096
881660d6e997
added #earlySystemInitialization change message (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3092
diff
changeset
|
2029 |
"Modified: / 8.11.1997 / 12:49:27 / cg" |
1 | 2030 |
! |
2031 |
||
617 | 2032 |
start |
2033 |
"main startup, if there is a Display, initialize it |
|
2034 |
and start dispatching; otherwise go into a read-eval-print loop." |
|
2035 |
||
2075
85e8e9cfebd3
allow standAlone apps to be mini-debugged with '-debug' flag
Claus Gittinger <cg@exept.de>
parents:
2074
diff
changeset
|
2036 |
|idx graphicalMode arg debuggingStandAlone| |
960
e3b75f50d0cd
changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2037 |
|
e3b75f50d0cd
changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2038 |
graphicalMode := true. |
2075
85e8e9cfebd3
allow standAlone apps to be mini-debugged with '-debug' flag
Claus Gittinger <cg@exept.de>
parents:
2074
diff
changeset
|
2039 |
debuggingStandAlone := false. |
617 | 2040 |
Initializing := true. |
2041 |
||
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2042 |
CommandLine := CommandLineArguments copy. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2043 |
CommandLineArguments := CommandLineArguments asOrderedCollection. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2044 |
CommandLineArguments removeAtIndex:1. "/ the command |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2045 |
|
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
2046 |
"/ |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
2047 |
"/ turn off info messages in standAlone app |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
2048 |
"/ |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
2049 |
StandAlone ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2050 |
InfoPrinting := false. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2051 |
ObjectMemory infoPrinting:false. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2052 |
idx := CommandLineArguments indexOf:'-debug'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2053 |
idx ~~ 0 ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2054 |
CommandLineArguments removeAtIndex:idx. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2055 |
debuggingStandAlone := true |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2056 |
] |
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
2057 |
]. |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
2058 |
|
617 | 2059 |
" |
2060 |
while reading patches- and rc-file, do not add things into change-file |
|
2061 |
" |
|
2062 |
Class withoutUpdatingChangesDo:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2063 |
|myName defaultRC prevCatchSetting| |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2064 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2065 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2066 |
"/ look for any '-q', '-e' or '-f' command line arguments |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2067 |
"/ and handle them; |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2068 |
"/ read startup and patches file |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2069 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2070 |
idx := CommandLineArguments indexOf:'-q'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2071 |
idx ~~ 0 ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2072 |
Object infoPrinting:false. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2073 |
ObjectMemory infoPrinting:false. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2074 |
CommandLineArguments removeAtIndex:idx. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2075 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2076 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2077 |
StandAlone ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2078 |
"/ look for a '-e filename' argument - this will force evaluation of |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2079 |
"/ filename only, no standard startup |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2080 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2081 |
idx := CommandLineArguments indexOf:'-e'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2082 |
idx ~~ 0 ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2083 |
arg := CommandLineArguments at:idx + 1. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2084 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2085 |
CommandLineArguments |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2086 |
removeAtIndex:idx+1; removeAtIndex:idx. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2087 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2088 |
arg = '-' ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2089 |
self fileInStream:Stdin |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2090 |
lazy:nil |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2091 |
silent:nil |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2092 |
logged:false |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2093 |
addPath:nil |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2094 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2095 |
self fileIn:arg. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2096 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2097 |
self exit |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2098 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2099 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2100 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2101 |
"/ if there is a <command>.pch, that patches file is read. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2102 |
"/ otherwise, look for a patches file. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2103 |
"/ BUT: the patches file is not read in StandAlone operation |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2104 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2105 |
myName := self commandName. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2106 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2107 |
"/ look for a '-f filename' argument - this will force evaluation of |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2108 |
"/ filename instead of smalltalk.rc |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2109 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2110 |
idx := CommandLineArguments indexOf:'-f'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2111 |
idx ~~ 0 ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2112 |
myName := (CommandLineArguments at:idx + 1). |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2113 |
CommandLineArguments |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2114 |
removeAtIndex:idx+1; removeAtIndex:idx. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2115 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2116 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2117 |
"/ patches are installed, even if system methods are |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2118 |
"/ overwritten. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2119 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2120 |
prevCatchSetting := Class catchMethodRedefinitions. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2121 |
Class catchMethodRedefinitions:false. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2122 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2123 |
(self secureFileIn:(myName asFilename withSuffix:'pch')) ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2124 |
StandAlone ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2125 |
self secureFileIn:'patches'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2126 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2127 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2128 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2129 |
Class catchMethodRedefinitions:prevCatchSetting. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2130 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2131 |
"/ then look for <command>.rc |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2132 |
"/ if not found, read smalltalk.rc (or stxapp.rc for standAlone operation) |
935
4317f75fa478
dont allow setting the loadBinaries flag, if there is no ObjectFileLoader
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2133 |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2134 |
(self secureFileIn:(myName asFilename withSuffix:'rc')) ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2135 |
StandAlone ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2136 |
defaultRC := 'smalltalk.rc' |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2137 |
] ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2138 |
defaultRC := 'stxapp.rc' |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2139 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2140 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2141 |
"/ no .rc file where executable is; try default smalltalk.rc (or stxapp.rc) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2142 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2143 |
(self secureFileIn:defaultRC) ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2144 |
StandAlone ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2145 |
'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2146 |
graphicalMode := false. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2147 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2148 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2149 |
]. |
617 | 2150 |
]. |
2151 |
||
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
2152 |
StandAlone ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2153 |
Debugger := Inspector := nil. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2154 |
debuggingStandAlone ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2155 |
Debugger := MiniDebugger. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2156 |
]. |
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
2157 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2158 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2159 |
enable the graphical debugger/inspector |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2160 |
(they could have been (re)defined as autoloaded in the patches file) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2161 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2162 |
self initStandardTools. |
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
2163 |
]. |
617 | 2164 |
|
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2165 |
Display isNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2166 |
graphicalMode := false. |
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2167 |
]. |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2168 |
|
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2169 |
self mainStartup:graphicalMode |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2170 |
|
2127 | 2171 |
"Modified: 10.1.1997 / 17:24:37 / cg" |
1097 | 2172 |
! ! |
2173 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
2174 |
!Smalltalk class methodsFor:'startup queries'! |
1097 | 2175 |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2176 |
commandLine |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2177 |
"return the full command line arguments (with which ST/X was started)" |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2178 |
|
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2179 |
^ CommandLine |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2180 |
|
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2181 |
"Created: 19.7.1996 / 11:09:06 / cg" |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2182 |
! |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2183 |
|
1097 | 2184 |
commandLineArguments |
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2185 |
"return the user command line arguments; |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2186 |
This is a collection of strings (separated command line words), |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2187 |
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
|
2188 |
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
|
2189 |
the commandLineArguments will be #('foo' 'bar' 'baz'). |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2190 |
In contrast, the value returned by #commandLine will be the full set of words." |
1097 | 2191 |
|
2192 |
^ CommandLineArguments |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2193 |
|
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2194 |
"Modified: 19.7.1996 / 11:11:03 / cg" |
1097 | 2195 |
! |
2196 |
||
2197 |
commandName |
|
2198 |
"return the excutables name - this is normally 'smalltalk', but |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2199 |
can be something else for standAlone apps." |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2200 |
|
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2201 |
^ CommandLine at:1. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2202 |
|
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2203 |
"Modified: 19.7.1996 / 11:11:16 / cg" |
1097 | 2204 |
! |
2205 |
||
2206 |
isStandAloneApp |
|
2207 |
"return true, if this is a standAlone application |
|
2208 |
(in contrast to a full smalltalk system)." |
|
2209 |
||
2210 |
^ StandAlone |
|
617 | 2211 |
! |
2212 |
||
2213 |
startupArguments |
|
2214 |
"return the arguments passed to StartupClass" |
|
2215 |
||
2216 |
^ StartupArguments |
|
70 | 2217 |
! |
2218 |
||
2219 |
startupClass |
|
2220 |
"return the class, that will get the start message when smalltalk |
|
2221 |
starts and its non-nil. Usually this is nil, but saving an image |
|
2222 |
with a non-nil StartupClass allows stand-alone applications" |
|
2223 |
||
2224 |
^ StartupClass |
|
2225 |
! |
|
2226 |
||
617 | 2227 |
startupClass:aClass selector:aSymbol arguments:anArrayOrNil |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
2228 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
2229 |
|
617 | 2230 |
"set the class, selector and arguments to be performed when smalltalk |
2231 |
starts. Setting those before saving a snapshot, will make the saved |
|
2232 |
image come up executing your application (instead of the normal mainloop)" |
|
2233 |
||
2234 |
StartupClass := aClass. |
|
2235 |
StartupSelector := aSymbol. |
|
2236 |
StartupArguments := anArrayOrNil |
|
2237 |
! |
|
2238 |
||
70 | 2239 |
startupSelector |
2240 |
"return the selector, that will be sent to StartupClass" |
|
2241 |
||
2242 |
^ StartupSelector |
|
2243 |
! ! |
|
2244 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
2245 |
!Smalltalk class methodsFor:'system environment'! |
1069 | 2246 |
|
2247 |
language |
|
2248 |
"return the language setting" |
|
2249 |
||
2250 |
^ Language |
|
1307 | 2251 |
|
2252 |
" |
|
2253 |
Smalltalk language |
|
2254 |
" |
|
2255 |
||
2256 |
"Modified: 26.4.1996 / 17:10:05 / cg" |
|
2257 |
! |
|
2258 |
||
2259 |
language:aLanguageSymbol |
|
2260 |
"set the language" |
|
2261 |
||
2262 |
Language := aLanguageSymbol. |
|
2263 |
self changed:#Language |
|
2264 |
||
2265 |
" |
|
2266 |
Smalltalk language:#de |
|
2267 |
" |
|
2268 |
||
2269 |
"Modified: 26.4.1996 / 17:13:34 / cg" |
|
1069 | 2270 |
! |
2271 |
||
2272 |
languageTerritory |
|
2273 |
"return the language territory setting" |
|
2274 |
||
2275 |
^ LanguageTerritory |
|
1307 | 2276 |
! |
2277 |
||
2278 |
languageTerritory:aTerritorySymbol |
|
2279 |
"set the language territory" |
|
2280 |
||
2281 |
LanguageTerritory := aTerritorySymbol. |
|
2282 |
self changed:#LanguageTerritory |
|
2283 |
||
2284 |
" |
|
2285 |
Time now |
|
2286 |
||
2287 |
Smalltalk languageTerritory:#us. |
|
2288 |
Time now |
|
2289 |
||
2290 |
Smalltalk languageTerritory:#de. |
|
2291 |
Time now |
|
2292 |
" |
|
2293 |
||
2294 |
"Modified: 26.4.1996 / 17:12:39 / cg" |
|
1069 | 2295 |
! ! |
2296 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
2297 |
!Smalltalk class methodsFor:'system management'! |
70 | 2298 |
|
617 | 2299 |
compressSources |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
2300 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
2301 |
|
617 | 2302 |
"compress the sources file, and remove all method source strings |
2303 |
from the system and replace them by refs to a string in the source file. |
|
2304 |
This is a bit different in ST/X than in other smalltalks, |
|
2305 |
since we use per-class sourcefiles for the compiled classes, |
|
2306 |
and a mix of in-memory strings and one-for-all sourceFile for |
|
2307 |
incremental compiled methods. |
|
2308 |
Therefore, only those sources which are not coming from compiled |
|
2309 |
methods are put into the 'st.src' file - all others are untouched. |
|
2310 |
This is being automated - so dont care for now." |
|
2311 |
||
2312 |
" |
|
2313 |
first, find all methods which contain either a string-ref |
|
2314 |
or an external string in the 'st.src' file |
|
2315 |
" |
|
2316 |
|newStream table source pos fileName| |
|
2317 |
||
2318 |
newStream := 'src.tmp' asFilename writeStream. |
|
2319 |
newStream isNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2320 |
self error:'cannot create new temporary source file'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2321 |
^ self |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2322 |
]. |
617 | 2323 |
|
2324 |
table := IdentityDictionary new:100. |
|
2325 |
||
2326 |
Method allSubInstancesDo:[:aMethod | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2327 |
source := nil. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2328 |
aMethod sourcePosition notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2329 |
aMethod sourceFilename = 'st.src' ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2330 |
source := aMethod source. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2331 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2332 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2333 |
source := aMethod source |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2334 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2335 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2336 |
source notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2337 |
pos := newStream position. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2338 |
newStream nextChunkPut:source. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2339 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2340 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2341 |
dont change the methods info - maybe some write error |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2342 |
occurs later, in that case we abort and leave everything |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2343 |
untouched. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2344 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2345 |
table at:aMethod put:pos |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2346 |
] |
617 | 2347 |
]. |
2348 |
||
2349 |
newStream close. |
|
2350 |
||
2351 |
" |
|
2352 |
now, rename the new source file, |
|
2353 |
" |
|
2354 |
fileName := (ObjectMemory nameForSources). |
|
1693 | 2355 |
'src.tmp' asFilename renameTo:fileName. |
617 | 2356 |
|
2357 |
"good - now go over all changed methods, and change their |
|
2358 |
source reference" |
|
2359 |
||
2360 |
table keysAndValuesDo:[:aMethod :pos | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2361 |
aMethod localSourceFilename:fileName position:pos. |
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
2362 |
"/ aMethod printCR. |
617 | 2363 |
]. |
2364 |
||
2365 |
" |
|
2366 |
Smalltalk compressSources |
|
2367 |
" |
|
1693 | 2368 |
|
2176
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2369 |
"Modified: 16.1.1997 / 01:25:58 / cg" |
617 | 2370 |
! |
2371 |
||
3044 | 2372 |
generateSingleSourceFile |
2373 |
"{ Pragma: +optSpace }" |
|
2374 |
||
2375 |
"generate the sources file, and remove all method source strings |
|
2376 |
from the system and replace them by refs to a string in the source file. |
|
2377 |
This makes the image independent from the per-class source files |
|
2378 |
and makes transportation of endUser applications easier, since |
|
2379 |
only 3 files (executable, image and sourceFile) need to be |
|
2380 |
transported." |
|
2381 |
||
2382 |
|newStream table source pos fileName| |
|
2383 |
||
2384 |
newStream := 'src.tmp' asFilename writeStream. |
|
2385 |
newStream isNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2386 |
self error:'cannot create new temporary source file'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2387 |
^ self |
3044 | 2388 |
]. |
2389 |
||
2390 |
table := IdentityDictionary new:100. |
|
2391 |
||
2392 |
Method allSubInstancesDo:[:aMethod | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2393 |
source := aMethod source. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2394 |
source notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2395 |
pos := newStream position. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2396 |
newStream nextChunkPut:source. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2397 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2398 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2399 |
dont change the methods info - maybe some write error |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2400 |
occurs later, in that case we abort and leave everything |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2401 |
untouched. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2402 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2403 |
table at:aMethod put:pos |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2404 |
] |
3044 | 2405 |
]. |
2406 |
||
2407 |
newStream close. |
|
2408 |
||
2409 |
" |
|
2410 |
now, rename the new source file, |
|
2411 |
" |
|
2412 |
fileName := (ObjectMemory nameForSources). |
|
2413 |
'src.tmp' asFilename renameTo:fileName. |
|
2414 |
||
2415 |
"good - now go over all changed methods, and change their |
|
2416 |
source reference" |
|
2417 |
||
2418 |
table keysAndValuesDo:[:aMethod :pos | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2419 |
aMethod localSourceFilename:fileName position:pos. |
3044 | 2420 |
"/ aMethod printCR. |
2421 |
]. |
|
2422 |
||
2423 |
" |
|
2424 |
Smalltalk generateSingleSourceFile |
|
2425 |
" |
|
2426 |
||
2427 |
"Modified: 16.1.1997 / 01:25:58 / cg" |
|
2428 |
"Created: 17.10.1997 / 13:00:56 / cg" |
|
2429 |
! |
|
2430 |
||
2431 |
installAutoloadedClasses |
|
2432 |
"read the standard abbreviation file; install all classes found there as |
|
2433 |
autoloaded. This takes some time ..." |
|
2434 |
||
2435 |
self installAutoloadedClassesFrom:'include/abbrev.stc' |
|
2436 |
||
2437 |
" |
|
2438 |
Smalltalk installAutoloadedClasses |
|
2439 |
" |
|
2440 |
||
2441 |
"Modified: 10.1.1997 / 15:10:48 / cg" |
|
2442 |
"Created: 14.2.1997 / 17:32:57 / cg" |
|
2443 |
! |
|
2444 |
||
2445 |
installAutoloadedClassesFrom:anAbbrevFilePath |
|
2446 |
"read the given abbreviation file; install all classes found there as |
|
2447 |
autoloaded. This takes some time ..." |
|
2448 |
||
2449 |
|f s s2 l clsName abbrev package cat rev cls| |
|
2450 |
||
2451 |
f := self getSystemFileName:anAbbrevFilePath. |
|
2452 |
||
2453 |
f notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2454 |
s := f asFilename readStream. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2455 |
s notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2456 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2457 |
"/ yes, create any required nameSpace, without asking user. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2458 |
Class createNameSpaceQuerySignal answer:true do:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2459 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2460 |
[s atEnd] whileFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2461 |
l := s nextLine withoutSeparators. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2462 |
l notEmpty ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2463 |
s2 := l readStream. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2464 |
clsName := (s2 upTo:Character space) withoutSeparators asSymbol. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2465 |
(self at:clsName) isNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2466 |
s2 skipSeparators. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2467 |
abbrev := (s2 upTo:Character space) withoutSeparators asSymbol. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2468 |
s2 skipSeparators. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2469 |
package := (s2 upTo:Character space) withoutSeparators asSymbol. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2470 |
s2 skipSeparators. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2471 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2472 |
rev := nil. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2473 |
s2 skipSeparators. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2474 |
s2 atEnd ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2475 |
s2 peek isDigit ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2476 |
rev := (s2 upTo:Character space) withoutSeparators. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2477 |
s2 skipSeparators. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2478 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2479 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2480 |
cat := s2 upToEnd withoutSeparators. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2481 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2482 |
(cat startsWith:$') ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2483 |
cat := (cat copyFrom:2 to:(cat size - 1)) withoutSeparators. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2484 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2485 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2486 |
(cat isNil or:[cat isEmpty]) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2487 |
cat := 'autoloaded' |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2488 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2489 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2490 |
"/ ' autoloaded: ' print. clsName print. ' in ' print. cat printCR. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2491 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2492 |
"/ install if not already compiled-in |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2493 |
Autoload subclass:clsName |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2494 |
instanceVariableNames:'' |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2495 |
classVariableNames:'' |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2496 |
poolDictionaries:'' |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2497 |
category:cat |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2498 |
inEnvironment:Smalltalk. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2499 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2500 |
cls := self at:clsName. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2501 |
cls isNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2502 |
('Smalltalk [warning]: failed to add ' , clsName , ' as autoloaded.') infoPrintCR. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2503 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2504 |
cls package:package asSymbol. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2505 |
rev notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2506 |
cls setBinaryRevision:rev |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2507 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2508 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2509 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2510 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2511 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2512 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2513 |
s close. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2514 |
]. |
3044 | 2515 |
] |
2516 |
||
2517 |
" |
|
2518 |
Smalltalk installAutoloadedClassesFrom:'include/abbrev.stc' |
|
2519 |
" |
|
2520 |
||
2521 |
"Modified: 10.2.1997 / 12:22:44 / cg" |
|
2522 |
! |
|
2523 |
||
2524 |
loadBinaries |
|
2525 |
"return true, if binaries should be loaded into the system, |
|
2526 |
false if this should be suppressed. The default is false (for now)." |
|
2527 |
||
2528 |
^ LoadBinaries |
|
2529 |
! |
|
2530 |
||
2531 |
loadBinaries:aBoolean |
|
2532 |
"{ Pragma: +optSpace }" |
|
2533 |
||
2534 |
"turn on/off loading of binary objects" |
|
2535 |
||
2536 |
aBoolean ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2537 |
(ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2538 |
LoadBinaries := true. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2539 |
^ self |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2540 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2541 |
'Smalltalk [info]: this system does not support binary loading' infoPrintCR. |
617 | 2542 |
]. |
3044 | 2543 |
LoadBinaries := false |
2544 |
||
2545 |
"Modified: 10.1.1997 / 15:11:00 / cg" |
|
2546 |
! |
|
2547 |
||
2548 |
logDoits |
|
2549 |
"return true if doits should go into the changes file |
|
2550 |
as well as changes - by default, this is off, since |
|
2551 |
it can blow up the changes file enormously ... |
|
2552 |
" |
|
2553 |
||
2554 |
^ LogDoits |
|
2555 |
||
2556 |
" |
|
2557 |
LogDoits := false |
|
2558 |
LogDoits := true |
|
2559 |
" |
|
2560 |
! |
|
2561 |
||
2562 |
logDoits:aBoolean |
|
2563 |
"{ Pragma: +optSpace }" |
|
2564 |
||
2565 |
"turn on/off logging of doits in the changes file. |
|
2566 |
By default, this is off, since it can blow up the |
|
2567 |
changes file enormously ... |
|
2568 |
" |
|
2569 |
||
2570 |
LogDoits := aBoolean |
|
2571 |
||
2572 |
! |
|
2573 |
||
2574 |
makeBytecodeMethods |
|
2575 |
"{ Pragma: +optSpace }" |
|
2576 |
||
2577 |
"walk over all methods and make each a bytecode method |
|
2578 |
iff it does not contain primitive C code. |
|
2579 |
Experimental and not yet used." |
|
2580 |
||
2581 |
|newStream table source pos fileName| |
|
2582 |
||
2583 |
Method allSubInstancesDo:[:aMethod | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2584 |
|newMethod| |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2585 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2586 |
aMethod hasPrimitiveCode ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2587 |
newMethod := aMethod asByteCodeMethod. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2588 |
newMethod ~~ aMethod ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2589 |
aMethod becomeSameAs:newMethod |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2590 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2591 |
]. |
3044 | 2592 |
]. |
2593 |
||
2594 |
" |
|
2595 |
Smalltalk makeBytecodeMethods |
|
2596 |
" |
|
2597 |
||
2598 |
"Modified: 16.1.1997 / 01:25:58 / cg" |
|
2599 |
"Created: 17.10.1997 / 13:52:19 / cg" |
|
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2600 |
! |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2601 |
|
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2602 |
saveEmergencyImage:aBoolean |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2603 |
"set/clear the flag which controls if ST/X should save an |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2604 |
emergency image in case of a broken display connection. |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2605 |
The default is true. |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2606 |
This may be useful, if you work with an unsecure display |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2607 |
(serial line), and want to have a chance of proceeding after |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2608 |
a crash. In multiheaded applications, this only affects |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2609 |
crashes of the master Display connection (the initial connection); |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2610 |
errors on other displays are reported to the views and treated |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2611 |
like window destroy from the windowManager." |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2612 |
|
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2613 |
SaveEmergencyImage := aBoolean |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2614 |
|
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2615 |
"Modified: / 24.10.1997 / 18:22:26 / cg" |
3083 | 2616 |
! |
2617 |
||
2618 |
underclaredPrefix |
|
2619 |
"the prefix used for undeclared variables" |
|
2620 |
||
2621 |
^ 'Undeclared:::' |
|
2622 |
||
2623 |
"Created: / 31.10.1997 / 01:13:10 / cg" |
|
3044 | 2624 |
! ! |
2625 |
||
2626 |
!Smalltalk class methodsFor:'system management-fileIn'! |
|
2627 |
||
2628 |
fileIn:aFileName |
|
2629 |
"read in the named file - look for it in some standard places; |
|
2630 |
return true if ok, false if failed" |
|
2631 |
||
2632 |
^ self fileIn:aFileName lazy:nil silent:nil logged:false |
|
2633 |
||
2634 |
" |
|
2635 |
Smalltalk fileIn:'source/TicTacToe.st' |
|
2636 |
" |
|
2637 |
||
2638 |
"Created: 28.10.1995 / 17:06:28 / cg" |
|
2639 |
! |
|
2640 |
||
2641 |
fileIn:aFileName lazy:lazy |
|
2642 |
"read in the named file - look for it in some standard places; |
|
2643 |
return true if ok, false if failed. |
|
2644 |
If lazy is true, no code is generated for methods, instead stubs |
|
2645 |
are created which compile themself when first executed. This allows |
|
2646 |
for much faster fileIn (but slows down the first execution later). |
|
2647 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
2648 |
code which is known to be syntactically correct." |
|
2649 |
||
2650 |
^ self fileIn:aFileName lazy:lazy silent:nil logged:false |
|
2651 |
||
2652 |
" |
|
2653 |
Smalltalk fileIn:'source/TicTacToe.st' lazy:true |
|
2654 |
" |
|
2655 |
||
2656 |
"Created: 28.10.1995 / 17:06:36 / cg" |
|
2657 |
! |
|
2658 |
||
2659 |
fileIn:aFileName lazy:lazy silent:silent |
|
2660 |
"read in the named file - look for it in some standard places; |
|
2661 |
return true if ok, false if failed. |
|
2662 |
If lazy is true, no code is generated for methods, instead stubs |
|
2663 |
are created which compile themself when first executed. This allows |
|
2664 |
for much faster fileIn (but slows down the first execution later). |
|
2665 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
2666 |
code which is known to be syntactically correct. |
|
2667 |
If silent is true, no compiler messages are output to the transcript. |
|
2668 |
Giving nil for silent/lazy will use the current settings." |
|
2669 |
||
2670 |
^ self fileIn:aFileName lazy:lazy silent:silent logged:false |
|
2671 |
||
2672 |
"Created: 28.10.1995 / 17:06:41 / cg" |
|
2673 |
! |
|
2674 |
||
2675 |
fileIn:aFileNameOrString lazy:lazy silent:silent logged:logged |
|
2676 |
"read in the named file - look for it in some standard places; |
|
2677 |
return true if ok, false if failed. |
|
2678 |
If lazy is true, no code is generated for methods, instead stubs |
|
2679 |
are created which compile themself when first executed. This allows |
|
2680 |
for much faster fileIn (but slows down the first execution later). |
|
2681 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
2682 |
code which is known to be syntactically correct. |
|
2683 |
If silent is true, no compiler messages are output to the transcript. |
|
2684 |
Giving nil for silent/lazy will use the current settings." |
|
2685 |
||
2686 |
|fileNameString aStream path morePath bos| |
|
2687 |
||
2688 |
fileNameString := aFileNameOrString asString. |
|
2689 |
||
2690 |
" |
|
2691 |
an object or shared object ? |
|
2692 |
" |
|
2693 |
(ObjectFileLoader notNil |
|
2694 |
and:[ObjectFileLoader hasValidBinaryExtension:fileNameString]) ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2695 |
LoadBinaries ifFalse:[^ false]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2696 |
path := self getBinaryFileName:fileNameString. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2697 |
path isNil ifTrue:[^ false]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2698 |
^ (ObjectFileLoader loadObjectFile:fileNameString) notNil |
3044 | 2699 |
]. |
2700 |
||
2701 |
(fileNameString asFilename hasSuffix:'cls') ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2702 |
BinaryObjectStorage notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2703 |
path := self getBinaryFileName:fileNameString. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2704 |
path isNil ifTrue:[^ false]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2705 |
aStream := path asFilename readStream. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2706 |
aStream notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2707 |
bos := BinaryObjectStorage onOld:aStream. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2708 |
bos next. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2709 |
bos close. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2710 |
^ true |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2711 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2712 |
^ false |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2713 |
] |
3044 | 2714 |
]. |
2715 |
||
2716 |
(fileNameString startsWith:'source/') ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2717 |
aStream := self sourceFileStreamFor:(fileNameString copyFrom:8) |
3044 | 2718 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2719 |
(fileNameString startsWith:'fileIn/') ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2720 |
aStream := self fileInFileStreamFor:(fileNameString copyFrom:8) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2721 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2722 |
aStream := self systemFileStreamFor:fileNameString. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2723 |
(aStream notNil and:[fileNameString includes:$/]) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2724 |
"/ temporarily prepend the files directory |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2725 |
"/ to the searchPath. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2726 |
"/ This allows fileIn-driver files to refer to local |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2727 |
"/ files via a relative path, and drivers to fileIn other |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2728 |
"/ drivers ... |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2729 |
morePath := aStream pathName asFilename directoryName. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2730 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2731 |
] |
3044 | 2732 |
]. |
2733 |
aStream isNil ifTrue:[^ false]. |
|
2734 |
^ self fileInStream:aStream lazy:lazy silent:silent logged:logged addPath:morePath |
|
2735 |
||
2736 |
" |
|
2737 |
Smalltalk fileIn:'source/TicTacToe.st' lazy:true silent:true |
|
2738 |
" |
|
2739 |
||
2740 |
"Modified: 8.1.1997 / 17:58:31 / cg" |
|
2741 |
! |
|
2742 |
||
2743 |
fileIn:aFileName logged:logged |
|
2744 |
"read in the named file - look for it in some standard places; |
|
2745 |
return true if ok, false if failed. |
|
2746 |
The argument logged controls, if the changefile is to be updated." |
|
2747 |
||
2748 |
^ self fileIn:aFileName lazy:nil silent:nil logged:logged |
|
2749 |
||
2750 |
" |
|
2751 |
Smalltalk fileIn:'source/TicTacToe.st' logged:false |
|
2752 |
" |
|
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2753 |
! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2754 |
|
1 | 2755 |
fileInChanges |
2756 |
"read in the last changes file - bringing the system to the state it |
|
70 | 2757 |
had when left the last time. |
2758 |
WARNING: this method is rubbish: it should only read things after the |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2759 |
last '**snapshot**' - entry |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2760 |
(instead of the complete changes file)." |
1 | 2761 |
|
70 | 2762 |
" |
400 | 2763 |
do NOT update the changes file now ... |
70 | 2764 |
" |
2928 | 2765 |
self fileIn:ChangeFileName logged:false |
1 | 2766 |
|
77 | 2767 |
" |
2768 |
Smalltalk fileInChanges |
|
2769 |
" |
|
1 | 2770 |
! |
2771 |
||
3044 | 2772 |
fileInClass:aClassName |
2773 |
"find a source/object file for aClassName and -if found - load it. |
|
2774 |
search is in some standard places trying driver-file (.ld), object-file (.o) and |
|
2775 |
finally source file (.st) in that order. |
|
2776 |
The file is first searched for using the class name, then the abbreviated name." |
|
2777 |
||
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2778 |
^ self |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2779 |
fileInClass:aClassName |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2780 |
package:nil |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2781 |
initialize:true |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2782 |
lazy:false |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2783 |
silent:nil |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2784 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2785 |
"Modified: / 9.1.1998 / 14:41:46 / cg" |
3044 | 2786 |
! |
2787 |
||
2788 |
fileInClass:aClassName fromObject:aFileName |
|
2789 |
"read in the named object file and dynamic-link it into the system |
|
2790 |
- look for it in some standard places. |
|
2791 |
Only install the named class from this object file. |
|
2792 |
Return true if ok, false if failed." |
|
2793 |
||
2794 |
|path ok| |
|
2795 |
||
2796 |
" |
|
2797 |
check if the dynamic loader class is in |
|
2798 |
" |
|
2799 |
(LoadBinaries not or:[ObjectFileLoader isNil]) ifTrue:[^ false]. |
|
2800 |
||
2801 |
(path := self getBinaryFileName:aFileName) isNil ifTrue:[^ false]. |
|
2802 |
ok := (ObjectFileLoader loadClass:aClassName fromObjectFile:path) notNil. |
|
2803 |
ok ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2804 |
SilentLoading ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2805 |
Transcript show:' loaded ' , aClassName , ' from ' ; showCR:aFileName. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2806 |
] |
3044 | 2807 |
]. |
2808 |
^ ok |
|
2809 |
||
2810 |
" |
|
2811 |
Smalltalk fileInClass:'AbstractPath' fromObject:'../../goodies/Paths/AbstrPath.so' |
|
2812 |
Smalltalk fileInClass:'ClockView' fromObject:'../../libwidg3/libwidg3.so' |
|
2813 |
" |
|
2814 |
||
2815 |
"Modified: 10.9.1996 / 20:43:52 / cg" |
|
2816 |
! |
|
2817 |
||
2818 |
fileInClass:aClassName initialize:doInit |
|
2819 |
"find a source/object file for aClassName and -if found - load it. |
|
2820 |
search is in some standard places trying driver-file (.ld), object-file (.o) and |
|
2821 |
finally source file (.st) in that order. |
|
2822 |
The file is first searched for using the class name, then the abbreviated name." |
|
2823 |
||
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2824 |
^ self |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2825 |
fileInClass:aClassName |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2826 |
package:nil |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2827 |
initialize:doInit |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2828 |
lazy:false |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2829 |
silent:nil |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2830 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2831 |
"Modified: / 9.1.1998 / 14:42:02 / cg" |
3044 | 2832 |
! |
2833 |
||
2834 |
fileInClass:aClassName initialize:doInit lazy:loadLazy |
|
2835 |
"find a source/object file for aClassName and -if found - load it. |
|
2836 |
search is in some standard places trying driver-file (.ld), object-file (.o) and |
|
2837 |
finally source file (.st) in that order. |
|
2838 |
The file is first searched for using the class name, then the abbreviated name." |
|
2839 |
||
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2840 |
^ self |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2841 |
fileInClass:aClassName |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2842 |
package:nil |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2843 |
initialize:doInit |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2844 |
lazy:loadLazy |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2845 |
silent:nil |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2846 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2847 |
"Modified: / 9.1.1998 / 14:42:19 / cg" |
3044 | 2848 |
! |
2849 |
||
2850 |
fileInClass:aClassName initialize:doInit lazy:loadLazy silent:beSilent |
|
2851 |
"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
|
2852 |
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
|
2853 |
finally source file (.st), in that order. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2854 |
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
|
2855 |
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
|
2856 |
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
|
2857 |
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
|
2858 |
nil uses the value from SilentLoading." |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2859 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2860 |
^ self |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2861 |
fileInClass:aClassName |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2862 |
package:nil |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2863 |
initialize:doInit |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2864 |
lazy:loadLazy |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2865 |
silent:beSilent |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2866 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2867 |
"Modified: / 9.1.1998 / 14:42:28 / cg" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2868 |
! |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2869 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2870 |
fileInClass:aClassName package:package initialize:doInit lazy:loadLazy silent:beSilent |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2871 |
"find a source/object file for aClassName and -if found - load it. |
3044 | 2872 |
This is the workhorse for autoloading. |
2873 |
Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and |
|
2874 |
finally source file (.st), in that order. |
|
2875 |
The file is first searched for using the class name, then the abbreviated name. |
|
2876 |
The argument doInit controlls if the class should be sent a #initialize after the |
|
2877 |
load; loadLazy tells if it should be loaded lazyly. beSilent tells if the compiler |
|
2878 |
should not send notes to the transcript; it can be true, false or nil, where |
|
2879 |
nil uses the value from SilentLoading." |
|
2880 |
||
2881 |
|shortName libName newClass ok wasLazy wasSilent sharedLibExtension inStream mgr fn| |
|
2882 |
||
2883 |
wasLazy := Compiler compileLazy:loadLazy. |
|
2884 |
beSilent notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2885 |
wasSilent := self silentLoading:beSilent. |
617 | 2886 |
]. |
3044 | 2887 |
|
2888 |
[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2889 |
Class withoutUpdatingChangesDo: |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2890 |
[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2891 |
ok := false. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2892 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2893 |
shortName := self fileNameForClass:aClassName. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2894 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2895 |
first, look for a loader-driver file (in fileIn/xxx.ld) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2896 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2897 |
(ok := self fileIn:('fileIn/' , shortName , '.ld') lazy:loadLazy silent:beSilent) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2898 |
ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2899 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2900 |
try abbreviated driver-file (in fileIn/xxx.ld) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2901 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2902 |
shortName ~= aClassName ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2903 |
ok := self fileIn:('fileIn/' , aClassName , '.ld') lazy:loadLazy silent:beSilent |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2904 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2905 |
ok ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2906 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2907 |
then, if dynamic linking is available, |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2908 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2909 |
(LoadBinaries and:[ObjectFileLoader notNil]) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2910 |
sharedLibExtension := ObjectFileLoader sharedLibraryExtension. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2911 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2912 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2913 |
first look for a class packages shared binary in binary/xxx.o |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2914 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2915 |
libName := self libraryFileNameOfClass:aClassName. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2916 |
libName notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2917 |
(ok := self fileInClass:aClassName fromObject:(libName, sharedLibExtension)) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2918 |
ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2919 |
sharedLibExtension ~= '.o' ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2920 |
ok := self fileInClass:aClassName fromObject:(libName, '.o') |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2921 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2922 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2923 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2924 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2925 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2926 |
then, look for a shared binary in binary/xxx.o |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2927 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2928 |
ok ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2929 |
(ok := self fileInClass:aClassName fromObject:(shortName, sharedLibExtension)) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2930 |
ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2931 |
sharedLibExtension ~= '.o' ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2932 |
ok := self fileInClass:aClassName fromObject:(shortName, '.o') |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2933 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2934 |
ok ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2935 |
shortName ~= aClassName ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2936 |
(ok := self fileInClass:aClassName fromObject:(aClassName, sharedLibExtension)) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2937 |
ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2938 |
sharedLibExtension ~= '.o' ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2939 |
ok := self fileInClass:aClassName fromObject:(aClassName, '.o') |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2940 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2941 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2942 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2943 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2944 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2945 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2946 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2947 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2948 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2949 |
if that did not work, look for a compiled-bytecode file ... |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2950 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2951 |
ok ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2952 |
(ok := self fileIn:(shortName , '.cls') lazy:loadLazy silent:beSilent) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2953 |
ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2954 |
shortName ~= aClassName ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2955 |
ok := self fileIn:(aClassName , '.cls') lazy:loadLazy silent:beSilent |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2956 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2957 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2958 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2959 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2960 |
if that did not work, and the classes package is known, |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2961 |
look for an st-cls file |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2962 |
in a package subdir of the source-directory ... |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2963 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2964 |
ok ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2965 |
package notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2966 |
(ok := self fileIn:(package , '/' , shortName , '.cls') lazy:loadLazy silent:beSilent) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2967 |
ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2968 |
shortName ~= aClassName ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2969 |
ok := self fileIn:(package , '/' , aClassName , '.cls') lazy:loadLazy silent:beSilent |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2970 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2971 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2972 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2973 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2974 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2975 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2976 |
if that did not work, look for an st-source file ... |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2977 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2978 |
ok ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2979 |
fn := shortName , '.st'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2980 |
(ok := self fileIn:fn lazy:loadLazy silent:beSilent) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2981 |
ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2982 |
shortName ~= aClassName ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2983 |
fn := aClassName , '.st'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2984 |
ok := self fileIn:fn lazy:loadLazy silent:beSilent |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2985 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2986 |
ok ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2987 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2988 |
... and in the standard source-directory |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2989 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2990 |
fn := 'source/' , shortName , '.st'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2991 |
(ok := self fileIn:fn lazy:loadLazy silent:beSilent) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2992 |
ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2993 |
shortName ~= aClassName ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2994 |
fn := 'source/' , aClassName , '.st'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2995 |
ok := self fileIn:fn lazy:loadLazy silent:beSilent |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2996 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2997 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2998 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
2999 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3000 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3001 |
if that did not work, and the classes package is known, |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3002 |
look for an st-source file |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3003 |
in a package subdir of the source-directory ... |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3004 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3005 |
ok ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3006 |
package notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3007 |
fn := package , '/' , shortName , '.st'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3008 |
(ok := self fileIn:fn lazy:loadLazy silent:beSilent) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3009 |
ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3010 |
shortName ~= aClassName ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3011 |
fn := package , '/' , aClassName , '.st'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3012 |
ok := self fileIn:fn lazy:loadLazy silent:beSilent |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3013 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3014 |
ok ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3015 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3016 |
... and in the standard source-directory |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3017 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3018 |
fn := 'source/' , package , '/' , shortName , '.st'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3019 |
(ok := self fileIn:fn lazy:loadLazy silent:beSilent) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3020 |
ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3021 |
shortName ~= aClassName ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3022 |
fn := 'source/' , package , '/' , aClassName , '.st'. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3023 |
ok := self fileIn:fn lazy:loadLazy silent:beSilent |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3024 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3025 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3026 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3027 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3028 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3029 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3030 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3031 |
ok ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3032 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3033 |
new: if there is a sourceCodeManager, ask it for the classes sourceCode |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3034 |
" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3035 |
(mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3036 |
inStream := mgr getMostRecentSourceStreamForClassNamed:aClassName. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3037 |
inStream notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3038 |
fn := nil. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3039 |
ok := self fileInStream:inStream lazy:loadLazy silent:beSilent logged:false addPath:nil. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3040 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3041 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3042 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3043 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3044 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3045 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3046 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3047 |
ok ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3048 |
newClass := self at:(aClassName asSymbol). |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3049 |
newClass notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3050 |
fn notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3051 |
newClass classFilename isNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3052 |
newClass setClassFilename:fn |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3053 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3054 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3055 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3056 |
doInit ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3057 |
newClass initialize |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3058 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3059 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3060 |
]. |
3044 | 3061 |
] valueNowOrOnUnwindDo:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3062 |
Compiler compileLazy:wasLazy. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3063 |
wasSilent notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3064 |
self silentLoading:wasSilent |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3065 |
] |
3044 | 3066 |
]. |
3067 |
||
3068 |
^ newClass |
|
3069 |
||
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3070 |
"Created: / 9.1.1998 / 14:40:32 / cg" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3071 |
"Modified: / 9.1.1998 / 14:46:00 / cg" |
3044 | 3072 |
! |
3073 |
||
3074 |
fileInClassLibrary:aClassLibraryName |
|
3075 |
"find an object file containing a binary class library in some standard places |
|
3076 |
and load it. This install all of its contained classes. |
|
3077 |
Return true if ok, false if not." |
|
3078 |
||
3079 |
ObjectFileLoader isNil ifTrue:[^ false]. |
|
3080 |
^ (ObjectFileLoader |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3081 |
loadObjectFile:(aClassLibraryName , (ObjectFileLoader sharedLibraryExtension)) |
3044 | 3082 |
) notNil |
3083 |
||
3084 |
" |
|
3085 |
Smalltalk fileInClassLibrary:'libtable' |
|
3086 |
Smalltalk fileInClassLibrary:'binary/libwidg3' |
|
3087 |
" |
|
3088 |
||
3089 |
"Modified: 8.1.1997 / 17:58:56 / cg" |
|
617 | 3090 |
! |
3091 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3092 |
fileInStream:aStream lazy:lazy silent:silent logged:logged addPath:morePath |
617 | 3093 |
"read sourceCode from aStream; |
3094 |
return true if ok, false if failed. |
|
878
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
3095 |
If lazy is true, no code is generated for methods, instead stubs |
617 | 3096 |
are created which compile themself when first executed. This allows |
3097 |
for much faster fileIn (but slows down the first execution later). |
|
3098 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
3099 |
code which is known to be syntactically correct. |
|
3100 |
If silent is true, no compiler messages are output to the transcript. |
|
3101 |
Giving nil for silent/lazy will use the current settings. |
|
3102 |
If morePath is nonNil, it is prepended to the systemPath temporarily during the |
|
3103 |
fileIn. This allows for st-expressions to refer to more files (i.e. fileIn more) |
|
3104 |
using a relative path." |
|
3105 |
||
3106 |
|wasLazy wasSilent oldSystemPath oldRealPath| |
|
3107 |
||
3108 |
aStream isNil ifTrue:[^ false]. |
|
3109 |
||
3110 |
lazy notNil ifTrue:[wasLazy := Compiler compileLazy:lazy]. |
|
3111 |
silent notNil ifTrue:[wasSilent := self silentLoading:silent]. |
|
3112 |
[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3113 |
Class updateChangeFileQuerySignal answer:logged do:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3114 |
oldSystemPath := SystemPath copy. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3115 |
morePath notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3116 |
SystemPath addFirst:morePath. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3117 |
oldRealPath := RealSystemPath. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3118 |
RealSystemPath := nil. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3119 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3120 |
aStream fileIn |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3121 |
] |
617 | 3122 |
] valueNowOrOnUnwindDo:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3123 |
morePath notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3124 |
SystemPath := oldSystemPath. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3125 |
RealSystemPath := oldRealPath. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3126 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3127 |
lazy notNil ifTrue:[Compiler compileLazy:wasLazy]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3128 |
silent notNil ifTrue:[self silentLoading:wasSilent]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3129 |
aStream close |
617 | 3130 |
]. |
3131 |
^ true |
|
3132 |
||
3133 |
" |
|
3134 |
Smalltalk fileInStream:('source/TicTacToe.st' asFilename readStream) lazy:true silent:true |
|
3135 |
" |
|
1896 | 3136 |
|
3137 |
"Modified: 5.11.1996 / 20:03:35 / cg" |
|
617 | 3138 |
! |
3139 |
||
3044 | 3140 |
loadClassLibraryIfAbsent:name |
3141 |
"dynamically load a classLibrary, if not already loaded |
|
3142 |
and the system supports dynamic loading. |
|
3143 |
Return true, if the library is loaded, false if not. |
|
3144 |
This entry is called without system specific filename |
|
3145 |
extensions - it is portable among different architectures |
|
3146 |
as long as corresponding files (x.so / x.dll / x.sl / x.o) |
|
3147 |
are be present ..." |
|
3148 |
||
3149 |
ObjectMemory |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3150 |
binaryModuleInfo |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3151 |
do:[:entry | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3152 |
entry type == #classLibrary ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3153 |
entry libraryName = name ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3154 |
^ true "/ already loaded |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3155 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3156 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3157 |
]. |
3044 | 3158 |
|
3159 |
^ self fileInClassLibrary:name |
|
3160 |
||
3161 |
" |
|
3162 |
Smalltalk loadClassLibraryIfAbsent:'libbasic' |
|
3163 |
Smalltalk loadClassLibraryIfAbsent:'libwidg3' |
|
3164 |
" |
|
3165 |
||
3166 |
"Modified: 31.10.1996 / 16:57:24 / cg" |
|
3167 |
! |
|
3168 |
||
3169 |
secureFileIn:aFileName |
|
3170 |
"read in the named file, looking for it at standard places. |
|
3171 |
Catch any error during fileIn. Return true if ok, false if failed" |
|
3172 |
||
3173 |
|retVal| |
|
3174 |
||
3175 |
retVal := false. |
|
3176 |
||
3177 |
(SignalSet with:AbortSignal with:Process terminateSignal) |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3178 |
handle:[:ex | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3179 |
ex return |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3180 |
] do:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3181 |
retVal := self fileIn:aFileName |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3182 |
]. |
3044 | 3183 |
^ retVal |
3184 |
! |
|
3185 |
||
3186 |
silentFileIn:aFilename |
|
3187 |
"same as fileIn:, but do not output 'compiled...'-messages on Transcript. |
|
3188 |
Main use is during startup." |
|
3189 |
||
3190 |
|wasSilent| |
|
3191 |
||
3192 |
wasSilent := self silentLoading:true. |
|
3193 |
[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3194 |
self fileIn:aFilename |
3044 | 3195 |
] valueNowOrOnUnwindDo:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3196 |
self silentLoading:wasSilent |
3044 | 3197 |
] |
3198 |
! ! |
|
3199 |
||
3200 |
!Smalltalk class methodsFor:'system management-files'! |
|
3201 |
||
3202 |
bitmapFileStreamFor:aFileName |
|
3203 |
"search aFileName in some standard places; |
|
3204 |
return a readonly fileStream or nil if not found. |
|
3205 |
Searches in subdirectories named 'bitmaps' in SystemPath" |
|
3206 |
||
3207 |
|aString| |
|
3208 |
||
3209 |
aString := self getBitmapFileName:aFileName. |
|
3210 |
aString notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3211 |
^ aString asFilename readStream |
3044 | 3212 |
]. |
3213 |
^ nil |
|
3214 |
! |
|
3215 |
||
3216 |
classNameForFile:aFileName |
|
3217 |
"return the className which corresponds to an abbreviated fileName, |
|
3218 |
or nil if no special translation applies. The given filename arg may |
|
3219 |
include a '.st' suffix (but no other)." |
|
3220 |
||
3221 |
|fn| |
|
3222 |
||
3223 |
(aFileName asFilename hasSuffix:'st') ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3224 |
fn := aFileName copyWithoutLast:3 |
3044 | 3225 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3226 |
fn := aFileName |
3044 | 3227 |
]. |
3228 |
^ self filenameAbbreviations keyAtEqualValue:fn ifAbsent:[fn]. |
|
3229 |
||
3230 |
" |
|
3231 |
Smalltalk classNameForFile:'DrawObj' |
|
3232 |
Smalltalk classNameForFile:'DrawObj.st' |
|
3233 |
Smalltalk classNameForFile:'ArrColl.st' |
|
3234 |
Smalltalk classNameForFile:'ArrColl.chg' |
|
3235 |
" |
|
3236 |
||
3237 |
"Modified: 11.12.1995 / 14:51:10 / cg" |
|
3238 |
! |
|
3239 |
||
3240 |
constructPathFor:aDirectoryName |
|
3241 |
"search for aDirectory in SystemPath; |
|
3242 |
return a collection of pathes which include that directory." |
|
3243 |
||
3244 |
^ self realSystemPath select:[:dirName | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3245 |
|fullPath| |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3246 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3247 |
fullPath := dirName asFilename construct:aDirectoryName. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3248 |
"/ fullPath exists and:[fullPath isDirectory and:[fullPath isReadable]] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3249 |
fullPath isDirectory and:[fullPath isReadable] |
3044 | 3250 |
]. |
3251 |
! |
|
3252 |
||
3253 |
fileInFileStreamFor:aFileName |
|
3254 |
"search aFileName in some standard places; |
|
3255 |
return a readonly fileStream or nil if not found. |
|
3256 |
Searches in subdirectories named 'fileIn' in SystemPath" |
|
3257 |
||
3258 |
|aString| |
|
3259 |
||
3260 |
aString := self getFileInFileName:aFileName. |
|
3261 |
aString notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3262 |
^ aString asFilename readStream |
3044 | 3263 |
]. |
3264 |
^ nil |
|
3265 |
! |
|
3266 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3267 |
fileNameForClass:aClassOrClassName |
617 | 3268 |
"return a good filename for aClassOrClassName - |
3269 |
using the abbreviation file if there is one" |
|
3270 |
||
3271 |
|fileName abbrev aClassName| |
|
3272 |
||
3273 |
||
3274 |
aClassOrClassName isBehavior ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3275 |
aClassOrClassName isMeta ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3276 |
aClassName := aClassOrClassName soleInstance name |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3277 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3278 |
aClassName := aClassOrClassName name |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3279 |
] |
617 | 3280 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3281 |
aClassName := aClassOrClassName |
617 | 3282 |
]. |
3283 |
||
3284 |
fileName := aClassName asSymbol. |
|
3285 |
||
3286 |
"first look, if the class exists and has a fileName" |
|
3287 |
||
3288 |
" later ... - compiler should put the source file name into the class |
|
3289 |
(Symbol hasInterned:aClassName) ifTrue:[:sym | |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3290 |
|class| |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3291 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3292 |
(Smalltalk includesKey:sym) ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3293 |
class := Smalltalk at:sym. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3294 |
class isClass ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3295 |
abbrev := class classFileName. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3296 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3297 |
] |
617 | 3298 |
]. |
3299 |
" |
|
3300 |
||
3301 |
"look for abbreviation" |
|
3302 |
||
3303 |
abbrev := self filenameAbbreviations at:fileName ifAbsent:[nil]. |
|
3304 |
abbrev notNil ifTrue:[^ abbrev]. |
|
3305 |
||
3306 |
"no abbreviation found - if its a short name, take it" |
|
3307 |
||
3308 |
OperatingSystem maxFileNameLength < (fileName size + 3) ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3309 |
"this will only be triggered on sys5.3/DOS type systems" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3310 |
self warn:'cant find short for ' , fileName , ' in abbreviation file' |
617 | 3311 |
]. |
3312 |
^ fileName asString |
|
3313 |
||
3314 |
" |
|
3315 |
Smalltalk fileNameForClass:SmallInteger |
|
3316 |
Smalltalk fileNameForClass:'SmallInteger' |
|
3317 |
Smalltalk fileNameForClass:'OperatingSystem' |
|
3318 |
Smalltalk fileNameForClass:'SomeUnknownClass' |
|
3319 |
" |
|
3320 |
||
3321 |
"Modified: 6.11.1995 / 15:37:33 / cg" |
|
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
3322 |
! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
3323 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3324 |
filenameAbbreviations |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3325 |
"return a dictionary containing the classname-to-filename |
617 | 3326 |
mappings. (needed for sys5.3 users, where filenames are limited |
3327 |
to 14 chars)" |
|
3328 |
||
3329 |
CachedAbbreviations isNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3330 |
self readAbbreviations |
617 | 3331 |
]. |
3332 |
^ CachedAbbreviations |
|
3333 |
||
3334 |
"flush with: |
|
3335 |
||
3336 |
CachedAbbreviations := nil |
|
3337 |
" |
|
3338 |
" |
|
3339 |
Smalltalk filenameAbbreviations |
|
3340 |
" |
|
3341 |
! |
|
3342 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3343 |
flushPathCaches |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3344 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3345 |
|
2378 | 3346 |
"forget pathCaches - these are collections containing valid directory names, |
3347 |
where system files (resource, bitmaps etc.) are found. |
|
3348 |
A flush is only required, if a new system directory has been created while |
|
3349 |
the system is active, and those files should override the others |
|
3350 |
(for example, if you created a private resource directory)" |
|
3351 |
||
617 | 3352 |
RealSystemPath := ResourcePath := SourcePath := BitmapPath := BinaryPath := FileInPath := nil |
2378 | 3353 |
|
3354 |
" |
|
3355 |
Smalltalk flushPathCaches |
|
3356 |
" |
|
617 | 3357 |
! |
3358 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3359 |
getBinaryFileName:aFileName |
617 | 3360 |
"search aFileName in some standard places |
3361 |
(subdirectories named 'binary' in SystemPath); |
|
3362 |
return the absolute filename or nil if none is found." |
|
3363 |
||
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3364 |
BinaryPath isNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3365 |
BinaryPath := self constructPathFor:BinaryDirName |
617 | 3366 |
]. |
3367 |
||
2928 | 3368 |
^ 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
|
3369 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3370 |
"Modified: 18.7.1996 / 15:53:49 / cg" |
453 | 3371 |
! |
3372 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3373 |
getBitmapFileName:aFileName |
617 | 3374 |
"search aFileName in some standard places |
3375 |
(subdirectories named 'bitmaps' in SystemPath); |
|
3376 |
return the absolute filename or nil if none is found." |
|
3377 |
||
2974 | 3378 |
|f| |
3379 |
||
617 | 3380 |
BitmapPath isNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3381 |
BitmapPath := self constructPathFor:BitmapDirName |
617 | 3382 |
]. |
3383 |
||
2974 | 3384 |
"/ first, try a bitmaps subdir along the path. |
3385 |
f := self searchPath:BitmapPath for:aFileName in:BitmapDirName. |
|
3386 |
f isNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3387 |
"/ then, try it itself along the path. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3388 |
f := self searchPath:RealSystemPath for:aFileName in:nil |
2974 | 3389 |
]. |
3390 |
^ f |
|
617 | 3391 |
|
3392 |
" |
|
3393 |
Smalltalk getBitmapFileName:'SBrowser.xbm' |
|
3394 |
" |
|
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3395 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3396 |
"Modified: 18.7.1996 / 15:53:55 / cg" |
617 | 3397 |
! |
3398 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3399 |
getFileInFileName:aFileName |
617 | 3400 |
"search aFileName in some standard places |
3401 |
(subdirectories named 'fileIn' in SystemPath); |
|
3402 |
return the absolute filename or nil if none is found." |
|
3403 |
||
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3404 |
FileInPath isNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3405 |
FileInPath := self constructPathFor:FileInDirName |
617 | 3406 |
]. |
3407 |
||
2928 | 3408 |
^ self searchPath:FileInPath for:aFileName in:FileInDirName |
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3409 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3410 |
"Modified: 18.7.1996 / 15:53:59 / cg" |
617 | 3411 |
! |
3412 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3413 |
getResourceFileName:aFileName |
617 | 3414 |
"search aFileName in some standard places |
3415 |
(subdirectories named 'resource' in SystemPath); |
|
3416 |
return the absolute filename or nil if none is found." |
|
3417 |
||
2974 | 3418 |
|f| |
3419 |
||
617 | 3420 |
ResourcePath isNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3421 |
ResourcePath := self constructPathFor:ResourceDirName |
617 | 3422 |
]. |
3423 |
||
2974 | 3424 |
"/ first, try a resource subdir along the path. |
3425 |
f := self searchPath:ResourcePath for:aFileName in:ResourceDirName. |
|
3426 |
f isNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3427 |
"/ then, try it itself along the path. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3428 |
f := self searchPath:RealSystemPath for:aFileName in:nil |
2974 | 3429 |
]. |
3430 |
^ f |
|
617 | 3431 |
|
3432 |
" |
|
3433 |
Smalltalk getResourceFileName:'SBrowser.rs' |
|
3434 |
" |
|
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3435 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3436 |
"Modified: 18.7.1996 / 15:54:03 / cg" |
617 | 3437 |
! |
3438 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3439 |
getSourceFileName:aFileName |
617 | 3440 |
"search aFileName in some standard places |
3441 |
(subdirectories named 'source' in SystemPath); |
|
736 | 3442 |
return the absolute filename or nil if none is found. |
3443 |
This is used to find a sourceFile for a methods source, |
|
3444 |
if no sourceCodeManager is available." |
|
617 | 3445 |
|
2959 | 3446 |
|f| |
3447 |
||
617 | 3448 |
SourcePath isNil ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3449 |
SourcePath := self constructPathFor:SourceDirName |
617 | 3450 |
]. |
3451 |
||
2959 | 3452 |
"/ first, try a source subdir along the path. |
3453 |
f := self searchPath:SourcePath for:aFileName in:SourceDirName. |
|
3454 |
f isNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3455 |
"/ then, try it itself along the path. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3456 |
f := self searchPath:RealSystemPath for:aFileName in:nil |
2959 | 3457 |
]. |
3458 |
^ f |
|
191 | 3459 |
|
3460 |
" |
|
736 | 3461 |
Smalltalk getSourceFileName:'Smalltalk.st' |
3462 |
Smalltalk getSourceFileName:'ArrColl.st' |
|
191 | 3463 |
" |
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3464 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3465 |
"Modified: 18.7.1996 / 15:54:07 / cg" |
617 | 3466 |
! |
3467 |
||
2896 | 3468 |
getSystemFileName:aFileNameOrString |
3469 |
"search aFileNameOrString in some standard places; |
|
617 | 3470 |
return the absolute filename or nil if none is found. |
3471 |
see comment in Smalltalk>>initSystemPath." |
|
3472 |
||
3473 |
"credits for this method go to Markus ...." |
|
3474 |
||
2933 | 3475 |
|fn nameString| |
2896 | 3476 |
|
3477 |
fn := aFileNameOrString asFilename. |
|
2933 | 3478 |
nameString := fn name. |
2896 | 3479 |
fn isAbsolute ifTrue:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3480 |
"dont use path for absolute file names" |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3481 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3482 |
^ nameString |
191 | 3483 |
]. |
3484 |
||
617 | 3485 |
self realSystemPath do:[:dirName | |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3486 |
|realName| |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3487 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3488 |
realName := dirName asFilename construct:nameString. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3489 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3490 |
"/ here, we also return true if its a directory |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3491 |
"/ (Even if unreadable). |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3492 |
"/ It could be that the file itself is still readable. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3493 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3494 |
(realName isDirectory or:[realName isReadable]) ifTrue: [ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3495 |
^ realName name |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3496 |
] |
191 | 3497 |
]. |
617 | 3498 |
^ nil |
3499 |
! |
|
3500 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3501 |
libraryFileNameOfClass:aClassOrClassName |
617 | 3502 |
"for a given class, return the name of a classLibrary which contains |
3503 |
binary code for it. |
|
3504 |
Read the libinfo file 'liblist.stc' (which is created during the compilation process) |
|
3505 |
for an entry for aClassOrClassName. |
|
3506 |
Search for the className in the first col, and return the value found in |
|
3507 |
the 2nd col. |
|
3508 |
Return nil if no entry is found. |
|
3509 |
||
3510 |
A nil returns means that this class is either built-in or not present |
|
3511 |
in a package-class library (i.e. either as separate .o or separate .st file). |
|
3512 |
Otherwise, the returned name is the classLibrary object of that class. |
|
3513 |
The classes code can be loaded from that file if binary loading is supported." |
|
3514 |
||
3515 |
|aStream line words n aClassName| |
|
3516 |
||
3517 |
aClassOrClassName isBehavior ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3518 |
aClassName := aClassOrClassName name |
617 | 3519 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3520 |
aClassName := aClassOrClassName |
617 | 3521 |
]. |
3522 |
aClassName := aClassName asString. |
|
3523 |
||
3524 |
#('include/liblist.stc') "/ filenames |
|
3525 |
with:#(2) "/ column |
|
3526 |
do:[:fileName :col | |
|
3527 |
||
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3528 |
aStream := self systemFileStreamFor:fileName. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3529 |
aStream notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3530 |
[aStream atEnd] whileFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3531 |
line := aStream nextLine. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3532 |
line notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3533 |
(line startsWith:'#') ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3534 |
words := line asCollectionOfWords. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3535 |
(n := words size) > 1 ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3536 |
(words at:1) = aClassName ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3537 |
n >= col ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3538 |
aStream close. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3539 |
^ (words at:col) withoutSeparators |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3540 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3541 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3542 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3543 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3544 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3545 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3546 |
aStream close |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3547 |
]. |
617 | 3548 |
]. |
3549 |
||
3550 |
^ nil |
|
3551 |
||
3552 |
" |
|
3553 |
Smalltalk libraryFileNameOfClass:'ClockView' |
|
3554 |
Smalltalk libraryFileNameOfClass:'Bag' |
|
3555 |
" |
|
3556 |
||
3557 |
"Modified: 6.11.1995 / 15:41:39 / cg" |
|
3558 |
! |
|
3559 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3560 |
readAbbreviations |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3561 |
"read classname to filename mappings from include/abbrev.stc. |
617 | 3562 |
sigh - all for those poor sys5.3 or MSDOS people with short filenames ..." |
3563 |
||
1131
c12018d50e2d
more checks for abbreviation conflicts
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
3564 |
|abbrevs aStream line words nm abbrev key oldAbbrev cls| |
617 | 3565 |
|
3566 |
CachedAbbreviations := abbrevs := IdentityDictionary new. |
|
3567 |
aStream := self systemFileStreamFor:'include/abbrev.stc'. |
|
3568 |
aStream notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3569 |
[aStream atEnd] whileFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3570 |
line := aStream nextLine. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3571 |
line notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3572 |
(line startsWith:'#') ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3573 |
words := line asCollectionOfWords. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3574 |
words size >= 2 ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3575 |
nm := (words at:1) withoutSeparators. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3576 |
abbrev := (words at:2) withoutSeparators. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3577 |
nm ~= abbrev ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3578 |
key := nm asSymbol. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3579 |
oldAbbrev := abbrevs at:key ifAbsent:nil. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3580 |
oldAbbrev notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3581 |
oldAbbrev ~= abbrev ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3582 |
StandAlone ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3583 |
('Smalltalk [warning]: conflict for: ' , nm , ' in abbrev.stc (' , oldAbbrev , ' <-> ' , abbrev , ')') infoPrintCR |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3584 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3585 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3586 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3587 |
cls := self classNamed:abbrev. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3588 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3589 |
cls notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3590 |
cls name ~= nm ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3591 |
"/ ok, there is a class named after this abbrev ... |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3592 |
"/ this is only a conflict, if the other class has no |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3593 |
"/ abbreviation (or the same). |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3594 |
(abbrevs at:(cls name asSymbol) ifAbsent:cls name) = abbrev ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3595 |
cls isNamespace ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3596 |
StandAlone ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3597 |
('Smalltalk [warning]: conflict for: ' , cls name , ' in abbrev.stc (' , nm , ' -> ' , abbrev , ')') infoPrintCR |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3598 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3599 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3600 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3601 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3602 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3603 |
abbrevs at:nm asSymbol put:abbrev. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3604 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3605 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3606 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3607 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3608 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3609 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3610 |
aStream close |
617 | 3611 |
]. |
3612 |
^ abbrevs |
|
191 | 3613 |
|
3614 |
" |
|
617 | 3615 |
Smalltalk readAbbreviations |
191 | 3616 |
" |
617 | 3617 |
|
2123 | 3618 |
"Modified: 10.1.1997 / 15:11:28 / cg" |
617 | 3619 |
! |
3620 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3621 |
realSystemPath |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3622 |
"return the realSystemPath - thats the directorynames from |
617 | 3623 |
SystemPath which exist and are readable" |
3624 |
||
3625 |
RealSystemPath isNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3626 |
OperatingSystem isVMSlike ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3627 |
"/ temporary kludge: since we cannot currently |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3628 |
"/ check for existance of a name like 'volume:', |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3629 |
"/ leave those in the Path without a check. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3630 |
RealSystemPath := SystemPath select:[:dirName | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3631 |
|f| |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3632 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3633 |
f := dirName asFilename. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3634 |
f isVolumeOnly ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3635 |
true |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3636 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3637 |
(f isDirectory) and:[f isReadable] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3638 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3639 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3640 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3641 |
RealSystemPath := SystemPath select:[:dirName | |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3642 |
|f| |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3643 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3644 |
f := dirName asFilename. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3645 |
(f isDirectory) and:[f isReadable] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3646 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3647 |
]. |
617 | 3648 |
]. |
3649 |
^ RealSystemPath |
|
3650 |
! |
|
3651 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3652 |
resourceFileStreamFor:aFileName |
617 | 3653 |
"search aFileName in some standard places; |
3654 |
return a readonly fileStream or nil if not found. |
|
3655 |
Searches in subdirectories named 'resource' in SystemPath" |
|
3656 |
||
3657 |
|aString| |
|
3658 |
||
3659 |
aString := self getResourceFileName:aFileName. |
|
3660 |
aString notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3661 |
^ aString asFilename readStream |
617 | 3662 |
]. |
3663 |
^ nil |
|
3664 |
! |
|
3665 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3666 |
searchPath:aPath for:aFileName in:aDirName |
617 | 3667 |
"search aPath for a subdirectory named aDirectory with a file |
3668 |
named aFileName" |
|
3669 |
||
2928 | 3670 |
|f| |
3671 |
||
3672 |
((f := aFileName asFilename) isAbsolute |
|
3673 |
or:[f isExplicitRelative]) ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3674 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3675 |
"/ dont use path for absolute or explicit .-relative file names |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3676 |
"/ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3677 |
^ aFileName |
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3678 |
]. |
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3679 |
|
617 | 3680 |
aPath do:[:dirName | |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3681 |
|realName| |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3682 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3683 |
aDirName notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3684 |
realName := (dirName asFilename construct:aDirName) constructString:aFileName. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3685 |
] ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3686 |
realName := dirName asFilename constructString:aFileName. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3687 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3688 |
realName asFilename isReadable ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3689 |
^ realName |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3690 |
] |
617 | 3691 |
]. |
3692 |
^ nil |
|
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3693 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3694 |
"Modified: 18.7.1996 / 15:53:35 / cg" |
617 | 3695 |
! |
3696 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3697 |
sourceDirectoryNameOfClass:aClassOrClassName |
617 | 3698 |
"for a given class, return the pathname relative to TOP of the classes source code. |
728
50cf1c907c28
again search liblist for a classes source directory
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3699 |
Read the files 'abbrev.stc' and 'liblist.stc' (which are created during the compilation process) |
617 | 3700 |
for an entry for aClassOrClassName. |
3701 |
Search for the className in the first col, and return the value found in |
|
3702 |
the 3rd col. |
|
3703 |
Return nil if no entry is found." |
|
3704 |
||
3705 |
|aStream line words n aClassName| |
|
3706 |
||
3707 |
aClassOrClassName isBehavior ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3708 |
aClassName := aClassOrClassName name |
617 | 3709 |
] ifFalse:[ |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3710 |
aClassName := aClassOrClassName |
191 | 3711 |
]. |
617 | 3712 |
aClassName := aClassName asString. |
3713 |
||
728
50cf1c907c28
again search liblist for a classes source directory
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3714 |
#('include/abbrev.stc' 'include/liblist.stc') "/ filenames |
50cf1c907c28
again search liblist for a classes source directory
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3715 |
with:#(3 2) "/ column |
617 | 3716 |
do:[:fileName :col | |
3717 |
||
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3718 |
aStream := self systemFileStreamFor:fileName. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3719 |
aStream notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3720 |
[aStream atEnd] whileFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3721 |
line := aStream nextLine. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3722 |
line notNil ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3723 |
(line startsWith:'#') ifFalse:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3724 |
words := line asCollectionOfWords. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3725 |
(n := words size) > 1 ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3726 |
(words at:1) = aClassName ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3727 |
n >= col ifTrue:[ |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3728 |
aStream close. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3729 |
^ (words at:col) withoutSeparators |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3730 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3731 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3732 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3733 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3734 |
] |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3735 |
]. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3736 |
aStream close |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3737 |
]. |
617 | 3738 |
]. |
3739 |
||
3740 |
^ nil |
|
191 | 3741 |
|
3742 |
" |
|
617 | 3743 |
Smalltalk sourceDirectoryNameOfClass:'ClockView' |
3744 |
Smalltalk sourceDirectoryNameOfClass:'Bag' |
|
3745 |
Smalltalk sourceDirectoryNameOfClass:'GLWireCubeDemoView' |
|
3746 |
Smalltalk sourceDirectoryNameOfClass:'SomeNonExistingClass' |
|
3747 |
" |
|
3748 |
||
3749 |
"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
|
3750 |
"Modified: 9.12.1995 / 23:54:14 / cg" |
2033 | 3751 |
"Modified: 3.1.1997 / 11:26:44 / stefan" |
617 | 3752 |
! |
3753 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3754 |
sourceFileStreamFor:aFileName |
617 | 3755 |
"search aFileName in some standard places; |
3756 |
return a readonly fileStream or nil if not found. |
|
3757 |
Searches in subdirectories named 'source' in SystemPath" |
|
3758 |
||
3759 |
|aString| |
|
3760 |
||
3761 |
aString := self getSourceFileName:aFileName. |
|
3762 |
aString notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3763 |
^ aString asFilename readStream |
617 | 3764 |
]. |
3765 |
^ nil |
|
3766 |
! |
|
3767 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3768 |
systemFileStreamFor:aFileName |
617 | 3769 |
"search aFileName in some standard places; |
3770 |
return a readonly fileStream or nil if not found. |
|
3771 |
see comment in Smalltalk>>initSystemPath" |
|
3772 |
||
3773 |
|aString| |
|
3774 |
||
3775 |
aString := self getSystemFileName:aFileName. |
|
3776 |
aString notNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3777 |
^ aString asFilename readStream |
617 | 3778 |
]. |
3779 |
^ nil |
|
3780 |
! |
|
3781 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3782 |
systemPath |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3783 |
"return a collection of directorynames, where smalltalk |
617 | 3784 |
looks for system files |
3785 |
(usually in subdirs such as resources, bitmaps, source etc.) |
|
3786 |
see comment in Smalltalk>>initSystemPath." |
|
3787 |
||
3788 |
^ SystemPath |
|
3789 |
||
3790 |
" |
|
3791 |
Smalltalk systemPath |
|
3792 |
Smalltalk systemPath addLast:'someOtherDirectoryPath' |
|
3793 |
" |
|
3794 |
! |
|
3795 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3796 |
systemPath:aPath |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3797 |
"set the collection of directorynames, where smalltalk |
617 | 3798 |
looks for system files |
3799 |
(usually in subdirs such as resources, bitmaps, source etc.) |
|
3800 |
see comment in Smalltalk>>initSystemPath." |
|
3801 |
||
3802 |
SystemPath := aPath. |
|
3803 |
self flushPathCaches |
|
3804 |
||
3805 |
" |
|
3806 |
Smalltalk systemPath |
|
3807 |
Smalltalk systemPath:(Smalltalk systemPath copy addLast:'someOtherDirectoryPath') |
|
191 | 3808 |
" |
1 | 3809 |
! ! |
2 | 3810 |
|
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
3811 |
!Smalltalk class methodsFor:'time-versions'! |
453 | 3812 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3813 |
configuration |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3814 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3815 |
|
453 | 3816 |
"for developers only: return the configuration, with which |
3817 |
this smalltalk was compiled." |
|
3818 |
||
567 | 3819 |
%{ /* NOCONTEXT */ |
453 | 3820 |
extern char *__getConfigurationString(); |
3821 |
||
3822 |
RETURN (__MKSTRING(__getConfigurationString() COMMA_SND)); |
|
3823 |
%} |
|
3824 |
||
3825 |
" |
|
3826 |
Smalltalk configuration |
|
3827 |
" |
|
3828 |
! |
|
3829 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3830 |
copyrightString |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3831 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3832 |
|
453 | 3833 |
"return a copyright string" |
3834 |
||
567 | 3835 |
%{ /* NOCONTEXT */ |
829
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
3836 |
#ifndef __getCopyrightString |
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
3837 |
extern OBJ __getCopyrightString(); |
568 | 3838 |
#endif |
3839 |
||
829
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
3840 |
RETURN (__getCopyrightString()); |
567 | 3841 |
%} |
453 | 3842 |
|
3843 |
" |
|
3844 |
Smalltalk copyrightString |
|
3845 |
" |
|
3846 |
! |
|
3847 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3848 |
distributorString |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3849 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3850 |
|
567 | 3851 |
"return a string describing the distributor of this software" |
3852 |
||
3853 |
%{ /* NOCONTEXT */ |
|
829
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
3854 |
#ifndef __getDistributorString |
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
3855 |
extern OBJ __getDistributorString(); |
568 | 3856 |
#endif |
3857 |
||
829
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
3858 |
RETURN (__getDistributorString()); |
567 | 3859 |
%} |
3860 |
" |
|
3861 |
Smalltalk distributorString |
|
3862 |
" |
|
3863 |
! |
|
3864 |
||
1645 | 3865 |
expirationTime |
3866 |
"{ Pragma: +optSpace }" |
|
3867 |
||
3868 |
"for developers only: return the time when the system will expire. |
|
3869 |
after this time it will not run any longer. |
|
3870 |
It returns nil, if no expiration time has been set (system runs forever :-))" |
|
3871 |
||
3872 |
|exp| |
|
3873 |
||
3874 |
%{ |
|
3875 |
extern unsigned int __getExpirationTime(); |
|
3876 |
||
3877 |
exp = __MKUINT(__getExpirationTime()); |
|
3878 |
%}. |
|
3879 |
exp == 0 ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3880 |
^ nil |
1645 | 3881 |
]. |
3882 |
^ AbsoluteTime new fromOSTime:(exp * 1000). "OSTime is ms since 1970" |
|
3883 |
||
3884 |
" |
|
3885 |
Smalltalk expirationTime |
|
3886 |
" |
|
3887 |
! |
|
3888 |
||
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3889 |
fullVersionString |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3890 |
"{ Pragma: +optSpace }" |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3891 |
|
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3892 |
"return a full version string" |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3893 |
|
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3894 |
^ 'Smalltalk/X release ' , self versionString , ' of ' , self versionDate |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3895 |
|
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3896 |
" |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3897 |
Smalltalk fullVersionString |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3898 |
" |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3899 |
|
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3900 |
"Created: / 27.10.1997 / 17:03:09 / cg" |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3901 |
"Modified: / 27.10.1997 / 17:04:02 / cg" |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3902 |
! |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
3903 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3904 |
hello |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3905 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3906 |
|
453 | 3907 |
"return a greeting string" |
3908 |
||
3909 |
"stupid: this should come from a resource file ... |
|
3910 |
but I dont use it here, to allow mini-systems without |
|
3911 |
Resource-stuff." |
|
3912 |
||
1307 | 3913 |
|proto lang| |
3914 |
||
3915 |
lang := Language. |
|
3916 |
(lang == #german or:[lang == #de]) ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3917 |
proto := 'Willkommen bei %1 - Version %2 vom %3' |
1307 | 3918 |
]. |
3919 |
(lang == #french or:[lang == #fr]) ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3920 |
proto := 'Bienvenue à %1 - version %2 de %3' |
2 | 3921 |
]. |
1307 | 3922 |
|
3923 |
"/ ... more needed here ... |
|
3924 |
||
3925 |
proto isNil ifTrue:[ |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3926 |
proto := 'Hello World - here is %1 version %2 of %3'. |
453 | 3927 |
]. |
1307 | 3928 |
|
1412 | 3929 |
^ proto bindWith:(Text string:'SmallTalk/X' emphasis:#bold) |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3930 |
with:(self versionString) |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3931 |
with:(self versionDate) |
453 | 3932 |
|
3933 |
" |
|
1307 | 3934 |
Smalltalk language:#us. |
3935 |
Smalltalk hello |
|
3936 |
||
3937 |
Smalltalk language:#de. |
|
3938 |
Smalltalk hello |
|
1412 | 3939 |
|
1422 | 3940 |
Transcript showCR:(Smalltalk hello) |
3941 |
Stdout showCR:(Smalltalk hello) |
|
453 | 3942 |
" |
1307 | 3943 |
|
1412 | 3944 |
"Modified: 18.5.1996 / 14:25:13 / cg" |
617 | 3945 |
! |
3946 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3947 |
imageRestartTime |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3948 |
"return a timestamp for the moment when this image was restarted. |
1069 | 3949 |
If we do not execute from an image (i.e. fresh start), return nil." |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3950 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3951 |
^ ImageRestartTime |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3952 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3953 |
" |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3954 |
Smalltalk imageStartTime |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3955 |
Smalltalk imageRestartTime |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3956 |
" |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3957 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3958 |
"Created: 13.12.1995 / 17:44:20 / cg" |
1069 | 3959 |
"Modified: 6.3.1996 / 11:56:35 / cg" |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3960 |
! |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3961 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3962 |
imageSaveTime |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3963 |
"return a timestamp for the moment when this image was saved" |
1100
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
3964 |
|
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
3965 |
^ ObjectMemory imageSaveTime |
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
3966 |
! |
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
3967 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3968 |
imageStartTime |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3969 |
"return a timestamp for the moment when this system started the first time |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3970 |
(i.e. the first initial start without an image)" |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3971 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3972 |
^ ImageStartTime |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3973 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3974 |
" |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3975 |
Smalltalk imageStartTime |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3976 |
Smalltalk imageRestartTime |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3977 |
" |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3978 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3979 |
"Created: 13.12.1995 / 17:44:14 / cg" |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3980 |
"Modified: 13.12.1995 / 17:45:47 / cg" |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3981 |
! |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3982 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3983 |
majorVersionNr |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3984 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3985 |
|
617 | 3986 |
"return the major version number. |
3987 |
This is only incremented for very fundamental changes, |
|
3988 |
which make old object files totally incompatible |
|
3989 |
(for example, if the layout/representation of fundamental |
|
3990 |
classes changes)." |
|
3991 |
||
1941
51332fe23542
bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents:
1917
diff
changeset
|
3992 |
^ 3 |
617 | 3993 |
|
3994 |
" |
|
3995 |
Smalltalk majorVersionNr |
|
3996 |
" |
|
1941
51332fe23542
bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents:
1917
diff
changeset
|
3997 |
|
51332fe23542
bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents:
1917
diff
changeset
|
3998 |
"Modified: 8.11.1996 / 19:59:21 / cg" |
617 | 3999 |
! |
4000 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
4001 |
minorVersionNr |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
4002 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
4003 |
|
617 | 4004 |
"return the minor version number. |
4005 |
This is incremented for changes which make some old object |
|
4006 |
files incompatible, or the protocol changes such that some |
|
4007 |
classes need rework." |
|
4008 |
||
3092 | 4009 |
^ 3 |
617 | 4010 |
|
4011 |
" |
|
4012 |
Smalltalk minorVersionNr |
|
4013 |
" |
|
1941
51332fe23542
bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents:
1917
diff
changeset
|
4014 |
|
3092 | 4015 |
"Modified: / 3.11.1997 / 14:49:48 / cg" |
617 | 4016 |
! |
4017 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
4018 |
releaseIdentification |
1552 | 4019 |
"{ Pragma: +optSpace }" |
4020 |
||
4021 |
"for developers only: return the release |
|
4022 |
(to further identify the version in case of errors)" |
|
4023 |
||
4024 |
%{ /* NOCONTEXT */ |
|
1553 | 4025 |
extern OBJ __getRel(); |
4026 |
||
4027 |
RETURN (__getRel()); |
|
1552 | 4028 |
%} |
4029 |
||
4030 |
" |
|
4031 |
Smalltalk releaseIdentification |
|
4032 |
" |
|
4033 |
! |
|
4034 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
4035 |
releaseNr |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
4036 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
4037 |
|
617 | 4038 |
"return the revision number. |
4039 |
Incremented for releases which fix bugs/add features but did not find |
|
4040 |
their way to the outside world." |
|
4041 |
||
2658 | 4042 |
^ 1 |
617 | 4043 |
|
4044 |
" |
|
4045 |
Smalltalk releaseNr |
|
4046 |
" |
|
732
29a49feab799
release bump - that seems to be a good one
Claus Gittinger <cg@exept.de>
parents:
728
diff
changeset
|
4047 |
|
29a49feab799
release bump - that seems to be a good one
Claus Gittinger <cg@exept.de>
parents:
728
diff
changeset
|
4048 |
"Created: 10.12.1995 / 01:42:19 / cg" |
617 | 4049 |
! |
4050 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
4051 |
revisionNr |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
4052 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
4053 |
|
617 | 4054 |
"return the revision number. |
4055 |
Incremented for releases which fix bugs/add features |
|
4056 |
and represent a stable workable version which got published |
|
4057 |
to the outside world." |
|
4058 |
||
3001 | 4059 |
^ 1 |
617 | 4060 |
|
4061 |
" |
|
4062 |
Smalltalk revisionNr |
|
4063 |
" |
|
1941
51332fe23542
bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents:
1917
diff
changeset
|
4064 |
|
2802
9279d89b2b99
bumbed revision (fixed compiler bug)
Claus Gittinger <cg@exept.de>
parents:
2777
diff
changeset
|
4065 |
"Modified: 30.7.1997 / 12:23:23 / cg" |
617 | 4066 |
! |
4067 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
4068 |
timeStamp |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
4069 |
"return a string useful for timestamping a file. |
617 | 4070 |
The returned string is padded with spaces for a constant |
4071 |
length (to avoid changing a files size in fileOut with unchanged |
|
4072 |
class)." |
|
4073 |
||
4074 |
^ ('''From Smalltalk/X, Version:' , (Smalltalk versionString) , ' on ' |
|
4075 |
, Date today printString , ' at ' , Time now printString |
|
4076 |
, '''') paddedTo:80 with:(Character space) |
|
4077 |
! |
|
4078 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
4079 |
versionDate |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
4080 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
4081 |
|
617 | 4082 |
"return the executables build date - thats the date when the smalltalk |
4083 |
executable was built" |
|
4084 |
||
4085 |
%{ /* NOCONTEXT */ |
|
4086 |
extern char *__getBuildDateString(); |
|
4087 |
||
4088 |
RETURN (__MKSTRING(__getBuildDateString() COMMA_SND) ); |
|
4089 |
%} |
|
4090 |
" |
|
4091 |
Smalltalk versionDate |
|
4092 |
" |
|
4093 |
! |
|
4094 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
4095 |
versionString |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
4096 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
4097 |
|
617 | 4098 |
"return the version string" |
4099 |
||
4100 |
^ (self majorVersionNr printString , |
|
4101 |
'.', |
|
4102 |
self minorVersionNr printString , |
|
4103 |
'.', |
|
4104 |
self revisionNr printString) |
|
4105 |
||
4106 |
" |
|
4107 |
Smalltalk versionString |
|
4108 |
" |
|
2 | 4109 |
! ! |
453 | 4110 |
|
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
4111 |
!Smalltalk class methodsFor:'documentation'! |
630 | 4112 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
4113 |
version |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4114 |
^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.268 1998-01-12 13:14:31 cg Exp $' |
630 | 4115 |
! ! |