libvisio_utils.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* libvisio
00003  * Version: MPL 1.1 / GPLv2+ / LGPLv2+
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License or as specified alternatively below. You may obtain a copy of
00008  * the License at http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * Major Contributor(s):
00016  * Copyright (C) 2011 Fridrich Strba <fridrich.strba@bluewin.ch>
00017  * Copyright (C) 2011 Eilidh McAdam <tibbylickle@gmail.com>
00018  *
00019  *
00020  * All Rights Reserved.
00021  *
00022  * For minor contributions see the git repository.
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPLv2+"), or
00026  * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
00027  * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable
00028  * instead of those above.
00029  */
00030 
00031 #ifndef __LIBVISIO_UTILS_H__
00032 #define __LIBVISIO_UTILS_H__
00033 
00034 #include <stdio.h>
00035 
00036 #ifdef _MSC_VER
00037 
00038 typedef unsigned char uint8_t;
00039 typedef unsigned short uint16_t;
00040 typedef unsigned uint32_t;
00041 typedef unsigned __int64 uint64_t;
00042 
00043 #else /* !defined _MSC_VER */
00044 
00045 #ifdef HAVE_CONFIG_H
00046 
00047 #include <config.h>
00048 
00049 #ifdef HAVE_STDINT_H
00050 #include <stdint.h>
00051 #endif
00052 
00053 #ifdef HAVE_INTTYPES_H
00054 #include <inttypes.h>
00055 #endif
00056 
00057 #else /* !defined HAVE_CONFIG_H */
00058 
00059 #include <stdint.h>
00060 #include <inttypes.h>
00061 
00062 #endif /* HAVE_CONFIG_H */
00063 
00064 #endif /* _MSC_VER */
00065 
00066 #include <libwpd-stream/libwpd-stream.h>
00067 
00068 // debug message includes source file and line number
00069 //#define VERBOSE_DEBUG 1
00070 
00071 // do nothing with debug messages in a release compile
00072 #ifdef DEBUG
00073 #ifdef VERBOSE_DEBUG
00074 #define VSD_DEBUG_MSG(M) printf("%15s:%5d: ", __FILE__, __LINE__); printf M
00075 #define VSD_DEBUG(M) M
00076 #else
00077 #define VSD_DEBUG_MSG(M) printf M
00078 #define VSD_DEBUG(M) M
00079 #endif
00080 #else
00081 #define VSD_DEBUG_MSG(M)
00082 #define VSD_DEBUG(M)
00083 #endif
00084 
00085 namespace libvisio
00086 {
00087 
00088 uint8_t readU8(WPXInputStream *input);
00089 uint16_t readU16(WPXInputStream *input);
00090 uint32_t readU32(WPXInputStream *input);
00091 uint64_t readU64(WPXInputStream *input);
00092 
00093 double readDouble(WPXInputStream *input);
00094 
00095 class EndOfStreamException
00096 {
00097 };
00098 
00099 class GenericException
00100 {
00101 };
00102 
00103 } // namespace libvisio
00104 
00105 #endif // __LIBVISIO_UTILS_H__
00106 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */