Initial import from FreeBSD RELENG_4:
[dragonfly.git] / gnu / usr.bin / man / lib / gripes.c
1 /*
2  * gripes.c
3  *
4  * Copyright (c) 1990, 1991, John W. Eaton.
5  *
6  * You may distribute under the terms of the GNU General Public
7  * License as specified in the file COPYING that comes with the man
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 #ifdef STDC_HEADERS
21 #include <stdlib.h>
22 #else
23 extern int fprintf ();
24 extern int fflush ();
25 extern int exit ();
26 #endif
27
28 extern char *prognam;
29
30 void
31 gripe_no_name (section)
32      char *section;
33 {
34   if (section)
35     fprintf (stderr, "What manual page do you want from section %s?\n",
36              section);
37   else
38     fprintf (stderr, "What manual page do you want?\n");
39
40   fflush (stderr);
41 }
42
43 void
44 gripe_reading_man_file (name)
45      char *name;
46 {
47   fprintf (stderr, "Read access denied for file %s\n", name);
48
49   fflush (stderr);
50 }
51
52 void
53 gripe_converting_name (name, to_cat)
54      char *name;
55      int to_cat;
56 {
57   if (to_cat)
58     fprintf (stderr, "Error converting %s to cat name\n", name);
59   else
60     fprintf (stderr, "Error converting %s to man name\n", name);
61
62   fflush (stderr);
63
64   exit (1);
65 }
66
67 void
68 gripe_system_command (status)
69      int status;
70 {
71   fprintf (stderr, "Error executing formatting or display command.\n");
72   fprintf (stderr, "system command exited with status %d\n", status);
73
74   fflush (stderr);
75 }
76
77 void
78 gripe_not_found (name, section)
79      char *name, *section;
80 {
81   if (section)
82     fprintf (stderr, "No entry for %s in section %s of the manual\n",
83              name, section);
84   else
85     fprintf (stderr, "No manual entry for %s\n", name);
86
87   fflush (stderr);
88 }
89
90 void
91 gripe_incompatible (s)
92      char *s;
93 {
94   fprintf (stderr, "%s: incompatible options %s\n", prognam, s);
95
96   fflush (stderr);
97
98   exit (1);
99 }
100
101 void
102 gripe_getting_mp_config (file)
103      char *file;
104 {
105   fprintf (stderr, "%s: unable to find the file %s\n", prognam, file);
106
107   fflush (stderr);
108
109   exit (1);
110 }
111
112 void
113 gripe_reading_mp_config (file)
114      char *file;
115 {
116   fprintf (stderr, "%s: unable to make sense of the file %s\n", prognam, file);
117
118   fflush (stderr);
119
120   exit (1);
121 }
122
123 void
124 gripe_invalid_section (section)
125      char *section;
126 {
127   fprintf (stderr, "%s: invalid section (%s) selected\n", prognam, section);
128
129   fflush (stderr);
130
131   exit (1);
132 }
133
134 void
135 gripe_manpath ()
136 {
137   fprintf (stderr, "%s: manpath is null\n", prognam);
138
139   fflush (stderr);
140
141   exit (1);
142 }
143
144 void
145 gripe_alloc (bytes, object)
146      int bytes;
147      char *object;
148 {
149   fprintf (stderr, "%s: can't malloc %d bytes for %s\n",
150            prognam, bytes, object);
151
152   fflush (stderr);
153
154   exit (1);
155 }
156
157 void
158 gripe_roff_command_from_file (file)
159      char *file;
160 {
161   fprintf (stderr, "Error parsing *roff command from file %s\n", file);
162
163   fflush (stderr);
164 }
165
166 void
167 gripe_roff_command_from_env ()
168 {
169   fprintf (stderr, "Error parsing MANROFFSEQ.  Using system defaults.\n");
170
171   fflush (stderr);
172 }
173
174 void
175 gripe_roff_command_from_command_line ()
176 {
177   fprintf (stderr, "Error parsing *roff command from command line.\n");
178
179   fflush (stderr);
180 }