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 #ifndef SINFO_UTILS_H
00028 #define SINFO_UTILS_H
00029
00030
00031 #ifdef HAVE_CONFIG_H
00032 # include <config.h>
00033 #endif
00034 #include <math.h>
00035 #include <sinfo_msg.h>
00036 #include <sinfo_error.h>
00037 #include <cpl.h>
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef WANT_BIG_LOGFILE
00049 #define WANT_BIG_LOGFILE 0
00050 #endif
00051
00052
00053
00054
00055
00056 #ifndef WANT_TIME_MEASURE
00057 #define WANT_TIME_MEASURE 0
00058 #endif
00059
00060
00061 #if WANT_TIME_MEASURE
00062 #define SINFO_TIME_START(what) sinfo_msg("Timing (%s, l%d) %s start", \
00063 __FILE__, __LINE__, what)
00064 #define SINFO_TIME_END sinfo_msg("Timing (%s, l%d) end", \
00065 __FILE__, __LINE__)
00066 #else
00067 #define SINFO_TIME_START(what) sinfo_msg_debug("Timing (%s, l%d) %s start", \
00068 __FILE__, __LINE__, what)
00069 #define SINFO_TIME_END sinfo_msg_debug("Timing (%s, l%d) end", \
00070 __FILE__, __LINE__)
00071 #endif
00072
00073
00074
00075
00076 #ifndef stringify
00077 #ifndef make_str
00078 #define stringify(X) #X
00079 #define make_str(X) stringify(X)
00080 #endif
00081 #endif
00082
00083 #define TWOSQRT2LN2 2.35482004503095
00084
00085 #ifndef M_PI
00086 #define M_PI 3.1415926535897932384626433832795
00087 #endif
00088
00089 #define COS_DEG(x) cos(((x)/180)*M_PI)
00090 #define SIN_DEG(x) sin(((x)/180)*M_PI)
00091 #define ACOS_DEG(x) (acos(x)*180/M_PI)
00092
00093
00094
00095 long sinfo_round_double(double x);
00096 int
00097 sinfo_parameter_get_default_flag ( const cpl_parameter* p );
00098
00099 #endif