getptabent(3) getptabent(3)NAME getptabent, addptabent, endptabent, setptabent, numbptabent - get partition table file entry SYNOPSIS #include <stdio.h> #include <apple/ptabent.h> struct ptabent *getptabent(filep) FILE *filep; int addptabent(filep, ptab) FILE *filep; struct ptabent *ptab; int endptabent(filep) FILE *filep; FILE *setptabent(fname, type) char *fname; char *type; int numptabent(filep) FILE *filep; cc [flags] files -lptab [libraries] DESCRIPTION setptabent opens a partition table file and returns a file pointer which can then be used with getptabent or addptabent. The type argument is the same as in fopen(3). getptabent returns a pointer to an object with the following structure containing the broken-out fields of a line in the partition table file. The fields have meanings described in ptab(4). struct ptabent { char *ptab_name; /* partition name */ char *ptab_type; /* partition type */ int ptab_ctrl; /* controller number */ int ptab_disk; /* disk number */ int ptab_part; /* partition number */ }; addptabent adds the ptabent structure ptab to the end of the open file filep. numptabent returns the number of partition table file entries and has the effect of rewinding the partition table file to allow repeated searches. endptabtent closes the file. January 1992 1
getptabent(3) getptabent(3)FILES /etc/ptab STATUS MESSAGES AND VALUES A null pointer (0) is returned on EOF or error by setptabent and getptabent. addptabent, endptabent, and numbptabent return EOF on error. LIMITATIONS The returned ptabent structure points to static information that is overwritten in each call. SEE ALSO pname(1M), ptab(4) 2 January 1992