home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / GNUMAN.ZIP / gripes.c < prev    next >
C/C++ Source or Header  |  1992-09-03  |  3KB  |  154 lines

  1. /*
  2.  * gripes.c
  3.  *
  4.  * Copyright (c) 1991, John W. Eaton.
  5.  *
  6.  * You may distribute under the terms of the GNU General Public
  7.  * License as specified in the README file that comes with the man 1.0
  8.  * distribution.
  9.  *
  10.  * John W. Eaton
  11.  * jwe@che.utexas.edu
  12.  * Department of Chemical Engineering
  13.  * The University of Texas at Austin
  14.  * Austin, Texas  78712
  15.  */
  16.  
  17. #include <stdio.h>
  18. #include "gripes.h"
  19.  
  20. #ifndef STD_HEADERS
  21. extern int fprintf ();
  22. extern int fflush ();
  23. extern int exit ();
  24. #endif
  25.  
  26. extern char *prognam;
  27.  
  28. void
  29. gripe_no_name (section)
  30.      char *section;
  31. {
  32.   if (section)
  33.     fprintf (stderr, "What manual page do you want from section %s?\n",
  34.          section);
  35.   else
  36.     fprintf (stderr, "What manual page do you want?\n");
  37.  
  38.   fflush (stderr);
  39. }
  40.  
  41. void
  42. gripe_reading_man_file (name)
  43.      char *name;
  44. {
  45.   fprintf (stderr, "Read access denied for file %s\n", name);
  46.  
  47.   fflush (stderr);
  48. }
  49.  
  50. void
  51. gripe_converting_name (name, to_cat)
  52.      char *name;
  53.      int to_cat;
  54. {
  55.   if (to_cat)
  56.     fprintf (stderr, "Error converting %s to cat name\n", name);
  57.   else
  58.     fprintf (stderr, "Error converting %s to man name\n", name);
  59.  
  60.   fflush (stderr);
  61.  
  62.   exit (1);
  63. }
  64.  
  65. void
  66. gripe_system_command (status)
  67.      int status;
  68. {
  69.   fprintf (stderr, "Error executing formatting or display command.\n");
  70.   fprintf (stderr, "system command exited with status %d\n", status);
  71.  
  72.   fflush (stderr);
  73. }
  74.  
  75. void
  76. gripe_not_found (name, section)
  77.      char *name, *section;
  78. {
  79.   if (section)
  80.     fprintf (stderr, "No entry for %s in section %s of the manual\n",
  81.          name, section);
  82.   else
  83.     fprintf (stderr, "No manual entry for %s\n", name);
  84.  
  85.   fflush (stderr);
  86. }
  87.  
  88. void
  89. gripe_incompatible (s)
  90.      char *s;
  91. {
  92.   fprintf (stderr, "%s: incompatible options %s\n", prognam, s);
  93.  
  94.   fflush (stderr);
  95.  
  96.   exit (1);
  97. }
  98.  
  99. void
  100. gripe_getting_mp_config (file)
  101.      char *file;
  102. {
  103.   fprintf (stderr, "%s: unable to find the file %s\n", prognam, file);
  104.  
  105.   fflush (stderr);
  106.  
  107.   exit (1);
  108. }
  109.  
  110. void
  111. gripe_reading_mp_config (file)
  112.      char *file;
  113. {
  114.   fprintf (stderr, "%s: unable to make sense of the file %s\n", prognam, file);
  115.  
  116.   fflush (stderr);
  117.  
  118.   exit (1);
  119. }
  120.  
  121. void
  122. gripe_invalid_section (section)
  123.      char *section;
  124. {
  125.   fprintf (stderr, "%s: invalid section (%s) selected\n", prognam, section);
  126.  
  127.   fflush (stderr);
  128.  
  129.   exit (1);
  130. }
  131.  
  132. void
  133. gripe_manpath ()
  134. {
  135.   fprintf (stderr, "%s: manpath is null\n", prognam);
  136.  
  137.   fflush (stderr);
  138.  
  139.   exit (1);
  140. }
  141.  
  142. void
  143. gripe_alloc (bytes, object)
  144.      int bytes;
  145.      char *object;
  146. {
  147.   fprintf (stderr, "%s: can't malloc %d bytes for %s\n",
  148.        prognam, bytes, object);
  149.  
  150.   fflush (stderr);
  151.  
  152.   exit (1);
  153. }
  154.