home *** CD-ROM | disk | FTP | other *** search
- /* hint.h -- constant, variable and function declarations
- Copyright (C) 1989 David MacKenzie
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 1, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
- #ifndef USG
- #define strrchr rindex
- #endif
-
- /* Enforced limits on hint duration. */
- #define MIN_SEC 5
- #define MAX_SEC 60
-
- /* Maximum length of message (who has terminals wider than this?). */
- #define MAX_MESSAGE 400
-
- /* Default status line width if not defined in termcap. */
- #define DEF_WS 78
-
- /* The bit that determines hint y or n. */
- #define HINTBIT 00010
-
- /* Environment variable to check for options. */
- #define ENVAR "HINT"
-
- #include <stdio.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <ctype.h>
- #include <pwd.h>
- #include <fcntl.h>
- #include <signal.h>
- #ifdef USG
- #include <termio.h>
- #else
- #include <sgtty.h>
- #endif
-
- #include "stov.h"
- #include "hinttab.h"
-
- /* List of ttys to send hint to. */
- struct ttylist
- {
- char *tt_user;
- char *tt_tty; /* Contains no leading path. */
- struct hinttab tt_ht;
- struct ttylist *tt_next;
- };
-
- #ifdef ALLOCATE
- #define EXTERN
- #define INIT(x) = {x}
- #else
- #define EXTERN extern
- #define INIT(x)
- #endif
-
- /* Base of the name this program was run with. */
- EXTERN char *program_name;
-
- /* Terminal type. */
- EXTERN char *term;
-
- /* The hint to send. */
- EXTERN char message[MAX_MESSAGE];
-
- /* If nonzero, put the name at the start of the hint. */
- EXTERN int name_at_end INIT (1);
-
- /* If nonzero, erase the hint. */
- EXTERN int forever INIT (0);
-
- /* If nonzero, try to use bell capability. */
- EXTERN int use_bell INIT (1);
-
- /* If nonzero, try to use visual bell capability. */
- EXTERN int use_vbell INIT (1);
-
- /* Seconds between sending the hint and erasing it. */
- EXTERN int duration INIT (10);
-
- char *getenv ();
- char *getlogin ();
- char *malloc ();
- char *realloc ();
- char *strcat ();
- char *strcpy ();
- char *strncat ();
- char *strncpy ();
- char *strrchr ();
- char *strtok ();
- char *tgetstr ();
- char *tgoto ();
- char *ttyname ();
- int strcspn ();
- int strspn ();
- off_t lseek ();
- struct passwd *getpwuid ();
- unsigned sleep ();
- void perror ();
- void exit ();
- void free ();
-
- char *basename ();
- char *pwname ();
- char *strdup ();
- char *whoami ();
- char *xmalloc ();
- char *xrealloc ();
- int addmatch ();
- int adduser ();
- int buffer_char ();
- int hintable ();
- int istty ();
- struct args *stov ();
- struct hinttab *gethttty ();
- struct ttylist *next_tty ();
- void add_recipients ();
- void addtty ();
- void append_word ();
- void buffer_string ();
- void endhtent ();
- void erasehint ();
- void flush_buffer ();
- void get_speed ();
- void ignored ();
- void init_buffer ();
- void parse_environment ();
- void parse_options ();
- void pfatal ();
- void pnonfatal ();
- void prompt ();
- void sendhint ();
- void set_signals ();
- void set_status ();
- void sethtapp ();
- void sethtent ();
- void setup_termcap ();
- void show_status ();
- void updatetab ();
- void usage ();
- void writehtent ();
-