S5U1C17001C ManUal
EPSOn
7-17
(C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
7 liBrary
7
Library
write
function
Contents of
write
function
Format:
int write(int fd, char *buf, int nbytes);
Argument:
int fd;
File descriptor denoting output
When called from a library function, 1 (stdout) or 2 (stderr) is passed.
char *buf;
Pointer to the buffer that stores output data
int nbytes;
Number of transferred bytes
Functionality: The data stored in the buffer indicated by
buf
is written as much as indicated by
nbytes
to the user-defined output buffer.
Returned value: Number of bytes actually written to the output buffer
If data is written normally,
nbytes
is returned.
If a write error occurs, a value other than
nbytes
is returned.
Library function that calls the
write
function:
Direct call:
fwrite
,
putc
,
_doprint
(
_doprint
is
printf
-series internal function)
Indirect call:
fputc
,
fputs
,
putchar
,
puts
(calls
putcc
)
printf
,
fprintf
,
sprintf
,
vprintf
,
vfprintf
(calls
_doprint
)
perror
(calls
fprintf
)
Definition of output buffer
Format:
unsigned char WRITE_BUF[65];
(Variable name is arbitrary; size is fixed to 65 bytes)
Buffer content: The size of the output data (1 to max. 64) is stored at the beginning of the buffer
(
WRITE_BUF[0]
). 0 denotes EOF.
The output data is stored in
WRITE_BUF[1]
, and the following locations.
Precautions on using simulated i/O
When using the debugger's simulated I/O, define in the
write
function the global label
WRITE_FLASH
that is required for the debugger to update the output buffer, and create a function so that data will be output
from the output buffer at that position. (For details about the simulated I/O function, refer to the chapter
where the debugger is discussed.)
A
write
function has been defined in the
libstdio.a
library. To use the read function, link
libstdio.a
and call the
_init_sys()
function from the boot routine in the user program.
_exit
function
Contents of
_exit
function
Format:
void _exit(void);
Functionality: Performs program terminating processing.
Argument:
None
Returned value: None
Library function that calls the
_exit
function:
Direct call:
abort
,
exit
Summary of Contents for S5U1C17001C
Page 6: ......
Page 17: ...1 General S5U1C17001C Manual 1 General ...
Page 18: ......
Page 21: ...1 2 Install S5U1C17001C Manual 2 Installation ...
Page 22: ......
Page 29: ...3 SoftDev S5U1C17001C Manual 3 Software Development Procedures ...
Page 30: ......
Page 103: ...4 SrcFiles S5U1C17001C Manual 4 Source files ...
Page 104: ......
Page 121: ...5 IDE S5U1C17001C Manual 5 gnU17 iDE ...
Page 122: ......
Page 365: ...6 Compiler S5U1C17001C Manual 6 C Compiler ...
Page 366: ......
Page 385: ...7 Library S5U1C17001C Manual 7 library ...
Page 386: ......
Page 405: ...8 Assemblr S5U1C17001C Manual 8 assembler ...
Page 406: ......
Page 439: ...9 Linker S5U1C17001C Manual 9 linker ...
Page 440: ......
Page 449: ...10 Debugger S5U1C17001C Manual 10 Debugger ...
Page 450: ......
Page 626: ...11 Tools S5U1C17001C Manual 11 Other Tools ...
Page 627: ......
Page 696: ...S1C17 Family C Compiler Package Quick Reference Reference ...