gtpc2mis | C/C++ Language Support User's Guide |
This function is used to read data from an external device into a buffer in the malloc area. The maximum read size is 32 000 bytes.
Format
#include <c$tpxd.h> long TPFxd_read (TPFxd_extToken *token, u_char *buffer, long *bufferLength);
Normal Return
The normal return is a positive value; it is the number of bytes read.
Error Return
An error return is indicated by a negative return code. For a list of error codes applicable to this function, see Error Codes.
Programming Considerations
Examples
The following example reads the first record from the position indicated.
#include <c$tpxd.h> long example(TPFxd_locationMap wherefirst) { TPFxd_extToken *token; enum tpxd_mode mode; long howbigitis; long howlongtowait; char *message; char *whatWasRead; long returncode; howlongtowait = 60; howbigitis = 32000; message = NULL; token = NULL; mode = RD; TPFxd_open (&token, &wherefirst, howbigitis, howlongtowait, message, mode ); malloc (whatWasRead,howbigitis); returncode = TPFxd_read (token, whatWasRead);
·
·
·
}
Related Information