QP_stream: union QP_cookie magic;
The system-dependent address of the current position in a stream is
stored in the magic
field of the stream structure. It is only
used when there is any kind of seek to be performed on the stream.
This field is a C type union cookie
, which is defined in
<quintus/quintus.h>
as follows:
union QP_cookie { struct RFA { int BlockNumber; short Offset; } vms_rfa; int mvs_rrn; int cms_recno; off_t byteno; int user_defined[2]; } magic;
Depending on the host operating system,
different field names of union cookie
are used to store
the position address of the stream depending on the host operating
system. Under UNIX, magic.byteno
is used to record the current location
of the file pointer as an absolute byte offset from the beginning of the
stream;
magic.vms_rfa
is used on VMS;
magic.mvs_rrn
is used on MVS; magic.cms_recno
is used on CMS.
magic.user_defined
is used for a user's specific method of recording
the current location of a stream. These values must be maintained in
the bottom layer functions of a stream with seek permission.