72 Appendix — C library compatibility for RIM Wireless Handheld applications
Developer’s Guide – RIM 950 Wireless Handheld™
Handheld applications run in a protected environment, calling these
functions will cause a protection fault at run time.
Locale dependent functions
The RIM Wireless Handheld environment does not support locales,
multibyte characters, or wide characters. However, it is useful to have
many of the locale dependent functions compatible. These function s
were in the C library before the setlocale function.
Memory allocation functions
The standard C memory allocation functions may not be used in the RIM
Wireless Handheld environment. Use RimMalloc, RimR ealloc, and
RimFree instead.
The global C++ operators new and delete may be used. They are
translated into calls to RimMalloc and RimFree respectively. Operator
new differs from the standard one in that, if there is insufficient memory
to perform the allocation, it returns a NULL pointer rather than throwing
an exception.
Process and environment control functions
Because the process model of the RIM Wireless Handheld environment
is quite different from that of desktop systems, the compiler C library
process and environment control functions are not applicable .
The functions setjmp and longjmp are also in this class. They are not
available because the library implementations make system calls in order
to perform stack unwinding. You could write a version of these
functions that would work on the RIM Wireless Handheld, if it is
acceptable not to call the distracters of C++ stack objects between the
setjmp and the longjmp.
String manipulation functions
Many of the string manipulation functions are l ocale dependent or
require the use of malloc. These functions are, therefore, not supported
by the RIM Wireless Handheld environment.
System call functions
Windows system call functions may not be used in the RIM Wireless
Handheld environment. Because of the way the RIM Wireless Handheld