home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume8
/
libhoward
/
part08
/
usage.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-10-01
|
2KB
|
62 lines
/*
* usage - write usage string on standard error and exit
*/
#ifndef lint
static char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
#endif lint
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 1,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdio.h>
#include <howard/port.h>
#include <howard/version.h>
MODVER ("@(#)$Header: usage.c,v 1.6 89/08/14 09:18:44 howard Exp $");
#include <howard/malf.h>
#include <howard/usage.h>
PUBLIC void usage()
/* Function:
* Write a usage message on stderr.
* Exit with exit code 1.
* Algorithm:
* If the global _progn is set up, write the program name from it.
* Then write the string to which the global _usage points.
*/
{
extern bStrT _usage; /* Usage string.*/
FPUTS ("Usage: ", stderr);
putspn();
PUTC (' ', stderr);
FPUTS ((cStrT) _usage, stderr);
PUTC ('\n', stderr);
FFLUSH (stderr);
exit (1);
}
#ifdef TEST
MAINVER ("@(#)$Header: usage.c,v 1.6 89/08/14 09:18:44 howard Exp $");
USAGE ("[-a] [-b] {file}");
main()
{
usage();
}
#endif