IBTAB(3N) — Silicon Graphics
NAME
ibtab: setibfile, setibent, endibent, getibent, ibnflags − package for dealing with ibtab files
SYNOPSIS
setibfile (file)
char *file;
int setibent ( )
endibent ( )
struct ibtab *getibent ( )
int ibnflags (flagstr, val)
char *flagstr;
int *val;
DESCRIPTION
This is a basic set of routines for dealing with ibtab(4) format files such as /etc/ibtab. By default /etc/ibtab is used. setibfile changes the default within the calling program.
setibent opens and positions the file at the origin. getibent returns a pointer to a (static) structure containing the "next" entry. 0 is returned at the end-of-file. The structure is declared in the include file <ibtab.h>. endibent closes the file.
ibnflags interprets the flags (ibt_flags) field, saving its numeric equivalent in the caller-supplied val. The return value is 0 if the string is a legitimate expression, −1 otherwise.
EXAMPLE
# include "ibtab.h"
extern struct ibtab *getibent();
struct ibtab *ip;
int val;
...
setibent();
while( (ip = getibent()) != 0 )
{
if( ibnflags(ip->ibt_flags,&val) < 0 )
printf("illegal flags string %s\n",ip->ibt_flags);
else
printf("%s --> 0x%x\n",ip->ibt_flags,val);
}
endibent();
FILES
/etc/ibtab
SEE ALSO
BUGS
getibent stores data in static areas. Return values are over-written by subsequent calls.
Version 3.6 — December 20, 1987