
toascii
7-59
Run-Time-Support Functions
Special Version of sprintf
ti_sprintf
Syntax
#include <stdlib.h>
int ti_
sprintf
( char *s, const char *format, ...);
Defined in
tsprintf.c in rts.src
Description
The ti_sprintf function is a minimal version of sprintf() that supports only those
functions required by time(). Specifically, ti_sprintf supports only the following
conversions:
%
[
0
] [
digits
]
( s
|
d )
0
if present, indicates that the field will be padded with 0s instead of
blanks.
digits
if present, indicate the minimum width of the field in characters. If the
argument that corresponds to the conversion is smaller than this
width, the argument is right justified in the field and the field padded
with 0s or blanks (depending on whether 0 is used as above).
s
|
d
specifies the argument’s type. An
s
indicates that the argument is of
type char *; a
d
indicates that the argument is of type int.
You can alter the ti_sprintf function by extracting the function from rts.src, mak-
ing changes to the code, and recompiling the run-time-support library. The
ti_sprintf function is fully commented to make alterations easier. To extract
ti_sprintf.c from the rts.src library, enter the following command at the com-
mand line:
dspar −x rts.src tsprintf.c
Convert to ASCII
toascii
Syntax
#include <ctype.h>
int
toascii
(int c);
Defined in
toascii.c in rts.src
Description
The toascii function ensures that c is a valid ASCII character by masking the
lower seven bits. There is also an equivalent macro call _toascii.
Содержание TMS320C2x
Страница 8: ...viii...
Страница 69: ...2 47 C Compiler Description...
Страница 159: ...6 36...
Страница 226: ...8 6...
Страница 250: ...Index Index 14 Z z shell option 2 2 2 4 2 14 overriding with c option 4 5 overriding with n option 2 13...