ExternalLong.st
author Claus Gittinger <cg@exept.de>
Sat, 02 May 2020 21:40:13 +0200
changeset 5476 7355a4b11cb6
parent 5207 9c132367790a
permissions -rw-r--r--
#FEATURE by cg class: Socket class added: #newTCPclientToHost:port:domain:domainOrder:withTimeout: changed: #newTCPclientToHost:port:domain:withTimeout:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4669
7c74cd2b4737 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
     1
"{ Encoding: utf8 }"
7c74cd2b4737 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
     2
1926
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
     3
"
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
     4
 COPYRIGHT (c) 1998 by eXept Software AG
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
     5
	      All Rights Reserved
1926
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
     6
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
     7
 This software is furnished under a license and may be used
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
     8
 only in accordance with the terms of that license and with the
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    10
 be provided or otherwise made available to, or used by, any
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    11
 other person.  No title to or ownership of the software is
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    12
 hereby transferred.
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    13
"
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    14
"{ Package: 'stx:libbasic2' }"
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    15
3543
804fb8c11877 class: ExternalLong
Stefan Vogel <sv@exept.de>
parents: 2964
diff changeset
    16
"{ NameSpace: Smalltalk }"
804fb8c11877 class: ExternalLong
Stefan Vogel <sv@exept.de>
parents: 2964
diff changeset
    17
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    18
ExternalBytes subclass:#ExternalLong
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    19
	instanceVariableNames:''
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    20
	classVariableNames:''
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    21
	poolDictionaries:''
623
cd16d122c83e category change
Claus Gittinger <cg@exept.de>
parents: 609
diff changeset
    22
	category:'System-Support'
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    23
!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    24
1926
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    25
!ExternalLong class methodsFor:'documentation'!
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    26
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    27
copyright
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    28
"
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    29
 COPYRIGHT (c) 1998 by eXept Software AG
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
    30
	      All Rights Reserved
1926
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    31
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    32
 This software is furnished under a license and may be used
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    33
 only in accordance with the terms of that license and with the
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    35
 be provided or otherwise made available to, or used by, any
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    36
 other person.  No title to or ownership of the software is
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    37
 hereby transferred.
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    38
"
2329
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
    39
!
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
    40
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
    41
documentation
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
    42
"
2957
98059fd56826 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
    43
    mostly added for odbc, which uses instances of me as container in which values
3773
511f3e8b9b34 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3753
diff changeset
    44
    (pointers) are returned. 
511f3e8b9b34 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3753
diff changeset
    45
    The name is very misleading: it should be ExternalPointer,
2957
98059fd56826 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
    46
    because on machines where sizeof(long) !!= sizeof(void *), that makes a difference.
3773
511f3e8b9b34 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3753
diff changeset
    47
    However, over time, others started to use this class, 
511f3e8b9b34 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3753
diff changeset
    48
    and renaming it would break some code.
2329
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
    49
"
1926
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    50
! !
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    51
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    52
!ExternalLong class methodsFor:'instance creation'!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    53
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    54
new
2517
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    55
    "allocate some memory usable for data;
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    56
     the memory is not controlled by the garbage collector.
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    57
     Return a corresponding ExternalBytes object or raise MallocFailure (if malloc fails).
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    58
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    59
     Use this, if you have to pass a block of bytes to some
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    60
     external destination (such as a C function) which does not copy the
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    61
     data, but instead keeps a reference to it. For example, many functions
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    62
     which expect strings simply keep a ref to the passed string - for those,
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    63
     an ST/X string-pointer is not the right thing to pass, since ST/X objects
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    64
     may change their address.
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    65
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    66
     DANGER ALERT: the memory is NOT automatically freed until it is either
