gtpc2miw | C/C++ Language Support User's Guide |
This function is used to write data from the malloc area to an external device. The maximum write size is 32 000 bytes.
Format
#include <c$tpxd.h> long TPFxd_write (TPFxd_extToken *token, u_char *data, long *dataLength);
Normal Return
A return code of 1 indicates a normal return.
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 writes a core area to an external device.
#include <c$tpxd.h> long example() { TPFxd_extToken *token; TPFxd_locationMap wherefirst; enum tpxd_mode mode; enum tpxd_opts access; long howbigitis; long howlongtowait; char *message; long returncode; char *stufftowrite; howlongtowait = 60; howbigitis = 32000; message = NULL; token = NULL; mode = WT; access = IMMEDIATE; TPFxd_archiveStart (&token, mode, access); TPFxd_open (&token, &wherefirst, howbigitis, howlongtowait, message, mode ); stufftowrite = malloc(howbigitis);
·
·
·
returncode = TPFxd_write(token,stufftowrite,&howbigitis); printf("write complete with return code %i\n",returncode); free(stufftowrite);
·
·
·
}
Related Information