00001
00002
00003
00004
00005
00006
00007 #include <stdio.h>
00008
00009 #ifndef NO_STDARG
00010 #include <stdarg.h>
00011 #else
00012 #include <varargs.h>
00013 #endif
00014
00015 #include <netcdf.h>
00016 #include "error.h"
00017
00018 static int error_count = 0;
00019
00020
00021
00022
00023 #ifndef NO_STDARG
00024 void
00025 error(const char *fmt, ...)
00026 #else
00027
00028 void
00029 error(fmt, va_alist)
00030 const char *fmt ;
00031 va_dcl
00032 #endif
00033 {
00034 va_list args ;
00035
00036 (void) fprintf(stderr,"*** ");
00037
00038 #ifndef NO_STDARG
00039 va_start(args, fmt) ;
00040 #else
00041 va_start(args) ;
00042 #endif
00043 (void) vfprintf(stderr,fmt,args) ;
00044 va_end(args) ;
00045
00046 (void) fprintf(stderr, "\n") ;
00047 error_count++;
00048 }
00049
00050
00051
00052
00053
00054
00055 void
00056 off_errs()
00057 {
00058 extern int ncopts;
00059 ncopts &= ~NC_FATAL;
00060 ncopts &= ~NC_VERBOSE;
00061 }
00062
00063
00064
00065
00066
00067
00068 void
00069 on_errs()
00070 {
00071 extern int ncopts;
00072 ncopts |= NC_FATAL;
00073 ncopts |= NC_VERBOSE;
00074 }