home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume8 / hint / part01 / hint.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-08-24  |  3.4 KB  |  156 lines

  1. /* hint.h -- constant, variable and function declarations
  2.    Copyright (C) 1989 David MacKenzie
  3.  
  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 1, or (at your option)
  7.    any later version.
  8.  
  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU General Public License
  15.    along with this program; if not, write to the Free Software
  16.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
  17.  
  18. #ifndef USG
  19. #define strrchr rindex
  20. #endif
  21.  
  22. /* Enforced limits on hint duration. */
  23. #define MIN_SEC 5
  24. #define MAX_SEC 60
  25.  
  26. /* Maximum length of message (who has terminals wider than this?). */
  27. #define MAX_MESSAGE 400
  28.  
  29. /* Default status line width if not defined in termcap. */
  30. #define DEF_WS 78
  31.  
  32. /* The bit that determines hint y or n. */
  33. #define HINTBIT 00010
  34.  
  35. /* Environment variable to check for options. */
  36. #define ENVAR "HINT"
  37.  
  38. #include <stdio.h>
  39. #include <sys/types.h>
  40. #include <sys/stat.h>
  41. #include <ctype.h>
  42. #include <pwd.h>
  43. #include <fcntl.h>
  44. #include <signal.h>
  45. #ifdef USG
  46. #include <termio.h>
  47. #else
  48. #include <sgtty.h>
  49. #endif
  50.  
  51. #include "stov.h"
  52. #include "hinttab.h"
  53.  
  54. /* List of ttys to send hint to. */
  55. struct ttylist
  56. {
  57.   char *tt_user;
  58.   char *tt_tty;            /* Contains no leading path. */
  59.   struct hinttab tt_ht;
  60.   struct ttylist *tt_next;
  61. };
  62.  
  63. #ifdef ALLOCATE
  64. #define EXTERN
  65. #define INIT(x) = {x}
  66. #else
  67. #define EXTERN extern
  68. #define INIT(x)
  69. #endif
  70.  
  71. /* Base of the name this program was run with. */
  72. EXTERN char *program_name;
  73.  
  74. /* Terminal type. */
  75. EXTERN char *term;
  76.  
  77. /* The hint to send. */
  78. EXTERN char message[MAX_MESSAGE];
  79.  
  80. /* If nonzero, put the name at the start of the hint. */
  81. EXTERN int name_at_end INIT (1);
  82.  
  83. /* If nonzero, erase the hint. */
  84. EXTERN int forever INIT (0);
  85.  
  86. /* If nonzero, try to use bell capability. */
  87. EXTERN int use_bell INIT (1);
  88.  
  89. /* If nonzero, try to use visual bell capability. */
  90. EXTERN int use_vbell INIT (1);
  91.  
  92. /* Seconds between sending the hint and erasing it. */
  93. EXTERN int duration INIT (10);
  94.  
  95. char *getenv ();
  96. char *getlogin ();
  97. char *malloc ();
  98. char *realloc ();
  99. char *strcat ();
  100. char *strcpy ();
  101. char *strncat ();
  102. char *strncpy ();
  103. char *strrchr ();
  104. char *strtok ();
  105. char *tgetstr ();
  106. char *tgoto ();
  107. char *ttyname ();
  108. int strcspn ();
  109. int strspn ();
  110. off_t lseek ();
  111. struct passwd *getpwuid ();
  112. unsigned sleep ();
  113. void perror ();
  114. void exit ();
  115. void free ();
  116.  
  117. char *basename ();
  118. char *pwname ();
  119. char *strdup ();
  120. char *whoami ();
  121. char *xmalloc ();
  122. char *xrealloc ();
  123. int addmatch ();
  124. int adduser ();
  125. int buffer_char ();
  126. int hintable ();
  127. int istty ();
  128. struct args *stov ();
  129. struct hinttab *gethttty ();
  130. struct ttylist *next_tty ();
  131. void add_recipients ();
  132. void addtty ();
  133. void append_word ();
  134. void buffer_string ();
  135. void endhtent ();
  136. void erasehint ();
  137. void flush_buffer ();
  138. void get_speed ();
  139. void ignored ();
  140. void init_buffer ();
  141. void parse_environment ();
  142. void parse_options ();
  143. void pfatal ();
  144. void pnonfatal ();
  145. void prompt ();
  146. void sendhint ();
  147. void set_signals ();
  148. void set_status ();
  149. void sethtapp ();
  150. void sethtent ();
  151. void setup_termcap ();
  152. void show_status ();
  153. void updatetab ();
  154. void usage ();
  155. void writehtent ();
  156.