17.05.2015 Views

TMS34010 C Compiler - Al Kossow's Bitsavers

TMS34010 C Compiler - Al Kossow's Bitsavers

TMS34010 C Compiler - Al Kossow's Bitsavers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Runtime-Support Functions - Header Files<br />

6.1.2 Character Typing and Conversion (ctype.h)<br />

The ctype. h header declares functions that test (type) and convert characters.<br />

For example, a character-typing function may test a character to determine<br />

whether it is a letter, if it is a printing character, if it is a hexadecimal digit, etc.<br />

These functions return a value of true (a nonzero value) or false (0).<br />

The character-conversion functions convert characters to lower case, upper<br />

case, or ASCII. These functions return the converted character.<br />

Character-typing functions have names in the form isxxx (for example,<br />

isdigit). Character-conversion functions have names in the form toxxx (for<br />

example, toupper).<br />

The ctype. h header also contains macro definitions that perform these same<br />

operations; the macros run faster than the corresponding functions. The typing<br />

macros expand to a lookup operation in an array of flags (this array is defined<br />

in ctype. c). The macros have the same name as the corresponding<br />

functions, but each macro is prefixed with an underscore (for example,<br />

-isdigit).<br />

6.1.3 Limits (float.h and limits.h)<br />

The float. h and limits. h headers define macros that expand to useful<br />

limits and parameters of the TMS3401 O's numeric representations. Table 6-1<br />

and Table 6-2 list these macros and the limits they are associated with.<br />

Table 6-1. Macros that Supply Integer Type Range Limits (Iimits.h)<br />

Macro Value Description<br />

CHAR-BIT 8 Number of bits in type char<br />

SCHAR-MIN -128 Minimum value for a signed char<br />

SCHAR-MAX 127 Maximum value for a signed char<br />

UCHAR-MAX 255 Maximum value for an unsigned c!'".ar<br />

CHAR-MIN SCHAR-MIN Minimum value for a char<br />

CHAR-MAX SCHAR-MAX Maximum value for a char<br />

SHRT-MIN -32768 Minimum value for a short int<br />

SHRT-MAX 32767 Maximum value for a short int<br />

USHRT-MAX 65535 Maximum value for an unsigned short int<br />

INT-MIN -2147483648 Minimum value for an int<br />

I NT-MAX 2147483647 Maximum value for an int<br />

UINT-MAX 4294967295 Maximum value for an unsigned int<br />

LONG-MIN -2147483648 Minimum value for a long int<br />

LONG-MAX 2147483647 Maximum value for a long int<br />

ULONG-MAX 4294967295 Maximum value for an unsigned long int<br />

6-3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!