gtpc2mim | C/C++ Language Support User's Guide |
This function is called to retrieve the current positioning information.
Format
#include <c$tpxd.h> long TPFxd_getPosition (TPFxd_extToken *token, TPFxd_location *positioningString);
Normal Return
The normal return is a positive value. The positioning string address provided on the function call will have the updated positioning string information in it.
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
The TPFxd_open function must be called before this request.
Examples
The following example gets the position of the external device before writing an object, writes an object, and positions the device to the point before the object that was just written.
#include <c$tpxd.h> long example() { TPFxd_extToken *token; TPFxd_locationMap wherefirst; TPFxd_location whereIwas; 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 ); returncode = TPFxd_getPosition (token, &whereIwas); printf("getPosition return code is %i\n",returncode); stufftowrite = malloc(howbigitis); TPFxd_write(token,stufftowrite,&howbigitis); free(stufftowrite); TPFxd_setPosition (token, &whereIwas);
·
·
·
}
Related Information