libvisio_utils.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * This file is part of the libvisio project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #ifndef __LIBVISIO_UTILS_H__
11 #define __LIBVISIO_UTILS_H__
12 
13 #include <stdio.h>
14 #include "VSDTypes.h"
15 
16 #ifdef _MSC_VER
17 
18 typedef unsigned char uint8_t;
19 typedef unsigned short uint16_t;
20 typedef short int16_t;
21 typedef unsigned uint32_t;
22 typedef int int32_t;
23 typedef unsigned __int64 uint64_t;
24 
25 #else /* !defined _MSC_VER */
26 
27 #ifdef HAVE_CONFIG_H
28 
29 #include <config.h>
30 
31 #ifdef HAVE_STDINT_H
32 #include <stdint.h>
33 #endif
34 
35 #ifdef HAVE_INTTYPES_H
36 #include <inttypes.h>
37 #endif
38 
39 #else /* !defined HAVE_CONFIG_H */
40 
41 #include <stdint.h>
42 #include <inttypes.h>
43 
44 #endif /* HAVE_CONFIG_H */
45 
46 #endif /* _MSC_VER */
47 
48 #include <librevenge/librevenge.h>
49 #include <librevenge-stream/librevenge-stream.h>
50 
51 // debug message includes source file and line number
52 //#define VERBOSE_DEBUG 1
53 
54 // do nothing with debug messages in a release compile
55 #ifdef DEBUG
56 #ifdef VERBOSE_DEBUG
57 #define VSD_DEBUG_MSG(M) printf("%15s:%5d: ", __FILE__, __LINE__); printf M
58 #define VSD_DEBUG(M) M
59 #else
60 #define VSD_DEBUG_MSG(M) printf M
61 #define VSD_DEBUG(M) M
62 #endif
63 #else
64 #define VSD_DEBUG_MSG(M)
65 #define VSD_DEBUG(M)
66 #endif
67 
68 namespace libvisio
69 {
70 
71 uint8_t readU8(librevenge::RVNGInputStream *input);
72 uint16_t readU16(librevenge::RVNGInputStream *input);
73 int16_t readS16(librevenge::RVNGInputStream *input);
74 uint32_t readU32(librevenge::RVNGInputStream *input);
75 int32_t readS32(librevenge::RVNGInputStream *input);
76 uint64_t readU64(librevenge::RVNGInputStream *input);
77 
78 double readDouble(librevenge::RVNGInputStream *input);
79 
80 const librevenge::RVNGString getColourString(const Colour &c);
81 
83 {
84 };
85 
87 {
88 };
89 
91 {
92 };
93 
94 } // namespace libvisio
95 
96 #endif // __LIBVISIO_UTILS_H__
97 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition: libvisio_utils.h:82
const librevenge::RVNGString getColourString(const Colour &c)
Definition: libvisio_utils.cpp:103
Definition: VSDTypes.h:57
int16_t readS16(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:48
int32_t readS32(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:69
double readDouble(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:90
Definition: libvisio_utils.h:86
Definition: libvisio_utils.h:90
uint32_t readU32(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:53
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:16
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:32
uint64_t readU64(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:74

Generated for libvisio by doxygen 1.8.6