OSHandle.st
author Jan Vrany <jan.vrany@labware.com>
Tue, 01 Jun 2021 20:19:13 +0100
branchjv
changeset 25424 51bd8a6b196f
parent 18120 e3a375d5f6a8
permissions -rw-r--r--
Cherry-picked `Context` cherry-picked Context.st from a6b6dda4caff: * 4aaf30c174e9: #DOCUMENTATION by cg, Claus Gittinger <cg@exept.de> * c67311afcc6c: #OTHER by cg, Claus Gittinger <cg@exept.de> * 883f79e7b2a6: #FEATURE by cg, Claus Gittinger <cg@exept.de> * 716f3fbb09e9: Don't mark contexts with `CATCHMARK`, Jan Vrany <jan.vrany@fit.cvut.cz> * cff24fa817b0: #REFACTORING by stefan, Stefan Vogel <sv@exept.de> * 521f0d837330: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * bf1118f0fcca: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * e587cdd22868: #BUGFIX by cg, Claus Gittinger <cg@exept.de> * fe9f9487a3ed: #DOCUMENTATION by cg, Claus Gittinger <cg@exept.de> * d5b781899274: #BUGFIX by cg, Claus Gittinger <cg@exept.de> * 8258751a7465: #FEATURE by cg, Claus Gittinger <cg@exept.de> * 40173e082cbc: Copyright updates, Jan Vrany <jan.vrany@fit.cvut.cz> * 6db5c28207d5: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 871ea64fd5dc: #FEATURE by cg, Claus Gittinger <cg@exept.de> * 4b544a108e4e: #DOCUMENTATION by cg, Claus Gittinger <cg@exept.de> * 9a8d8399e566: #FEATURE by cgexept.de, Claus Gittinger <cg@exept.de> * 170b00be0103: #BUGFIX by stefan, Stefan Vogel <sv@exept.de> * a6c73965eae8: #FEATURE by cg, Claus Gittinger <cg@exept.de> * ce2a0e462ff0: #FEATURE by cg, Claus Gittinger <cg@exept.de> * 46a260a9ca92: #FEATURE by cg, Claus Gittinger <cg@exept.de> * 46cab49167fb: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 7d52dfd3997d: #DOCUMENTATION by exept, Claus Gittinger <cg@exept.de> * c52eeea62763: Fix `Context >> argAndVarNames` in cases when debug info is not available, Jan Vrany <jan.vrany@labware.com> * b5d6963fe4a9: Backed out changeset c52eeea62763, Jan Vrany <jan.vrany@labware.com> * 6fd3896f8703: #FEATURE by exept, Claus Gittinger <cg@exept.de> * b530ee616256: #REFACTORING by cg, Claus Gittinger <cg@exept.de> * ef9b481d7498: #FEATURE by cg, Claus Gittinger <cg@exept.de> * ea663b72bd51: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 6179572a733c: #FEATURE by exept, Claus Gittinger <cg@exept.de> * 84155b1b6622: #DOCUMENTATION by exept, Claus Gittinger <cg@exept.de> * 37d06602d856: *** empty log message ***, Claus Gittinger <cg@exept.de> * f927b9022fea: *** empty log message ***, Claus Gittinger <cg@exept.de> * 427d3be62d97: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7593
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
     1
"
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
     2
 COPYRIGHT (c) 1999 by eXept Software AG
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
     3
              All Rights Reserved
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
     4
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
     5
 This software is furnished under a license and may be used
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
     6
 only in accordance with the terms of that license and with the
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
     8
 be provided or otherwise made available to, or used by, any
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
     9
 other person.  No title to or ownership of the software is
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    10
 hereby transferred.
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    11
"
5409
9b5890348f9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4763
diff changeset
    12
"{ Package: 'stx:libbasic' }"
9b5890348f9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4763
diff changeset
    13
17699
7e6dc4c76306 class category
Claus Gittinger <cg@exept.de>
parents: 16344
diff changeset
    14
"{ NameSpace: Smalltalk }"
7e6dc4c76306 class category
Claus Gittinger <cg@exept.de>
parents: 16344
diff changeset
    15
4763
d15c41a66ec4 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
ExternalAddress subclass:#OSHandle
d15c41a66ec4 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:''
9103
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    18
	classVariableNames:'Lobby'
4763
d15c41a66ec4 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
17699
7e6dc4c76306 class category
Claus Gittinger <cg@exept.de>
parents: 16344
diff changeset
    20
	category:'Compatibility-VisualWorks'
4763
d15c41a66ec4 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
d15c41a66ec4 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
6226
d45b429492ec documentation
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
    23
!OSHandle class methodsFor:'documentation'!
d45b429492ec documentation
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
    24
7593
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    25
copyright
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    26
"
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    27
 COPYRIGHT (c) 1999 by eXept Software AG
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    28
              All Rights Reserved
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    29
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    30
 This software is furnished under a license and may be used
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    31
 only in accordance with the terms of that license and with the
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    33
 be provided or otherwise made available to, or used by, any
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    34
 other person.  No title to or ownership of the software is
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    35
 hereby transferred.
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    36
"
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    37
!
e7550b9ef84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    38
6226
d45b429492ec documentation
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
    39
documentation
d45b429492ec documentation
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
    40
"
9103
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    41
    Ongoing work: 
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    42
        extract handle specific operations and rewrite Streams, Sockets etc.
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    43
        to pass all work to these handles.
6226
d45b429492ec documentation
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
    44
d45b429492ec documentation
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
    45
    [author:]
d45b429492ec documentation
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
    46
        Claus Gittinger
d45b429492ec documentation
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
    47
"
d45b429492ec documentation
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
    48
