MISR Toolkit  1.5.1
MisrError.h
Go to the documentation of this file.
1 #ifndef MISRERROR_H
2 #define MISRERROR_H
3 
4 #include <stdio.h>
5 
6 typedef enum MTKt_boolean { /* Boolean type */
7  MTK_FALSE = 0,
10 
11 typedef enum MTKt_status { /* Return status type */
12  MTK_SUCCESS = 0, /* Return codes */
87 } MTKt_status;
88 
89 /* Mtk Error descriptions */
90 
91 #define MTK_ERR_DESC { \
92  "SUCCESS", \
93  "FAILURE", \
94  "OUT OF BOUNDS", \
95  "BAD ARGUMENT", \
96  "NOT FOUND", \
97  "FILE NOT FOUND", \
98  "FILE OPEN FAILED", \
99  "NULL POINTER", \
100  "DIMENSION MISMATCH", \
101  "DATATYPE MISMATCH", \
102  "MALLOC FAILED", \
103  "CALLOC FAILED", \
104  "REALLOC FAILED", \
105  "GCTP FORWARD INIT FAILED", \
106  "GCTP INVERSE INIT FAILED", \
107  "GCTP FORWARD PROJ FAILED", \
108  "GCTP INVERSE PROJ FAILED", \
109  "MISR PROJECTION INIT FAILED", \
110  "MISR FORWARD PROJECTION FAILED", \
111  "MISR INVERSE PROJECTION FAILED", \
112  "HDF OPEN FAILED", \
113  "HDF ATTACH FAILED", \
114  "HDF SDSTART FAILED", \
115  "HDF SDEND FAILED", \
116  "HDF SDFILEINFO FAILED", \
117  "HDF SDFINDATTR FAILED", \
118  "HDF SDREADATTR FAILED", \
119  "HDF SDATTRINFO FAILED", \
120  "HDF HDFCLOSE FAILED", \
121  "HDF HDFOPEN FAILED", \
122  "HDF VEND FAILED", \
123  "HDF VFFIELDORDER FAILED", \
124  "HDF VFFIELDTYPE FAILED", \
125  "HDF VFNFIELDS FAILED", \
126  "HDF VSATTACH FAILED", \
127  "HDF VSDETACH FAILED", \
128  "HDF VSELTS FAILED", \
129  "HDF VSFIND FAILED", \
130  "HDF VSFINDEX FAILED", \
131  "HDF VSGETFIELDS FAILED", \
132  "HDF VSGETNAME FAILED", \
133  "HDF VSREAD FAILED", \
134  "HDF VSSETFIELDS FAILED", \
135  "HDF VSSIZEOF FAILED", \
136  "HDF VSTART FAILED", \
137  "HDFEOS GDOPEN FAILED", \
138  "HDFEOS GDCLOSE FAILED", \
139  "HDFEOS GDATTACH FAILED", \
140  "HDFEOS GDDETACH FAILED", \
141  "HDFEOS GDINQATTRS FAILED", \
142  "HDFEOS GDINQGRID FAILED", \
143  "HDFEOS GDINQFIELDS FAILED", \
144  "HDFEOS GDNENTRIES FAILED", \
145  "HDFEOS GDREADATTR FAILED", \
146  "HDFEOS GDATTRINFO FAILED", \
147  "HDFEOS GDFIELDINFO FAILED", \
148  "HDFEOS GDDIMINFO FAILED", \
149  "HDFEOS GDREADFIELD FAILED", \
150  "HDFEOS GDGETFILLVALUE FAILED", \
151  "HDFEOS GDPROJINFO FAILED", \
152  "HDFEOS GDGRIDINFO FAILED", \
153  "HDFEOS EHIDINFO FAILED", \
154  "NETCDF OPEN FAILED", \
155  "NETCDF READ FAILED", \
156  "NETCDF CLOSE FAILED", \
157  "FILETYPE NOT SUPPORTED", \
158  "DATATYPE NOT SUPPORTED", \
159  "INVALID FILE", \
160  "INVALID GRID", \
161  "INVALID FIELD", \
162  "INVALID FIELD DIMENSION", \
163  "MISSING FIELD DIMENSION", \
164  "EXTRA FIELD DIMENSION", \
165  "DIVIDE BY ZERO", \
166  "INVALID ERROR CODE" \
167 }
168 
169 #define MTK_ERR_MSG_JUMP(msg) \
170  { \
171  fprintf(stderr,"Error: %s\n",msg); \
172  goto ERROR_HANDLE; \
173  }
174 
175 #define MTK_ERR_CODE_JUMP(code) \
176  { \
177  status_code = code; \
178  goto ERROR_HANDLE; \
179  }
180 
181 #define MTK_ERR_CODE_MSG_JUMP(code,msg) \
182  { \
183  fprintf(stderr,"Error: %s\n",msg); \
184  status_code = code; \
185  goto ERROR_HANDLE; \
186  }
187 
188 #define MTK_ERR_COND_JUMP(code) \
189  if (code != MTK_SUCCESS) \
190  { \
191  status_code = code; \
192  goto ERROR_HANDLE; \
193  }
194 
195 #define MTK_PRINT_STATUS(n,v) { \
196  printf("%s", v); \
197  fflush(stdout); \
198  n += sizeof(v) - 1;\
199 }
200 
201 #define MTK_PRINT_RESULT(n,v) { \
202  int i; \
203  for(i=0; i < 55-n; i++) printf(" "); \
204  printf("%s\n", v); \
205 }
206 
207 #endif /* MISRERROR_H */
MTKt_boolean
Definition: MisrError.h:6
MTKt_status
Definition: MisrError.h:11

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:51