Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __LIBFREEHAND_UTILS_H__
00011 #define __LIBFREEHAND_UTILS_H__
00012
00013 #include <stdio.h>
00014 #include <string>
00015 #include <math.h>
00016 #include <libwpd/libwpd.h>
00017 #include <libwpd-stream/libwpd-stream.h>
00018
00019 #ifndef M_PI
00020 #define M_PI 3.14159265358979323846
00021 #endif
00022
00023 #define FH_EPSILON 1E-6
00024 #define FH_ALMOST_ZERO(m) (fabs(m) <= FH_EPSILON)
00025
00026 #ifdef _MSC_VER
00027
00028 typedef unsigned char uint8_t;
00029 typedef unsigned short uint16_t;
00030 typedef unsigned uint32_t;
00031 typedef unsigned __int64 uint64_t;
00032 typedef signed char int8_t;
00033 typedef short int16_t;
00034 typedef int int32_t;
00035 typedef __int64 int64_t;
00036
00037 #else
00038
00039 #ifdef HAVE_CONFIG_H
00040
00041 #include <config.h>
00042
00043 #ifdef HAVE_STDINT_H
00044 #include <stdint.h>
00045 #endif
00046
00047 #ifdef HAVE_INTTYPES_H
00048 #include <inttypes.h>
00049 #endif
00050
00051 #else
00052
00053
00054 #include <stdint.h>
00055 #include <inttypes.h>
00056
00057 #endif
00058
00059 #endif
00060
00061
00062
00063
00064
00065 #ifdef DEBUG
00066 #ifdef VERBOSE_DEBUG
00067 #define FH_DEBUG_MSG(M) printf("%15s:%5d: ", __FILE__, __LINE__); printf M
00068 #define FH_DEBUG(M) M
00069 #else
00070 #define FH_DEBUG_MSG(M) printf M
00071 #define FH_DEBUG(M) M
00072 #endif
00073 #else
00074 #define FH_DEBUG_MSG(M)
00075 #define FH_DEBUG(M)
00076 #endif
00077
00078 namespace libfreehand
00079 {
00080
00081 uint8_t readU8(WPXInputStream *input);
00082 uint16_t readU16(WPXInputStream *input);
00083 uint32_t readU32(WPXInputStream *input);
00084 int8_t readS8(WPXInputStream *input);
00085 int16_t readS16(WPXInputStream *input);
00086 int32_t readS32(WPXInputStream *input);
00087
00088 class EndOfStreamException
00089 {
00090 };
00091
00092 class GenericException
00093 {
00094 };
00095
00096 }
00097
00098 #endif // __LIBFREEHAND_UTILS_H__
00099