DEFINITION MODULE UnixInfo;
FROM String IMPORT STRING;
EXPORT QUALIFIED
   passwd, tty, person, SEX,
   ForAllUsers, USERproc,
   GetPasswdEntry, GetTerminalEntry, GetOwner;

TYPE

   USERproc = PROCEDURE (STRING, STRING);

   SEX      = (male, female, neuter);
   
   passwd   = RECORD                          (* /etc/passwd *)
                 name,                             (* graham *)
                 passwd          :STRING;          (* dkjhhgdhgfjgf *)
                 uid, gid, quota :INTEGER;         (* 10, 100, 0 *)
                 fullname,
                 office,
                 phoneno,                          (* Graham Toal,,379 *)
                 gecos,
                 dir,                              (* /mnt/graham *)
                 shell           :STRING;          (* /bin/csh    *)
                 Sex             :SEX
              END;

   tty      = RECORD             (* /etc/ttytype, /etc/ttywhere *)
                 DeviceName,                       (* tty02 *)
                 TermcapType,                      (* mode3 *)
                 Hardware,                         (* BBC micro *)
                 Location,                         (* Graham Toal's
                                                       workstation *)
                 OwnerName       :STRING;          (* graham *)
                 ownerpresent    :BOOLEAN;
                 pre, post       :STRING;
              END;

   person   = RECORD             (* /etc/passwd, /etc/people, ~<name>/.gone *)
                 name,                              (* graham *)
                 ProperName,                        (* Graham Toal *)
                 Location,                          (* R&D building *)
                 PhoneNo         :STRING;           (* 379 *)
                 Sex             :SEX;              (* Male *)
                 LastLocation    :STRING;           (* to the Wimpy *)
              END;


PROCEDURE GetPasswdEntry (UserName :STRING; VAR UserEntry :passwd);

PROCEDURE GetTerminalEntry (TTYName :STRING; VAR TTYEntry :tty);

PROCEDURE GetOwner (TTYName :STRING; VAR Owner :person);

PROCEDURE ForAllUsers (UserProc :USERproc);

END UnixInfo.
