#include <stdio.h>
#include <string.h>
#include <ctype.h>
Go to the source code of this file.
◆ LINE_LEN
◆ NUM_PROC
◆ RECOMMENDED_LEN
◆ get_next()
Definition at line 29 of file checklibs.c.
30{
36 {
40 {
43 }
46
48 {
50 }
53 {
55 }
56 }
57}
unsigned char buf[LINE_LEN]
◆ main()
Definition at line 280 of file checklibs.c.
281{
286
291 if (argc==1)
292 {
294 }
295 else
296 {
297 if (argc!=2) {
printf(
"usage: %s lib-file\n",
argv[0]);
return 1;}
301 }
302
307
308 while(1)
309 {
311 {
312 unsigned char *
pp=
buf;
314 {
315 if ((*
pp!=
' ')&&(*
pp!=
'\t'))
break;
317 }
319 {
322 while((*
pp)==
' ')
pp++;
323
324
325
326
327 }
328 }
330 {
331 unsigned char *
pp=
buf;
333 {
334 if ((*
pp!=
' ')&&(*
pp!=
'\t'))
break;
336 }
338 }
340 {
341 unsigned char *
pp=
buf;
343 {
344 if ((*
pp!=
' ')&&(*
pp!=
'\t'))
break;
346 }
348 }
350 {
351 printf(
"error: use a space between LIB and \"\n");
353 {
printf(
"end of header ? LIB should be in col. 1:>>%s<<\n",
buf); }
354 break;
355 }
357 {
359 {
printf(
"end of header ? LIB should be in col. 1:>>%s<<\n",
buf); }
360 break;
361 }
363 {
365 {
printf(
"end of header ? proc should be in col. 1:>>%s<<\n",
buf); }
366 break;
367 }
370 }
372
374 {
376 {
377 printf(
"error: 'static' without 'proc' found\n");
379 }
382 {
383 unsigned char *
pp=
buf;
385 while(*
pp==
' ')
pp++;
387 {
388 printf(
"warning: proc should be in col. 1: line %d:%s",
lines,
buf);
389 }
391 {
393 }
400 {
402 }
404 {
405 printf(
"hint: global proc %s not found in header\n",
pp);
407 }
408 else
409 {
415
417
419 {
423 {
425 break;
426 }
428 }
429 }
430 }
432 }
433 {
436 {
438 else
439 {
442 }
443 }
444 }
445
450
451 printf(
"\nGENERAL SUMMARY:\n");
452 if(
tabs!=0)
printf(
"warning: lib should not contain tabs, >=%d found\n",
tabs);
458 {
460 }
462 {
463 printf(
"error: some lines are in DOS format, some not (%d/%d)\n",
crlf,
lines);
464 }
470 return 0;
471}
void scan_proc_help(const char *s)
unsigned char proc_found[NUM_PROC]
unsigned char have_doc[NUM_PROC]
unsigned char have_example[NUM_PROC]
unsigned char * proc[NUM_PROC]
◆ scan_info()
Definition at line 151 of file checklibs.c.
152{
163
165 {
167 {
169
171 printf(
"error: LIBRARY: must be the first section in info\n");
172 }
174 {
176 printf(
"error: only KEYWORDS/SEE ALSO may follow PROCEDURES\n");
178 }
180 {
183 printf(
"error: only KEYWORDS/SEE ALSO may follow PROCEDURES\n");
184 }
186 {
188 }
190 {
192 }
195 {
198 printf(
"error: only KEYWORDS/SEE ALSO may follow PROCEDURES\n");
199 }
201 {
202 unsigned char *
pp=
buf;
204 {
205 if ((*
pp!=
' ')&&(*
pp!=
'\t'))
break;
207 }
209 {
212 continue;
213 }
214 else
215 {
216 printf(
"error: unknown section in library header: %s",
buf);
218 }
219 }
221 {
222 int ch;
223 unsigned char *
pp=
buf;
224 while((*
pp==
' ')||(*
pp==
'\t'))
pp++;
225 ch=
strspn(
pp,
"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
226 if ((ch>1)||(
pp+ch==
p))
227 {
228
229 if ((ch!=10)||(
strncmp(
pp,
"REFERENCES",10)!=0))
230 {
231 printf(
"error: unknown section in library header: %s",
buf);
233 }
235 printf(
"error: only KEYWORDS/SEE ALSO may follow PROCEDURES\n");
236 }
237 }
239 else
240 {
244 }
246 }
248 printf(
"\nSUMMARY OF THE HEADER:\n");
250 printf(
"error: missing/duplicate LIBRARY (%d lines found, should be 1)\n",
have_LIBRARY);
252 printf(
"error: missing/duplicate AUTHOR/AUTHORS (%d lines found, should be 1)\n",
have_AUTHORS);
260 printf(
"hint: avoid NOTE: if not used for a library requirement\n");
264 printf(
"hint: avoid OVERVIEW: for small libraries\n");
267
269 printf(
"error: other header entries found (illegal ?) :%d lines found, should be 0\n",
have_other);
271 {
272 printf(
"warning: %d forced line breaks in %d header lines: @* should be used very rarely!\n",
star_nl,
header);
273 }
275 {
276 printf(
"warning: %d texinfo commands in %d header lines: should be used very rarely!\n",
texinfo,
header);
277 }
278}
◆ scan_keywords()
Definition at line 103 of file checklibs.c.
104{
105
106
109 {
120 {
121
122 int ch;
123 unsigned char *
pp=
buf;
124 while((*
pp==
' ')||(*
pp==
'\t'))
pp++;
125 ch=
strspn(
pp,
"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
126 if ((ch>1)||(
pp+ch==
p))
127 {
128 break;
129 }
130 }
131 }
132 printf(
"error: seperate keywords by ; but do not have ; after the last keyword\n");
133}
◆ scan_proc()
Definition at line 59 of file checklibs.c.
60{
62 while(1)
63 {
66 {
71 {
72 printf(
"warning: probably not a proc ? (%s)\n",
s);
73 }
74 else
75 {
77 printf(
"error: minimal length of a procedure name is 4: %s\n",
s);
79 }
80 }
86 {
87
88 int ch;
89 unsigned char *
pp=
buf;
90 while((*
pp==
' ')||(*
pp==
'\t'))
pp++;
91 ch=
strspn(
pp,
"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
92 if ((ch>1)||(
pp+ch==
p))
93 {
94 break;
95 }
96 }
97 }
99 printf(
"warning: no proc found in the section PROCEDURES ?\n");
101}
const CanonicalForm int s
◆ scan_proc_help()
Definition at line 134 of file checklibs.c.
135{
137 {
140 if (
buf[0]==
'{')
break;
142 {
146 printf(
"texinfo in proc help(%s): >>%s",
s,
buf);
147 }
149 }
150}
◆ buf
◆ crlf
◆ footer
◆ have_doc
◆ have_example
◆ header
◆ lines
◆ non_ascii
◆ non_ascii_line
◆ proc
◆ proc_cnt
◆ proc_found
◆ proc_help_lines
◆ proc_help_texinfo
◆ star_nl
◆ tabs
◆ trailing_spaces
◆ verylong_lines