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