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