gtpc2mimC/C++ Language Support User's Guide

TPFxd_getPosition-Retrieve Current Positioning Information

This function is called to retrieve the current positioning information.

Format

#include <c$tpxd.h>
long TPFxd_getPosition (TPFxd_extToken  *token,
                        TPFxd_location  *positioningString);

token
The returned token from the TPFxd_archiveStart or TPFxd_open request.

positioningString
The location to use to return the current positioning string. This string can then be used to reposition the current position.

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