FDPICLABEL(3H) — Pixar Programmer’s Manual — libfdpicio
NAME
FdPicLseekLabel− determine the length of a picture label
FdPicReadLabel− read a picture label
FdPicWriteLabel− write a picture label
SYNOPSIS
#include <fdpicio.h>
long FdPicLseekLabel(pdptr, offset, whence)
PFILE ∗pdptr;
long offset;
int whence;
int FdPicReadLabel(pdptr, buffer, nbytes)
PFILE ∗pdptr;
char ∗buffer;
int nbytes;
int FdPicWriteLabel(pdptr, buffer, nbytes)
PFILE ∗pdptr;
char ∗buffer;
int nbytes;
DESCRIPTION
The picture descriptor pdptr refers to a picture file open for reading or writing. The pointer for the file is set as follows:
If whence is 0, the pointer is set to offset bytes.
If whence is 1, the pointer is set to its current location plus offset.
If whence is 2, the pointer is set to the end-of-label plus offset. The end-of-label is taken as the first null character after the start of the label.
The returned value is the resulting offset into the label; -1 is returned in case of invalid picture descriptor, seek to a position before the start of the label, or improper whence. The read/write pointer is untouched by the first and last errors; the pointer is set to zero after an attempt to seek a position before the start of the label.
FdPicReadLabel reads the next nbytes bytes of the picture label into the array buffer. It is not guaranteed that all nbytes bytes will be read. Furthermore, it may read past the end-of-label, leaving the read/write pointer beyond the first null character of the label. In any event, the number of characters read is returned as the value of the procedure.
If the returned value is less than nbytes, end-of-label has been reached and likely overrun. If you need accuracy in the length of label, use the returned value from FdPicLseekLabel(pdptr,0,2).
FdPicWriteLabel writes the next nbytes bytes into the picture label from the array buffer. The number of characters written is returned. Writing a null character in the midst of the buffer will induce an end-of-label and set the read/write pointer beyond this end-of-label.
The FdPicSetLabel(labelptr) routine described along with FdPicCreat is equivalent to a FdPicLseekLabel(pdtpr,0,0) followed by a FdPicWriteLabel(pdptr,labelptr,strlen(labelptr)) in writing the label and setting the label lseek pointer.
FdPicCreat() and FdPicOpen() set the read/write pointer of the label to zero.
LIBRARY
libfdpicio.a
SEE ALSO
libfdpicio (3H)− overview of the picio library
FdPicClose (3H), FdPicCreat (3H), FdPicRead (3H), FdPicDecode (3H), FdPicEncode (3H).
Release β — Last change: 8/3/88