Initial import of the CDE 2.1.30 sources from the Open Group.

This commit is contained in:
Peter Howkins
2012-03-10 18:21:40 +00:00
commit 83b6996daa
18978 changed files with 3945623 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
/* $XConsortium: openchk.c /main/3 1995/11/08 11:07:01 rswiston $ */
/*
Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co.
*/
#include <stdio.h>
#if defined(MSDOS)
#include <process.h>
#endif
#include "basic.h"
extern FILE *m_errfile ;
void m_exit(
#if defined(M_PROTO)
int status
#endif
) ;
void m_openchk(
#if defined(M_PROTO)
FILE **ptr, char *name, char *mode
#endif
) ;
/* Open a file and check that the open succeeded */
void m_openchk(ptr, name, mode)
FILE **ptr ;
char *name, *mode ;
{
*ptr = fopen(name, mode) ;
if (*ptr) return ;
fprintf(stderr, "Unable to open %s\n", name) ;
if (m_errfile) fprintf(m_errfile, "Unable to open %s\n", name) ;
m_exit(TRUE) ;
}