3 getttyent, getttynam, setttyent, endttyent \- interface to /etc/ttytab
9 struct ttyent *getttyent(void)
10 struct ttyent *getttynam(const char *\fIname\fP)
18 functions provide an interface to the /etc/ttytab. (See
21 To read one of these files one calls
23 several times to read the entries in the table until NULL is returned for
29 file for the given terminal device. It is equivalent to a call to
33 to locate the entry, and a final
38 opens or rewinds the ttytab database, and
39 .B endttyent() closes it.
41 opens the database if not already open, but does not close it.
43 The struct ttyent is defined by <ttyent.h> as follows:
48 char *ty_name; /* Name of the terminal device. */
49 char *ty_type; /* Terminal type name (termcap(3)). */
50 char **ty_getty; /* Program to run, normally getty. */
51 char **ty_init; /* Initialization command, normally stty. */
55 A valid entry has at least two strings, so both
59 are filled in. The optional
63 may be NULL (field omitted), point to a pointer that is NULL (null lenght
64 field, i.e. ""), or an array of strings terminated by a NULL (field
65 present). For now no useful distinction can be made between a omitted field
66 and an empty field, so treat both cases as an omission.
70 The terminal device database
78 has the same return value and error codes as the
80 call it uses to open the ttytab file. The
82 functions return NULL on end of file, entry not found, or error. You can
85 to zero before the call and check it after.
90 return a pointer to static storage that is overwritten in each call.
98 fields in common with the BSD implementation. This does not seem to be a
99 problem, because most third party software that need to know about terminals
104 Kees J. Bot (kjb@cs.vu.nl)
107 .\" $PchId: getttyent.3,v 1.2 1996/04/11 06:57:26 philip Exp $