Converting C values to Smalltalk objects
These functions enable users to convert C values into their corresponding objects for returning to Smalltalk.
EsObject EsCharToCharacter(char character)
Converts character to a Character and returns it.
 
U_32 EsCDoubleToFloat(double value, EsObject * object)
Converts value into a Float and stores the result in the location pointed to by object. Returns an EsPrimErr code. If the return value is EsPrimErrNoError then *object is valid; otherwise, *object is invalid.
Error cases: An error occurs if the new Float object cannot be allocated.
Side effects: This operation can cause a garbage collection.
 
U_32 EsCStringToString(char * str, EsObject * object)
Converts str (a null-terminated string) into a String and stores the result in the location pointed to by object. Returns an EsPrimErr code. If the return value is EsPrimErrNoError then *object is valid; otherwise, *object is invalid.
Error cases: An error occurs if the String object could not be allocated.
Side effects: This operation can cause a garbage collection.
 
U_32 EsI32ToInteger(I_32 value, EsObject * object)
Converts value (a signed number) into a SmallInteger or LargeInteger (depending on the size of value) and stores the result in the location pointed to by object. Returns an EsPrimErr code. If the return value is EsPrimErrNoError then *object is valid; otherwise, *object is invalid.
Error cases: An error occurs if the new integer object cannot be allocated.
Side effects: This operation can cause a garbage collection.
 
U_32 EsU32ToInteger(U_32 value, EsObject * object)
Converts value (an unsigned number) into a SmallInteger or LargeInteger (depending on the size of value) and stores the result in the location pointed to by object. Returns an EsPrimErr code. If the return value is EsPrimErrNoError then *object is valid; otherwise, *object is invalid.
Error cases: An error occurs if the new integer object cannot be allocated.
Side effects: This operation can cause a garbage collection. h
 
U_32 EsI64ToInteger(I_64 value, EsObject * object)
Converts value (an signed number) into a SmallInteger or LargeInteger (depending on the size of value) and stores the result in the location pointed to by object. Returns an EsPrimErr code. If the return value is EsPrimErrNoError then *object is valid; otherwise, *object is invalid.
Error cases: An error occurs if the new integer object cannot be allocated.
Side effects: This operation can cause a garbage collection. h
 
U_32 EsU64ToInteger(U_64 value, EsObject * object)
Converts value (an unsigned number) into a SmallInteger or LargeInteger (depending on the size of value) and stores the result in the location pointed to by object. Returns an EsPrimErr code. If the return value is EsPrimErrNoError then *object is valid; otherwise, *object is invalid.
Error cases: An error occurs if the new integer object cannot be allocated.
Side effects: This operation can cause a garbage collection. h
 
U_32 EsPtrToInteger(U_PTR value, EsObject * object)
Converts value (an unsigned number) into a SmallInteger or LargeInteger (depending on the size of value) and stores the result in the location pointed to by object. Returns an EsPrimErr code. If the return value is EsPrimErrNoError then *object is valid; otherwise, *object is invalid.
Error cases: An error occurs if the new integer object cannot be allocated.
Side effects: This operation can cause a garbage collection. h
 
EsObject EsI32ToSmallInteger(I_32 value)
Converts value (a signed number) to a SmallInteger and returns it.
Error cases: Not all signed 32-bit values can fit in a SmallInteger. No range check is done on value. Use EsI32ToInteger or EsU32ToInteger if you are not certain that value fits.
EsObject EsU16ToCharacter(U_16 value)
Converts value to the corresponding Character and returns it.
Last modified date: 08/10/2017