ocssw  1.0
/disk01/web/ocssw/build/inc/swfinc/passthebuck.h (r8106/r659)
Go to the documentation of this file.
00001 #ifndef _PASSTHEBUCK_H_
00002 #define _PASSTHEBUCK_H_
00003 
00004 #define LIFE_IS_GOOD        0   /* Successful return status */
00005 #define FILE_ALREADY_EXISTS 1   /* HDF output file already existed */
00006 #define MEMORY_ALLOCATION_ERROR 2   /* malloc() or calloc() failed */
00007 #define HDF_FUNCTION_ERROR  3   /* One of NCSA's functions complained */
00008 #define PROGRAMMER_BOOBOO   4   /* Error in code logic or consistency */
00009 #define CALDATA_NOT_APPENDED    5   /* Calibration data was not appended */
00010 #define MISSING_ENVVAR      6   /* Environment variable not set */
00011 #define STAT_FAILURE        7   /* Call to stat() function failed */
00012 #define FILE_IS_EMPTY       8   /* File size is zero bytes */
00013 #define FOPEN_FAILURE       9   /* Call to fopen() function failed */
00014 #define FREAD_FAILURE       10  /* Call to fread() function failed */
00015 
00016 #define PTB(function){          \
00017   int status = function;        \
00018   switch(status){           \
00019     case LIFE_IS_GOOD:  break;      \
00020     default:        return(status); \
00021   }                 \
00022 }
00023 
00024 #define DPTB(function){         \
00025   int status = function;        \
00026   switch(status){           \
00027     case LIFE_IS_GOOD:  break;      \
00028     default:        printf("Programming error: file %s, line %d\n",__FILE__,__LINE__); exit(1); \
00029   }                 \
00030 }
00031 
00032 #endif