Doxygen Source Code Documentation
error.c File Reference
#include "ncconfig.h"#include <stdio.h>#include <stdarg.h>#include <stdlib.h>#include "netcdf.h"#include <string.h>Go to the source code of this file.
Functions | |
| const char * | nc_strerror (int err) |
Variables | |
| char | unknown [] = "Unknown Error" |
Function Documentation
|
|
Definition at line 74 of file netcdf-3.5.0/src/libsrc/error.c. References NC_ISSYSERR, strerror(), and unknown. Referenced by do_ncdump(), main(), and nc_advise().
00075 {
00076
00077 #ifdef vms
00078 if(err == EVMSERR)
00079 {
00080 return vms_strerror(err);
00081 }
00082 /* else */
00083 #endif /* vms */
00084
00085 if(NC_ISSYSERR(err))
00086 {
00087 const char *cp = (const char *) strerror(err);
00088 if(cp == NULL)
00089 return unknown;
00090 /* else */
00091 return cp;
00092 }
00093 /* else */
00094
00095 switch (err) {
00096 case NC_NOERR:
00097 return "No error";
00098 case NC_EBADID:
00099 return "Not a netCDF id";
00100 case NC_ENFILE:
00101 return "Too many netCDF files open";
00102 case NC_EEXIST:
00103 return "netCDF file exists && NC_NOCLOBBER";
00104 case NC_EINVAL:
00105 return "Invalid argument";
00106 case NC_EPERM:
00107 return "Write to read only";
00108 case NC_ENOTINDEFINE:
00109 return "Operation not allowed in data mode";
00110 case NC_EINDEFINE:
00111 return "Operation not allowed in define mode";
00112 case NC_EINVALCOORDS:
00113 return "Index exceeds dimension bound";
00114 case NC_EMAXDIMS:
00115 return "NC_MAX_DIMS exceeded";
00116 case NC_ENAMEINUSE:
00117 return "String match to name in use";
00118 case NC_ENOTATT:
00119 return "Attribute not found";
00120 case NC_EMAXATTS:
00121 return "NC_MAX_ATTRS exceeded";
00122 case NC_EBADTYPE:
00123 return "Not a netCDF data type or _FillValue type mismatch";
00124 case NC_EBADDIM:
00125 return "Invalid dimension id or name";
00126 case NC_EUNLIMPOS:
00127 return "NC_UNLIMITED in the wrong index";
00128 case NC_EMAXVARS:
00129 return "NC_MAX_VARS exceeded";
00130 case NC_ENOTVAR:
00131 return "Variable not found";
00132 case NC_EGLOBAL:
00133 return "Action prohibited on NC_GLOBAL varid";
00134 case NC_ENOTNC:
00135 return "Not a netCDF file";
00136 case NC_ESTS:
00137 return "In Fortran, string too short";
00138 case NC_EMAXNAME:
00139 return "NC_MAX_NAME exceeded";
00140 case NC_EUNLIMIT:
00141 return "NC_UNLIMITED size already in use";
00142 case NC_ENORECVARS:
00143 return "nc_rec op when there are no record vars";
00144 case NC_ECHAR:
00145 return "Attempt to convert between text & numbers";
00146 case NC_EEDGE:
00147 return "Edge+start exceeds dimension bound";
00148 case NC_ESTRIDE:
00149 return "Illegal stride";
00150 case NC_EBADNAME:
00151 return "Attribute or variable name contains illegal characters";
00152 case NC_ERANGE:
00153 return "Numeric conversion not representable";
00154 case NC_ENOMEM:
00155 return "Memory allocation (malloc) failure";
00156 }
00157 /* default */
00158 return unknown;
00159 }
|
Variable Documentation
|
|
Definition at line 70 of file netcdf-3.5.0/src/libsrc/error.c. Referenced by nc_strerror(). |