home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume8
/
libhoward
/
part08
/
mfclose.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-10-01
|
2KB
|
72 lines
/*
* mfclose - fclose() + malf1()
*/
#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: mfclose.c,v 1.3 89/08/13 14:53:25 howard Exp $");
#include <howard/malf.h>
#include <howard/registers.i>
PUBLIC void mfclose (s, n)
streamT s; /* Stream to close.*/
bStrT n; /* File name.*/
/* Function:
*
* Algorithm:
* Call fclose(). On error call malf1().
* Returns:
*
* Notes:
*
*/
{
if (fclose (s)) malf1 ("%s: Can not close", n);
}
#ifdef TEST
#include <howard/usage.h>
MAINVER ("@(#)$Header: mfclose.c,v 1.3 89/08/13 14:53:25 howard Exp $");
USAGE ("file");
PUBLIC int main (argc, argv)
int argc; /* Number of arguments.*/
bStrT *argv; /* Points to array of argument strings.*/
{
if (2 != argc) usage();
mfclose (mfopen (argv[1], "r"), argv[1]);
PUTS ("Success");
mfflush (stdout, "Standard Output");
exit (SUCCESS);
#ifdef lint
return (SUCCESS);
#endif
}
#endif