! !
4763
d15c41a66ec4 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
9103
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    50
!OSHandle class methodsFor:'initialization'!
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    51
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    52
initialize
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    53
    Lobby := Registry new.
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    54
! !
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    55
7298
9b3c69eb2c5d category
Claus Gittinger <cg@exept.de>
parents: 6439
diff changeset
    56
!OSHandle class methodsFor:'Compatibility-VW'!
5740
a634006d10be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5409
diff changeset
    57
a634006d10be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5409
diff changeset
    58
currentOS
a634006d10be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5409
diff changeset
    59
    "ST-80 compatibility."
a634006d10be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5409
diff changeset
    60
a634006d10be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5409
diff changeset
    61
    "/ mhmh what does ST80/VW returned here ?
a634006d10be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5409
diff changeset
    62
a634006d10be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5409
diff changeset
    63
    OperatingSystem isUNIXlike ifTrue:[^ #unix].
a634006d10be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5409
diff changeset
    64
    OperatingSystem isOS2like  ifTrue:[^ #os2].
a634006d10be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5409
diff changeset
    65
    OperatingSystem isMSWINDOWSlike  ifTrue:[^ #windows].
a634006d10be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5409
diff changeset
    66
    ^ #unknown
6295
8cd84857b5bb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6226
diff changeset
    67
8cd84857b5bb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6226
diff changeset
    68
    "
8cd84857b5bb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6226
diff changeset
    69
     OSHandle currentOS
8cd84857b5bb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6226
diff changeset
    70
    "
6124
81baa6b991c3 currentProcessID - for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 5966
diff changeset
    71
!
81baa6b991c3 currentProcessID - for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 5966
diff changeset
    72
81baa6b991c3 currentProcessID - for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 5966
diff changeset
    73
currentProcessID
81baa6b991c3 currentProcessID - for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 5966
diff changeset
    74
    "ST-80 compatibility."
81baa6b991c3 currentProcessID - for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 5966
diff changeset
    75
81baa6b991c3 currentProcessID - for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 5966
diff changeset
    76
    ^ OperatingSystem getProcessId
81baa6b991c3 currentProcessID - for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 5966
diff changeset
    77
6295
8cd84857b5bb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6226
diff changeset
    78
    "
8cd84857b5bb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6226
diff changeset
    79
     OSHandle currentProcessID
8cd84857b5bb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6226
diff changeset
    80
    "
8cd84857b5bb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6226
diff changeset
    81
6124
81baa6b991c3 currentProcessID - for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 5966
diff changeset
    82
    "Created: / 30.10.2001 / 17:31:55 / cg"
5740
a634006d10be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5409
diff changeset
    83
! !
a634006d10be checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5409
diff changeset
    84
4763
d15c41a66ec4 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
!OSHandle methodsFor:'finalization'!
d15c41a66ec4 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
9103
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    87
finalizationLobby
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    88
    "answer a Registry used for finalization."
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    89
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    90
    ^ Lobby
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    91
!
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    92
6439
0f841258ec4a Use #finalize instead of #disposed
Stefan Vogel <sv@exept.de>
parents: 6295
diff changeset
    93
finalize
4763
d15c41a66ec4 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    self subclassResponsibility
d15c41a66ec4 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
! !
d15c41a66ec4 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
9103
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    97
!OSHandle methodsFor:'queries'!
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
    98
16344
254eebdd0f74 class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 16343
diff changeset
    99
handleType
254eebdd0f74 class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 16343
diff changeset
   100
    ^ self subclassResponsibility
254eebdd0f74 class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 16343
diff changeset
   101
!
254eebdd0f74 class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 16343
diff changeset
   102
9103
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
   103
isValid
16341
5d233b3b858c class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 9103
diff changeset
   104
     ^ self address ~~ 0
5d233b3b858c class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 9103
diff changeset
   105
! !
5d233b3b858c class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 9103
diff changeset
   106
5d233b3b858c class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 9103
diff changeset
   107
!OSHandle methodsFor:'testing'!
5d233b3b858c class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 9103
diff changeset
   108
16343
d8c82b95b95a class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 16341
diff changeset
   109
isOsHandle
d8c82b95b95a class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 16341
diff changeset
   110
    ^ true
d8c82b95b95a class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 16341
diff changeset
   111
!
d8c82b95b95a class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 16341
diff changeset
   112
16341
5d233b3b858c class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 9103
diff changeset
   113
isSocketHandle
5d233b3b858c class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 9103
diff changeset
   114
    ^ false
9103
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
   115
! !
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
   116
4763
d15c41a66ec4 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
!OSHandle class methodsFor:'documentation'!
d15c41a66ec4 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
d15c41a66ec4 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
version
17699
7e6dc4c76306 class category
Claus Gittinger <cg@exept.de>
parents: 16344
diff changeset
   120
    ^ '$Header: /cvs/stx/stx/libbasic/OSHandle.st,v 1.15 2015-03-27 13:24:38 cg Exp $'
16343
d8c82b95b95a class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 16341
diff changeset
   121
!
d8c82b95b95a class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 16341
diff changeset
   122
d8c82b95b95a class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 16341
diff changeset
   123
version_CVS
17699
7e6dc4c76306 class category
Claus Gittinger <cg@exept.de>
parents: 16344
diff changeset
   124
    ^ '$Header: /cvs/stx/stx/libbasic/OSHandle.st,v 1.15 2015-03-27 13:24:38 cg Exp $'
4763
d15c41a66ec4 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
! !
9103
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
   126
16341
5d233b3b858c class: OSHandle
Stefan Vogel <sv@exept.de>
parents: 9103
diff changeset
   127
9103
b934315bb0b1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7593
diff changeset
   128
OSHandle initialize!