* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
* mkindx.c - utility to format a nice index to source files, etc.
* usage: mkindx "title string" [file_name] [filename] .....
char id_mkindx
[] = "@(#)mkindx.c 5.1 %G%";
char list
[10000] = "pwd >>index; echo \" \" >>index; ls -l ";
if (index
= fopen ("index", "w"))
fprintf (index
, "\n\n\n\n\n\n\n\n\n");
center (argv
[1]); /* center title on page */
center (ctime(&t
)); /* center date & time */
while (*cp
) cp
++; /* find end of shell command */
for (i
= 2; i
< argc
; i
++)
while (*argv
[i
]) *cp
++ = *(argv
[i
]++);
while (*apndx
) *cp
++ = *apndx
++;
else fprintf (stderr
, "mkindx: can't open index\n");
pad
= (72 - strlen(string
)) >> 1;
while (pad
-- > 0) fputc(' ', index
);
fprintf (index
, "%s\n", string
);