ExternalLong.st
author Claus Gittinger <cg@exept.de>
Tue, 15 Mar 2016 22:45:53 +0100
changeset 3753 23d5633e7499
parent 3543 804fb8c11877
child 3773 511f3e8b9b34
permissions -rw-r--r--
#REFACTORING class: ExternalLong changed: #asNullStatus (send #unsignedInt16At:MSB: instead of #wordAt:MSB:)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3543
804fb8c11877 class: ExternalLong
Stefan Vogel <sv@exept.de>
parents: 2964
diff changeset
     1
"{ Encoding: utf8 }"
804fb8c11877 class: ExternalLong
Stefan Vogel <sv@exept.de>
parents: 2964
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
98059fd56826 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
    44
    (pointers) are returned. The name is misleading: it should be ExternalPointer,
98059fd56826 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
    45
    because on machines where sizeof(long) !!= sizeof(void *), that makes a difference.
98059fd56826 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
    46
    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
    47
"
1926
b7740748e15c copyright
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
    48
! !
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    49
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    50
!ExternalLong class methodsFor:'instance creation'!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    51
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    52
new
2517
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    53
    "allocate some memory usable for data;
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    54
     the memory is not controlled by the garbage collector.
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    55
     Return a corresponding ExternalBytes object or raise MallocFailure (if malloc fails).
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    56
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    57
     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
    58
     external destination (such as a C function) which does not copy the
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    59
     data, but instead keeps a reference to it. For example, many functions
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    60
     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
    61
     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
    62
     may change their address.
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    63
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    64
     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
    65
		   MANUALLY freed (see #free) or the returned externalBytes object
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
    66
		   is unprotected or the classes releaseAllMemory method is called."
2517
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    67
2957
98059fd56826 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
    68
    ^ super new:(ExternalAddress pointerSize)
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    69
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    70
    "
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    71
     ExternalLong new
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    72
    "
2517
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    73
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    74
    "Modified: / 20-12-2010 / 16:22:51 / cg"
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    75
!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    76
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    77
unprotectedNew
2517
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    78
    "allocate some memory usable for data;
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    79
     the memory is under the control of the garbage collector.
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    80
     Return a corresponding ExternalBytes object or raise MallocFailure (if malloc fails).
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    81
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    82
     DANGER ALERT: the memory block as allocated will be automatically freed
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
    83
		   as soon as the reference to the returned externalBytes object
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
    84
		   is gone (by the next garbage collect).
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
    85
		   If the memory has been passed to a C-function which
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
    86
		   remembers this pointer, bad things may happen ...."
2517
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    87
2957
98059fd56826 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
    88
    ^ super unprotectedNew:(ExternalAddress pointerSize)
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    89
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    90
    "
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    91
     ExternalLong new
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    92
    "
2517
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    93
5a6c9b79c66a comments in:
Claus Gittinger <cg@exept.de>
parents: 2462
diff changeset
    94
    "Modified: / 20-12-2010 / 16:22:39 / cg"
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    95
! !
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    96
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    97
!ExternalLong methodsFor:'accessing'!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    98
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
    99
asBoolean
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   100
    |result|
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   101
609
2a4ed61bf78b Updates from Tests, i.e. bug fixes
dq
parents: 605
diff changeset
   102
    result := self byteAt:1.
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   103
    result = 0 ifTrue:[
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   104
	^ false.
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   105
    ].
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   106
    ^ true.
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   107
!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   108
2521
b69657cf4374 added: #asExternalBytes
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   109
asExternalBytes
b69657cf4374 added: #asExternalBytes
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   110
    ^ ExternalBytes address:(self value)
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
    "
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   113
     (ExternalLong new value:10) asExternalBytes
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   114
     (ExternalLong new value:0) asExternalBytes
2521
b69657cf4374 added: #asExternalBytes
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   115
    "
b69657cf4374 added: #asExternalBytes
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   116
!
b69657cf4374 added: #asExternalBytes
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   117
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   118
asInteger
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   119
    "warning: retrieves an integer with the size of the native machine's
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   120
     pointer (i.e. either 32 or 64bit)"
2958
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   121
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   122
    ExternalAddress pointerSize == 8 ifTrue:[
3543
804fb8c11877 class: ExternalLong
Stefan Vogel <sv@exept.de>
parents: 2964
diff changeset
   123
        ^ self longLongAt:1 bigEndian:IsBigEndian
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   124
    ] ifFalse:[
3543
804fb8c11877 class: ExternalLong
Stefan Vogel <sv@exept.de>
parents: 2964
diff changeset
   125
        ^ self signedDoubleWordAt:1 MSB:IsBigEndian
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   126
    ]
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   127
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   128
    "
2519
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   129
     ExternalLong new value:10
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   130
     (ExternalLong new value:16rFFFFFF) asInteger
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   131
    "
2519
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   132
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   133
    "Modified: / 22-12-2010 / 18:34:02 / cg"
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   134
!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   135
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   136
asNullStatus
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   137
    "cg: whoever added this here should move it to the sql package"
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   138
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   139
    |result|
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   140
3753
23d5633e7499 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3543
diff changeset
   141
    result := self unsignedInt16At:1 MSB:false.
2329
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   142
    result = 0 ifTrue:[ ^ #SQL_NO_NULLS ].
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   143
    result = 1 ifTrue:[ ^ #SQL_NULLABLE ].
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   144
    ^ #SQL_NULLABLE_UNKNOWN
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   145
!
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   146
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   147
asPointer
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   148
    "fetch my cell's pointer value
2958
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   149
     (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
   150
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   151
    "/ ^ ExternalAddress new setAddress:(self value address)
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   152
    ^ self pointerAt:1.
2329
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   153
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   154
    "
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   155
     (ExternalLong new value:10) asPointer
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   156
    "
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   157
!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   158
2519
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   159
asUnsignedInteger
2958
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   160
    "warning: only returns a 32bit integer"
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   161
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   162
    "warning: retrieves an integer with the size of the native machine's
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   163
     pointer (i.e. either 32 or 64bit)"
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   164
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   165
    ExternalAddress pointerSize == 8 ifTrue:[
3543
804fb8c11877 class: ExternalLong
Stefan Vogel <sv@exept.de>
parents: 2964
diff changeset
   166
        ^ self unsignedLongLongAt:1 bigEndian:IsBigEndian
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   167
    ] ifFalse:[
3543
804fb8c11877 class: ExternalLong
Stefan Vogel <sv@exept.de>
parents: 2964
diff changeset
   168
        ^ self doubleWordAt:1 MSB:IsBigEndian
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   169
    ]
2519
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
    "
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   172
     (ExternalLong new value:10) asUnsignedInteger
2519
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   173
    "
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   174
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   175
    "Created: / 22-12-2010 / 18:31:03 / cg"
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   176
!
6267de81a0e4 added: #asUnsignedInteger
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   177
609
2a4ed61bf78b Updates from Tests, i.e. bug fixes
dq
parents: 605
diff changeset
   178
boolean:bool
2a4ed61bf78b Updates from Tests, i.e. bug fixes
dq
parents: 605
diff changeset
   179
    bool ifTrue:[self byteAt:1 put:1].
2a4ed61bf78b Updates from Tests, i.e. bug fixes
dq
parents: 605
diff changeset
   180
    self byteAt:1 put:0.
2a4ed61bf78b Updates from Tests, i.e. bug fixes
dq
parents: 605
diff changeset
   181
!
2a4ed61bf78b Updates from Tests, i.e. bug fixes
dq
parents: 605
diff changeset
   182
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   183
value
2958
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   184
    ^ (self pointerAt:1) address
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   185
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   186
    "
2958
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   187
     (ExternalLong new value:10) value
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   188
    "
623
cd16d122c83e category change
Claus Gittinger <cg@exept.de>
parents: 609
diff changeset
   189
cd16d122c83e category change
Claus Gittinger <cg@exept.de>
parents: 609
diff changeset
   190
    "Modified: / 30.3.1998 / 17:07:57 / cg"
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   191
!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   192
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   193
value:anInteger
2958
d71355c0de67 class: ExternalLong
Claus Gittinger <cg@exept.de>
parents: 2957
diff changeset
   194
    "/ self doubleWordAt:1 put:anInteger
2964
ae1be6343dda 64bit fix
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   195
    self pointerAt:1 put:anInteger
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   196
! !
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   197
2462
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   198
!ExternalLong methodsFor:'printing & storing'!
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   199
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   200
printOn:aStream
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   201
    aStream nextPutAll:self className; nextPut:$(.
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   202
    self asInteger printOn:aStream.
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   203
    aStream nextPut:$)
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   204
! !
07457221fd73 added: #printOn:
Stefan Vogel <sv@exept.de>
parents: 2330
diff changeset
   205
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   206
!ExternalLong class methodsFor:'documentation'!
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   207
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   208
version
3753
23d5633e7499 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3543
diff changeset
   209
    ^ '$Header$'
2329
63e0cb1a051e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
   210
!
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
version_CVS
3753
23d5633e7499 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3543
diff changeset
   213
    ^ '$Header$'
605
3826bf1e9c23 intitial checkin
dq
parents:
diff changeset
   214
! !
3543
804fb8c11877 class: ExternalLong
Stefan Vogel <sv@exept.de>
parents: 2964
diff changeset
   215