00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef IRPLIB_UTILS_H
00029 #define IRPLIB_UTILS_H
00030
00031
00032
00033
00034
00035 #include <stdarg.h>
00036
00037 #include <cpl.h>
00038
00039
00040
00041
00042
00043 #if defined CPL_VERSION_CODE && CPL_VERSION_CODE >= CPL_VERSION(3, 1, 90)
00044 #define irplib_vsprintf cpl_vsprintf
00045 #define irplib_sprintf cpl_sprintf
00046 #else
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 #define irplib_vsprintf(FORMAT, ARGLIST) \
00062 irplib_vsprintf_macro(FORMAT, ARGLIST, ARGLIST)
00063
00064 #endif
00065
00066
00067 #define irplib_trace() do if (cpl_error_get_code()) { \
00068 cpl_msg_debug(cpl_func, __FILE__ " at line %d: ERROR '%s' at %s", \
00069 __LINE__, cpl_error_get_message(), cpl_error_get_where()); \
00070 } else { \
00071 cpl_msg_debug(cpl_func, __FILE__ " at line %d: OK", __LINE__); \
00072 } while (0)
00073
00074
00075
00076
00077
00078 void irplib_reset(void);
00079 int irplib_compare_tags(cpl_frame *, cpl_frame *);
00080 const char * irplib_frameset_find_file(const cpl_frameset *, const char *);
00081 cpl_frame * irplib_frameset_get_first_from_group(const cpl_frameset *,
00082 cpl_frame_group);
00083
00084 cpl_error_code irplib_apertures_find_max_flux(const cpl_apertures *, int *,
00085 int);
00086
00087 cpl_type_bpp irplib_bpp_find(int, int);
00088
00089 #if defined CPL_VERSION_CODE && CPL_VERSION_CODE >= CPL_VERSION(3, 1, 90)
00090 #else
00091
00092
00093 char * irplib_vsprintf_macro(const char *, va_list, va_list)
00094 #ifdef __GNUC__
00095 __attribute__((format (printf, 1, 0)))
00096 #endif
00097 ;
00098
00099 char * irplib_sprintf(const char *, ...)
00100 #ifdef __GNUC__
00101 __attribute__((format (printf, 1, 2)))
00102 #endif
00103 ;
00104 #endif
00105
00106 int irplib_isinf(double value);
00107 int irplib_isnan(double value);
00108
00109 #endif