1BSD/man7/htmp.7

.th HTMP VII 9/24/77
.sh NAME
htmp \- routines for easily dealing with htmp data base
.sh DESCRIPTION
This set of routines allows easy use of the
.it htmp
(V) data base and insulates programs from changes to its structure.
The routines all deal with the contents of one
.it htmp
structure which has the following form:
.s3
.dt
	\fBstruct\fR htmp {
.br
		\fBint\fR	uid;
.br
		\fBchar\fR	home[28];
.br
		\fBint\fR	ttytype;
.br
	} hentry;
.s3
The entry points defined are:
.s3
.lp +10 8
hget(tty)
.lp +10 8
\fBint\fR tty;
.br
Get the entry for the
.it tty
specified from the data base and place it in
.it hentry.
Returns 0 if success, -1 if failure.
If this call fails,
.it perror
(III)
can be used to generate an appropriate diagnostic.
.s3
.lp +10 8
hput(tty)
.lp +10 8
\fBint\fR tty;
.br
Like
.it hget
but updates the entry for
.it tty
in the data base
from
.it hentry.
.s3
.lp +10 8
\fBchar\fR *
.lp +10 8
hgethome()
.br
Returns a pointer to the home directory
entry for
.it hentry.
.s3
.lp +10 8
hsethome(cp)
.lp +10 8
\fBchar\fR *cp;
.br
Sets the home directory entry in
.it hentry
to be the string pointed to by
.it cp.
This string will be truncated if it is too long.
.s3
.lp +10 8
hgetuid()
.br
Returns the
.it uid
from
.it hentry.
.s3
.lp +10 8
hsetuid(uid)
.lp +10 8
\fBint\fR uid;
.br
Sets the
.it uid
in
.it hentry
to be
.it uid.
.s3
.lp +10 8
hgettype()
.br
Returns the
.it ttytype
from
.it hentry.
.s3
.lp +10 8
\fBchar\fR *
.lp +10 8
hsgettype()
.br
Returns a pointer to the type
as a string.
The pointer is in a static place and must be saved if
.it hsgettype
is to be called again.
.s3
.lp +10 8
hsettype(type)
.lp +10 8
\fBint\fR type;
.br
Sets the
.it ttytype
in
.it hentry
to be
.it type.
.i0
.sh FILES
.dt
/etc/htmp	htmp data base
.sh SEE\ ALSO
htmp (V), sethome (VI), ttytype (VI)
.sh AUTHOR
William Joy