 |
PK_SESSION_indexio_t |
|
struct PK_SESSION_indexio_s
{
int (*ffoprd)(int guise, const char name[], void *context);
int (*ffopwr)(int guise, const char name[],
const char pr2[], void *context);
int (*ucoprd)(int guise, const PK_UCHAR_t name[], void *context);
int (*ucopwr)(int guise, const PK_UCHAR_t name[],
const char pr2[], void *context);
int (*ffread)(int nmax, char buffer[], int *nactual, void *context);
int (*ffwrit)(int nchars, const char buffer[], void *context);
int (*ffseek)(size_t pos, void *context);
int (*ffclos)(int action, void *context);
};
typedef struct PK_SESSION_indexio_s PK_SESSION_indexio_t;
This structure contains functions pertinent to receiving and writing
indexed XT data.
Used in:
PK_SESSION_ask_indexio
PK_SESSION_register_indexio
Description of fields:
'ffoprd' This routine opens the FFBNRY file specified by its 'name'
argument and stores any required information in its 'context'.
As used by PK_PART_receive, 'guise' will be FFCXMT or FFCXMP.
The file pointer on return from this call is deemed to be zero.
'ffopwr' This routine opens the file specified by its 'name' argument,
as format FFBNRY, and stores any required information in
its 'context'. As used by PK_PART_transmit, 'guise' will be
FFCXMT; used by PK_PARTITION_transmit, 'guise' will be
FFCXMP. The file pointer on return from this call is deemed
to be zero.
'ucoprd' This routine opens the FFBNRY file specified by its 'name'
argument and stores any required information in its 'context'.
As used by PK_PART_receive_u, 'guise' will be FFCXMT or FFCXMP.
The file pointer on return from this call is deemed to be zero.
'ucopwr' This routine opens the file specified by its 'name' argument
as format FFBNRY, and stores any required information in
its 'context'. As used by PK_PART_transmit_u, 'guise' will be
FFCXMT; used by PK_PARTITION_transmit_u, 'guise' will be
FFCXMP. The file pointer on return from this call is deemed
to be zero.
'ffread' This routine reads from file (starting at the current position
of the file pointer) storing a maximum of nmax bytes in the
given buffer and returning the actual number of bytes read
as *nactual. The file pointer is incremented by the number of
bytes read. If the routine is only able to read a maximum of N
bytes (where 0 < N < nmax) Parasolid will make follow-up calls
to 'ffread'. If 'ffread' reads at least 1 character the return
code is set to FR_no_errors (or possibly FR_read_fail). The
code FR_end_of_file is only returned when no bytes have been
read.
'ffwrit' This routine writes the given bytes to file, starting at the
current file position. The file pointer is incremented by the
number of bytes written.
'ffseek' This routine resets the file pointer within the file to a
position relative to the assumed zero position after the call
to open the file. Subsequent reading or writing will start
from this position.
'ffclos' Receive: this routine closes a file which has been opened
with a call to 'ffoprd' or 'ucoprd'.
Transmit: this routine closes a file which has been opened
with a call to 'ffopwr' or 'ucopwr'. Parasolid will determine
whether to retain the file (FFNORM) or to delete it (FFABOR).
Applications may implement their Indexed Frustrum as a thin layer on top of
their existing Frustrum, as the major difference is that the "open for write"
functions create the underlying file for update (e.g., mode "wb+" rather than
"wb"). Then their context can comprise the guise (FFCXMT or FFCXMP), the
Frustrum stream identifier (strid) and the file pointer after successful open;
the latter is then the conversion required between the position passed to
'ffseek' by Parasolid and that in the data held by the Frustrum.