4669
7c74cd2b4737 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
    67
                   MANUALLY freed (see #free) or the returned externalBytes object
7c74cd2b4737 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
    68
                   is unprotected or the classes releaseAllMemory method is called."
2517
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    69
4669
7c74cd2b4737 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
    70
    ^ super new:(ExternalBytes sizeofPointer)
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    71
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    72
    "
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    73
     ExternalLong new
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    74
    "
2517
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    75
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    76
    "Modified: / 20-12-2010 / 16:22:51 / cg"
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    77
!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    78
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    79
unprotectedNew
2517
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    80
    "allocate some memory usable for data;
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    81
     the memory is under the control of the garbage collector.
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    82
     Return a corresponding ExternalBytes object or raise MallocFailure (if malloc fails).
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    83
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    84
     DANGER ALERT: the memory block as allocated will be automatically freed
4669
7c74cd2b4737 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
    85
                   as soon as the reference to the returned externalBytes object
7c74cd2b4737 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
    86
                   is gone (by the next garbage collect).
7c74cd2b4737 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
    87
                   If the memory has been passed to a C-function which
7c74cd2b4737 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
    88
                   remembers this pointer, bad things may happen ...."
2517
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    89
4669
7c74cd2b4737 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
    90
    ^ super unprotectedNew:(ExternalBytes sizeofPointer)
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    91
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    92
    "
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    93
     ExternalLong new
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    94
    "
2517
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    95
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    96
    "Modified: / 20-12-2010 / 16:22:39 / cg"
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    97
! !
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    98
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    99
!ExternalLong methodsFor:'accessing'!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   100
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   101
asBoolean
4303
dc9dd4174b6e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3773
diff changeset
   102
    ^ (self byteAt:1) ~~ 0.
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   103
4303
dc9dd4174b6e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3773
diff changeset
   104
    "Modified: / 07-02-2017 / 23:40:51 / stefan"
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   105
!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   106
2521
b69657cf4374 added: #asExternalBytes
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   107
asExternalBytes
b69657cf4374 added: #asExternalBytes
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   108
    ^ ExternalBytes address:(self value)
b69657cf4374 added: #asExternalBytes
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   109
b69657cf4374 added: #asExternalBytes
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   110
    "
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   111
     (ExternalLong new value:10) asExternalBytes
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   112
     (ExternalLong new value:0) asExternalBytes
2521
b69657cf4374 added: #asExternalBytes
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   113
    "
b69657cf4374 added: #asExternalBytes
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   114
!
b69657cf4374 added: #asExternalBytes
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   115
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   116
asInteger
3773
511f3e8b9b34 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3753
diff changeset
   117
    "warning: retrieves a signed integer with the size of the native machine's
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   118
     pointer (i.e. either 32 or 64bit)"
2958
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   119
4669
7c74cd2b4737 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
   120
    ExternalBytes sizeofPointer == 8 ifTrue:[
3773
511f3e8b9b34 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3753
diff changeset
   121
        ^ self signedInt64At:1 MSB:IsBigEndian
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   122
    ] ifFalse:[
3773
511f3e8b9b34 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3753
diff changeset
   123
        ^ self signedInt32At:1 MSB:IsBigEndian
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   124
    ]
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   125
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   126
    "
2519
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   127
     ExternalLong new value:10
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   128
     (ExternalLong new value:16rFFFFFF) asInteger
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   129
    "
2519
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   130
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   131
    "Modified: / 22-12-2010 / 18:34:02 / cg"
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   132
!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   133
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   134
asNullStatus
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   135
    "cg: whoever added this here should move it to the sql package"
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   136
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   137
    |result|
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   138
3753
23d5633e7499 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3543
diff changeset
   139
    result := self unsignedInt16At:1 MSB:false.
5207
9c132367790a #TUNING by exept
Claus Gittinger <cg@exept.de>
parents: 4669
diff changeset
   140
    result == 0 ifTrue:[ ^ #SQL_NO_NULLS ].
9c132367790a #TUNING by exept
Claus Gittinger <cg@exept.de>
parents: 4669
diff changeset
   141
    result == 1 ifTrue:[ ^ #SQL_NULLABLE ].
2329
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   142
    ^ #SQL_NULLABLE_UNKNOWN
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   143
!
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   144
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   145
asPointer
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   146
    "fetch my cell's pointer value
2958
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   147
     (use this if you passed me to a C function as out parameter, to fetch the returned value)"
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   148
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   149
    "/ ^ ExternalAddress new setAddress:(self value address)
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   150
    ^ self pointerAt:1.
2329
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   151
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   152
    "
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   153
     (ExternalLong new value:10) asPointer
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   154
    "
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   155
!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   156
2519
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   157
asUnsignedInteger
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   158
    "warning: retrieves an integer with the size of the native machine's
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   159
     pointer (i.e. either 32 or 64bit)"
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   160
4669
7c74cd2b4737 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
   161
    ExternalBytes sizeofPointer == 8 ifTrue:[
3773
511f3e8b9b34 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3753
diff changeset
   162
        ^ self unsignedInt64At:1 MSB:IsBigEndian
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   163
    ] ifFalse:[
3773
511f3e8b9b34 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3753
diff changeset
   164
        ^ self unsignedInt32At:1 MSB:IsBigEndian
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   165
    ]
2519
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   166
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   167
    "
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   168
     (ExternalLong new value:10) asUnsignedInteger
2519
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   169
    "
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   170
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   171
    "Created: / 22-12-2010 / 18:31:03 / cg"
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   172
!
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   173
609
2a4ed61bf78b Updates from Tests, i.e. bug fixes
dq
parents: 605
diff changeset
   174
boolean:bool
4303
dc9dd4174b6e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3773
diff changeset
   175
    bool ifTrue:[
dc9dd4174b6e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3773
diff changeset
   176
        self byteAt:1 put:1
dc9dd4174b6e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3773
diff changeset
   177
    ] ifFalse:[
dc9dd4174b6e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3773
diff changeset
   178
        self byteAt:1 put:0.
dc9dd4174b6e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3773
diff changeset
   179
    ]
dc9dd4174b6e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3773
diff changeset
   180
dc9dd4174b6e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3773
diff changeset
   181
    "Modified: / 07-02-2017 / 23:42:15 / stefan"
609
2a4ed61bf78b Updates from Tests, i.e. bug fixes
dq
parents: 605
diff changeset
   182
!
2a4ed61bf78b Updates from Tests, i.e. bug fixes
dq
parents: 605
diff changeset
   183
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   184
value
2958
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   185
    ^ (self pointerAt:1) address
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   186
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   187
    "
2958
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   188
     (ExternalLong new value:10) value
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   189
    "
623
cd16d122c83e category change
Claus Gittinger <cg@exept.de>
parents: 609
diff changeset
   190
cd16d122c83e category change
Claus Gittinger <cg@exept.de>
parents: 609
diff changeset
   191
    "Modified: / 30.3.1998 / 17:07:57 / cg"
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   192
!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   193
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   194
value:anInteger
2958
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   195
    "/ self doubleWordAt:1 put:anInteger
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   196
    self pointerAt:1 put:anInteger
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   197
! !
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   198
2462
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   199
!ExternalLong methodsFor:'printing & storing'!
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   200
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   201
printOn:aStream
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   202
    aStream nextPutAll:self className; nextPut:$(.
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   203
    self asInteger printOn:aStream.
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   204
    aStream nextPut:$)
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   205
! !
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   206
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   207
!ExternalLong class methodsFor:'documentation'!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   208
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   209
version
3753
23d5633e7499 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3543
diff changeset
   210
    ^ '$Header$'
2329
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   211
!
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   212
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   213
version_CVS
3753
23d5633e7499 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3543
diff changeset
   214
    ^ '$Header$'
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   215
! !
3543
804fb8c11877 class: ExternalLong
Stefan Vogel <sv@exept.de>
parents: 2964
diff changeset
   216