NetCDF-Fortran  4.4.2
fort-misc.c
1 /*
2 This file is part of the netCDF Fortran 77 API.
3 
4 This file handles the netCDF strerror and libvers functions.
5 
6 Copyright 2006, University Corporation for Atmospheric Research. See
7 the COPYRIGHT file for copying and redistribution conditions.
8 
9 $Id: fort-misc.c,v 1.8 2007/07/26 20:29:45 ed Exp $
10 */
11 
12 #include <config.h>
13 #include "netcdf.h"
14 #include "ncfortran.h"
15 
16 
17 /*
18  * Return a string that identifies the version of the netCDF library.
19  */
20 FCALLSCFUN0(STRING, (char*)nc_inq_libvers, NF_INQ_LIBVERS, nf_inq_libvers)
21 
22 
23 /*
24  * Return the string associated with an error code.
25  */
26 #ifdef ABSOFT10_HACK
27 extern void NF_STRERROR(char *AS, unsigned D0, const int *A1)
28 {
29  char *A0;
30  A0= (char*)nc_strerror( (int)*A1 );
31  memcpy(AS,A0, (D0<(A0==((void *)0)?0:strlen(A0))?D0:(A0==((void *)0)?0:strlen(A0))) );
32  D0>(A0==((void *)0)?0:strlen(A0))?memset(AS+(A0==((void *)0)?0:strlen(A0)), ' ', D0-(A0==((void *)0)?0:strlen(A0))):0;
33  return ;
34 }
35 #else
36 FCALLSCFUN1(STRING, (char*)nc_strerror, NF_STRERROR, nf_strerror,
37  FINT2CINT)
38 #endif
39 
40 
41 static int
42 nc_issyserr(int errcode)
43 {
44  return errcode > 0;
45 }
46 
47 
48 /*
49  * Indicate whether or not an error-code refers to a system error
50  * rather than a netCDF error
51  */
52 FCALLSCFUN1(LOGICAL, nc_issyserr, NF_ISSYSERR, nf_issyserr,
53  FINT2CINT)

Return to the Main Unidata NetCDF page.
Generated on Sun Dec 27 2015 13:19:48 for NetCDF-Fortran. NetCDF is a Unidata library.