Browse Source

Initial commit of version 20141002.

tags/20161119
Joachim Metz 5 years ago
commit
62d2992705
100 changed files with 43120 additions and 0 deletions
  1. +131
    -0
      .gitignore
  2. +24
    -0
      AUTHORS
  3. +166
    -0
      COPYING
  4. +2545
    -0
      ChangeLog
  5. +134
    -0
      Makefile.am
  6. +0
    -0
      NEWS
  7. +4
    -0
      README
  8. +6
    -0
      acinclude.m4
  9. +72
    -0
      autogen.sh
  10. +22
    -0
      common/Makefile.am
  11. +257
    -0
      common/byte_stream.h
  12. +43
    -0
      common/common.h
  13. +26
    -0
      common/config_borlandc.h
  14. +34
    -0
      common/config_msc.h
  15. +74
    -0
      common/config_winapi.h
  16. +149
    -0
      common/file_stream.h
  17. +124
    -0
      common/memory.h
  18. +298
    -0
      common/types.h.in
  19. +289
    -0
      configure.ac
  20. +5
    -0
      dpkg/changelog.in
  21. +1
    -0
      dpkg/compat
  22. +51
    -0
      dpkg/control
  23. +40
    -0
      dpkg/copyright.in
  24. +4
    -0
      dpkg/libpff-dev.docs
  25. +4
    -0
      dpkg/libpff-tools.docs
  26. +4
    -0
      dpkg/libpff.docs
  27. +96
    -0
      dpkg/rules
  28. +28
    -0
      include/Makefile.am
  29. +3457
    -0
      include/libpff.h.in
  30. +122
    -0
      include/libpff/codepage.h
  31. +190
    -0
      include/libpff/definitions.h.in
  32. +291
    -0
      include/libpff/error.h
  33. +43
    -0
      include/libpff/extern.h
  34. +51
    -0
      include/libpff/features.h.in
  35. +391
    -0
      include/libpff/mapi.h
  36. +216
    -0
      include/libpff/types.h.in
  37. +42
    -0
      jpff/Exception.java
  38. +128
    -0
      jpff/File.java
  39. +63
    -0
      jpff/Makefile.am
  40. +433
    -0
      jpff/jpff_File.c
  41. +91
    -0
      jpff/jpff_jni.h
  42. +294
    -0
      jpff/jpff_string.c
  43. +63
    -0
      jpff/jpff_string.h
  44. +12
    -0
      libpff.pc.in
  45. +91
    -0
      libpff.spec.in
  46. +141
    -0
      libpff/Makefile.am
  47. +80
    -0
      libpff/libpff.c
  48. +38
    -0
      libpff/libpff.rc.in
  49. +485
    -0
      libpff/libpff_allocation_table.c
  50. +48
    -0
      libpff/libpff_allocation_table.h
  51. +651
    -0
      libpff/libpff_attached_file_io_handle.c
  52. +111
    -0
      libpff/libpff_attached_file_io_handle.h
  53. +978
    -0
      libpff/libpff_attachment.c
  54. +80
    -0
      libpff/libpff_attachment.h
  55. +90
    -0
      libpff/libpff_codepage.h
  56. +152
    -0
      libpff/libpff_column_definition.c
  57. +79
    -0
      libpff/libpff_column_definition.h
  58. +220
    -0
      libpff/libpff_compression.c
  59. +47
    -0
      libpff/libpff_compression.h
  60. +1338
    -0
      libpff/libpff_data_array.c
  61. +133
    -0
      libpff/libpff_data_array.h
  62. +210
    -0
      libpff/libpff_data_array_entry.c
  63. +65
    -0
      libpff/libpff_data_array_entry.h
  64. +1082
    -0
      libpff/libpff_data_block.c
  65. +117
    -0
      libpff/libpff_data_block.h
  66. +853
    -0
      libpff/libpff_debug.c
  67. +103
    -0
      libpff/libpff_debug.h
  68. +429
    -0
      libpff/libpff_definitions.h.in
  69. +577
    -0
      libpff/libpff_descriptor_data_stream.c
  70. +96
    -0
      libpff/libpff_descriptor_data_stream.h
  71. +518
    -0
      libpff/libpff_descriptors_index.c
  72. +88
    -0
      libpff/libpff_descriptors_index.h
  73. +184
    -0
      libpff/libpff_encryption.c
  74. +46
    -0
      libpff/libpff_encryption.h
  75. +95
    -0
      libpff/libpff_error.c
  76. +74
    -0
      libpff/libpff_error.h
  77. +47
    -0
      libpff/libpff_extern.h
  78. +2762
    -0
      libpff/libpff_file.c
  79. +292
    -0
      libpff/libpff_file.h
  80. +4038
    -0
      libpff/libpff_folder.c
  81. +159
    -0
      libpff/libpff_folder.h
  82. +403
    -0
      libpff/libpff_free_map.c
  83. +48
    -0
      libpff/libpff_free_map.h
  84. +1111
    -0
      libpff/libpff_index.c
  85. +128
    -0
      libpff/libpff_index.h
  86. +1110
    -0
      libpff/libpff_index_node.c
  87. +112
    -0
      libpff/libpff_index_node.h
  88. +1382
    -0
      libpff/libpff_index_tree.c
  89. +103
    -0
      libpff/libpff_index_tree.h
  90. +175
    -0
      libpff/libpff_index_value.c
  91. +110
    -0
      libpff/libpff_index_value.h
  92. +1464
    -0
      libpff/libpff_io_handle.c
  93. +134
    -0
      libpff/libpff_io_handle.h
  94. +499
    -0
      libpff/libpff_io_handle2.c
  95. +56
    -0
      libpff/libpff_io_handle2.h
  96. +6956
    -0
      libpff/libpff_item.c
  97. +611
    -0
      libpff/libpff_item.h
  98. +263
    -0
      libpff/libpff_item_descriptor.c
  99. +90
    -0
      libpff/libpff_item_descriptor.h
  100. +1250
    -0
      libpff/libpff_item_tree.c

+ 131
- 0
.gitignore View File

@@ -0,0 +1,131 @@
# Files to ignore by git
#
# Version: 20130922

# Generic auto-generated build files
*~
*.a
*.la
*.lai
*.lo
*.Plo
*.Po
*.o
*.so
*.so.[0-9][0-9]*
*.so.[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*
*.Tpo
.deps
.libs
INSTALL
Makefile
Makefile.in
stamp-h1

# Specific auto-generated build files
/ABOUT-NLS
/aclocal.m4
/autom4te.cache/
/config.guess
/config.log
/config.rpath
/config.status
/config.sub
/configure
/depcomp
/install-sh
/libtool
/ltmain.sh
/missing
/ylwrap
/m4/codeset.m4
/m4/fcntl-o.m4
/m4/gettext.m4
/m4/glibc2.m4
/m4/glibc21.m4
/m4/iconv.m4
/m4/intdiv0.m4
/m4/intl.m4
/m4/intldir.m4
/m4/intlmacosx.m4
/m4/intmax.m4
/m4/inttypes-pri.m4
/m4/inttypes_h.m4
/m4/lcmessage.m4
/m4/lib-ld.m4
/m4/lib-link.m4
/m4/lib-prefix.m4
/m4/libtool.m4
/m4/lock.m4
/m4/longlong.m4
/m4/ltoptions.m4
/m4/ltsugar.m4
/m4/ltversion.m4
/m4/lt~obsolete.m4
/m4/nls.m4
/m4/po.m4
/m4/progtest.m4
/m4/printf-posix.m4
/m4/size_max.m4
/m4/stdint_h.m4
/m4/threadlib.m4
/m4/uintmax_t.m4
/m4/visibility.m4
/m4/wchar_t.m4
/m4/wint_t.m4
/m4/xsize.m4
/po/boldquot.sed
/po/en@boldquot.header
/po/en@quot.header
/po/insert-header.sin
/po/Makefile.in.in
/po/Makevars
/po/Makevars.template
/po/Rules-quot
/po/POTFILES
/po/quot.sed
/po/remove-potcdate.sed
/po/remove-potcdate.sin

# Project specific files
/libpff.pc
/libpff.spec
/common/config.h
/common/config.h.in
/common/types.h
/dpkg/changelog
/dpkg/copyright
/include/libpff.h
/include/libpff/definitions.h
/include/libpff/features.h
/include/libpff/types.h
/jpff/classnoinst.stamp
/libpff/libpff.rc
/libpff/libpff_definitions.h
/pypff/setup.py
/tests/input
/tests/pff_read_items
/tests/pff_set_ascii_codepage
/tests/pff_test_open_close
/tests/tmp

# Local library dependencies specific files
/libbfio
/libcdata
/libcerror
/libcfile
/libclocale
/libcnotify
/libcpath
/libcsplit
/libcstring
/libcsystem
/libcthreads
/libfcache
/libfdata
/libfdatetime
/libfguid
/libfmapi
/libfvalue
/libfwnt
/libuna

+ 24
- 0
AUTHORS View File

@@ -0,0 +1,24 @@
Acknowledgements: libpff

Copyright (c) 2008-2014, Joachim Metz <joachim.metz@gmail.com>

This code is derived from information and software contributed by:
* Earlier work on the PST file format in libpst by
Dave Smith <dave.s@earthcorp.com>,
Joe Nahmias <joe@nahmias.net>,
Brad Hards <bradh@frogmouth.net>
and Carl Byington <carl@five-ten-sg.com>
(http://www.five-ten-sg.com/libpst/)
* Carl Byington <carl@five-ten-sg.com> for continued work on analyzing
the Personal Folder Format in libpst
* Igor Rogov <blizzz.prg@gmail.com> for alpha testing and bug hunting
* Krzysztof Mazur <krzysztofmazur@users.sourceforge.net> for the
recipient list patch and bug hunting
* Warren Brown <warrenthebrown@users.sourceforge.net> for the multi
value support, the 16-bit value patch, alpha testing, bug hunting
and the several Visual Studio related improvements like the WIN64
project/solution files
* Björn Ganster, X-Ways Software Technology,
for providing the Windows extended filename patches, file exists
speed improvement, alpha testing and bug hunting


+ 166
- 0
COPYING View File

@@ -0,0 +1,166 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.


This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.

0. Additional Definitions.

As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.

"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.

An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.

A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".

The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.

The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.

1. Exception to Section 3 of the GNU GPL.

You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.

2. Conveying Modified Versions.

If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:

a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or

b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.

3. Object Code Incorporating Material from Library Header Files.

The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:

a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the object code with a copy of the GNU GPL and this license
document.

4. Combined Works.

You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:

a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.

c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.

d) Do one of the following:

0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.

1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.

e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)

5. Combined Libraries.

You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:

a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.

b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.

6. Revised Versions of the GNU Lesser General Public License.

The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.

If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.


+ 2545
- 0
ChangeLog
File diff suppressed because it is too large
View File


+ 134
- 0
Makefile.am View File

@@ -0,0 +1,134 @@
ACLOCAL_AMFLAGS = -I m4

SUBDIRS = \
include \
common \
libcstring \
libcerror \
libcthreads \
libcdata \
libclocale \
libcnotify \
libcsplit \
libuna \
libcfile \
libcpath \
libbfio \
libfcache \
libfdata \
libfdatetime \
libfguid \
libfvalue \
libfwnt \
libfmapi \
libpff \
libcsystem \
pfftools \
jpff \
pypff \
po \
manuals \
tests \
msvscpp

DPKG_FILES = \
dpkg/changelog \
dpkg/changelog.in \
dpkg/compat \
dpkg/control \
dpkg/copyright \
dpkg/copyright.in \
dpkg/rules \
dpkg/libpff-dev.docs \
dpkg/libpff.docs \
dpkg/libpff-tools.docs

GETTEXT_FILES = \
config.rpath \
po/Makevars.in

PKGCONFIG_FILES = \
libpff.pc.in

SPEC_FILES = \
libpff.spec \
libpff.spec.in

EXTRA_DIST = \
$(DPKG_FILES) \
$(GETTEXT_FILES) \
$(PKGCONFIG_FILES) \
$(SPEC_FILES)

MAINTAINERCLEANFILES = \
Makefile.in

pkgconfigdir = $(libdir)/pkgconfig

pkgconfig_DATA = \
libpff.pc

libtool: @LIBTOOL_DEPS@
cd $(srcdir) && $(SHELL) ./config.status --recheck

lib: library

library:
(cd $(srcdir)/common && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libcstring && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libcerror && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libcdata && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libclocale && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libcnotify && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libcsplit && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libuna && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libcfile && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libcpath && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libbfio && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libfcache && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libfdata && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libfdatetime && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libfguid && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libfvalue && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libfwnt && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libfmapi && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/libpff && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/po && $(MAKE) $(AM_MAKEFLAGS))

distclean: clean
/bin/rm -f Makefile
/bin/rm -f config.status
/bin/rm -f config.cache
/bin/rm -f config.log
/bin/rm -f libpff.pc
/bin/rm -f libpff.spec
@for dir in ${subdirs}; do \
(cd $$dir && $(MAKE) distclean) \
|| case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"

splint:
(cd $(srcdir)/libcstring && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libcerror && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libcdata && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libclocale && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libcnotify && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libcsplit && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libuna && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libcfile && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libcpath && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libbfio && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libfcache && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libfdata && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libfdatetime && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libfguid && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libfvalue && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libfwnt && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libfmapi && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libpff && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libcsystem && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/pfftools && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/pypff && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/po && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/tests && $(MAKE) splint $(AM_MAKEFLAGS))


+ 0
- 0
NEWS View File


+ 4
- 0
README View File

@@ -0,0 +1,4 @@
See:
* http://code.google.com/p/libpff/wiki/Building
* README.macosx


+ 6
- 0
acinclude.m4 View File

@@ -0,0 +1,6 @@
dnl Function to detect if libpff dependencies are available
AC_DEFUN([AX_LIBPFF_CHECK_LOCAL],
[dnl Check for internationalization functions in libpff/libpff_i18n.c
AC_CHECK_FUNCS([bindtextdomain])
])


+ 72
- 0
autogen.sh View File

@@ -0,0 +1,72 @@
#!/bin/sh
# Script to generate ./configure using the autotools
#
# Version: 20130509

EXIT_SUCCESS=0;
EXIT_FAILURE=1;

ACLOCAL="/usr/bin/aclocal";
AUTOCONF="/usr/bin/autoconf";
AUTOHEADER="/usr/bin/autoheader";
AUTOMAKE="/usr/bin/automake";
AUTOPOINT="/usr/bin/autopoint";
AUTORECONF="/usr/bin/autoreconf";
LIBTOOLIZE="/usr/bin/libtoolize";

if [ -x "${AUTORECONF}" ];
then
${AUTORECONF} --force --install
else
if [ ! -x "${ACLOCAL}" ];
then
echo "Unable to find: aclocal";

echo ${EXIT_FAILURE};
fi

if [ ! -x "${AUTOCONF}" ];
then
echo "Unable to find: autoconf";

echo ${EXIT_FAILURE};
fi

if [ ! -x "${AUTOHEADER}" ];
then
echo "Unable to find: autoheader";

echo ${EXIT_FAILURE};
fi

if [ ! -x "${AUTOMAKE}" ];
then
echo "Unable to find: automake";

echo ${EXIT_FAILURE};
fi

if [ ! -x "${AUTOPOINT}" ];
then
echo "Unable to find: autopoint";

echo ${EXIT_FAILURE};
fi

if [ ! -x "${LIBTOOLIZE}" ];
then
echo "Unable to find: libtoolize";

echo ${EXIT_FAILURE};
fi

${AUTOPOINT} --force
${ACLOCAL} --force -I m4
${LIBTOOLIZE} --force
${AUTOHEADER} --force
${AUTOCONF} --force
${AUTOMAKE} --force --add-missing
fi

exit ${EXIT_SUCCESS};


+ 22
- 0
common/Makefile.am View File

@@ -0,0 +1,22 @@
AM_CPPFLAGS = -I$(top_srcdir)/include

EXTRA_DIST = \
byte_stream.h \
common.h \
config.h \
config_borlandc.h \
config_msc.h \
config_winapi.h \
file_stream.h \
memory.h \
types.h \
types.h.in

MAINTAINERCLEANFILES = \
Makefile.in

distclean: clean
/bin/rm -f config.h
/bin/rm -f types.h
/bin/rm -f Makefile


+ 257
- 0
common/byte_stream.h View File

@@ -0,0 +1,257 @@
/*
* Byte stream functions
*
* Copyright (c) 2006-2014, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This software is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/

#if !defined( _BYTE_STREAM_H )
#define _BYTE_STREAM_H

#include "common.h"
#include "types.h"

#if defined( __cplusplus )
extern "C" {
#endif

#define _BYTE_STREAM_HOST_IS_ENDIAN_BIG ( *((uint32_t *) "\x01\x02\x03\x04" ) == 0x01020304 )
#define _BYTE_STREAM_HOST_IS_ENDIAN_LITTLE ( *((uint32_t *) "\x01\x02\x03\x04" ) == 0x04030201 )
#define _BYTE_STREAM_HOST_IS_ENDIAN_MIDDLE ( *((uint32_t *) "\x01\x02\x03\x04" ) == 0x02010403 )

#define _BYTE_STREAM_ENDIAN_BIG (uint8_t) 'b'
#define _BYTE_STREAM_ENDIAN_LITTLE (uint8_t) 'l'
#define _BYTE_STREAM_ENDIAN_MIDDLE (uint8_t) 'm'

typedef union byte_stream_float32
{
float floating_point;
uint32_t integer;

} byte_stream_float32_t;

typedef union byte_stream_float64
{
double floating_point;
uint64_t integer;

} byte_stream_float64_t;

#define byte_stream_copy_to_uint16_big_endian( byte_stream, value ) \
( value ) = ( byte_stream )[ 0 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 1 ];

#define byte_stream_copy_to_uint16_little_endian( byte_stream, value ) \
( value ) = ( byte_stream )[ 1 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 0 ];

#define byte_stream_copy_to_uint24_big_endian( byte_stream, value ) \
( value ) = ( byte_stream )[ 0 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 1 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 2 ];

#define byte_stream_copy_to_uint24_little_endian( byte_stream, value ) \
( value ) = ( byte_stream )[ 2 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 1 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 0 ];

#define byte_stream_copy_to_uint32_big_endian( byte_stream, value ) \
( value ) = ( byte_stream )[ 0 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 1 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 2 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 3 ];

#define byte_stream_copy_to_uint32_little_endian( byte_stream, value ) \
( value ) = ( byte_stream )[ 3 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 2 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 1 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 0 ];

#define byte_stream_copy_to_uint48_big_endian( byte_stream, value ) \
( value ) = ( byte_stream )[ 0 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 1 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 2 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 3 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 4 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 5 ];

#define byte_stream_copy_to_uint48_little_endian( byte_stream, value ) \
( value ) |= ( byte_stream )[ 5 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 4 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 3 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 2 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 1 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 0 ];

#define byte_stream_copy_to_uint64_big_endian( byte_stream, value ) \
( value ) = ( byte_stream )[ 0 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 1 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 2 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 3 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 4 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 5 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 6 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 7 ];

#define byte_stream_copy_to_uint64_little_endian( byte_stream, value ) \
( value ) = ( byte_stream )[ 7 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 6 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 5 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 4 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 3 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 2 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 1 ]; \
( value ) <<= 8; \
( value ) |= ( byte_stream )[ 0 ];

#define byte_stream_copy_from_uint16_big_endian( byte_stream, value ) \
( byte_stream )[ 0 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \
( byte_stream )[ 1 ] = (uint8_t) ( ( value ) & 0x0ff )

#define byte_stream_copy_from_uint16_little_endian( byte_stream, value ) \
( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \
( byte_stream )[ 0 ] = (uint8_t) ( ( value ) & 0x0ff )

#define byte_stream_copy_from_uint24_big_endian( byte_stream, value ) \
( byte_stream )[ 0 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \
( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \
( byte_stream )[ 2 ] = (uint8_t) ( ( value ) & 0x0ff )

#define byte_stream_copy_from_uint24_little_endian( byte_stream, value ) \
( byte_stream )[ 2 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \
( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \
( byte_stream )[ 0 ] = (uint8_t) ( ( value ) & 0x0ff )

#define byte_stream_copy_from_uint32_big_endian( byte_stream, value ) \
( byte_stream )[ 0 ] = (uint8_t) ( ( ( value ) >> 24 ) & 0x0ff ); \
( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \
( byte_stream )[ 2 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \
( byte_stream )[ 3 ] = (uint8_t) ( ( value ) & 0x0ff )

#define byte_stream_copy_from_uint32_little_endian( byte_stream, value ) \
( byte_stream )[ 3 ] = (uint8_t) ( ( ( value ) >> 24 ) & 0x0ff ); \
( byte_stream )[ 2 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \
( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \
( byte_stream )[ 0 ] = (uint8_t) ( ( value ) & 0x0ff )

#define byte_stream_copy_from_uint48_big_endian( byte_stream, value ) \
( byte_stream )[ 0 ] = (uint8_t) ( ( ( value ) >> 40 ) & 0x0ff ); \
( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 32 ) & 0x0ff ); \
( byte_stream )[ 2 ] = (uint8_t) ( ( ( value ) >> 24 ) & 0x0ff ); \
( byte_stream )[ 3 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \
( byte_stream )[ 4 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \
( byte_stream )[ 5 ] = (uint8_t) ( ( value ) & 0x0ff )

#define byte_stream_copy_from_uint48_little_endian( byte_stream, value ) \
( byte_stream )[ 5 ] = (uint8_t) ( ( ( value ) >> 40 ) & 0x0ff ); \
( byte_stream )[ 4 ] = (uint8_t) ( ( ( value ) >> 32 ) & 0x0ff ); \
( byte_stream )[ 3 ] = (uint8_t) ( ( ( value ) >> 24 ) & 0x0ff ); \
( byte_stream )[ 2 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \
( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \
( byte_stream )[ 0 ] = (uint8_t) ( ( value ) & 0x0ff )

#define byte_stream_copy_from_uint64_big_endian( byte_stream, value ) \
( byte_stream )[ 0 ] = (uint8_t) ( ( ( value ) >> 56 ) & 0x0ff ); \
( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 48 ) & 0x0ff ); \
( byte_stream )[ 2 ] = (uint8_t) ( ( ( value ) >> 40 ) & 0x0ff ); \
( byte_stream )[ 3 ] = (uint8_t) ( ( ( value ) >> 32 ) & 0x0ff ); \
( byte_stream )[ 4 ] = (uint8_t) ( ( ( value ) >> 24 ) & 0x0ff ); \
( byte_stream )[ 5 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \
( byte_stream )[ 6 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \
( byte_stream )[ 7 ] = (uint8_t) ( ( value ) & 0x0ff )

#define byte_stream_copy_from_uint64_little_endian( byte_stream, value ) \
( byte_stream )[ 7 ] = (uint8_t) ( ( ( value ) >> 56 ) & 0x0ff ); \
( byte_stream )[ 6 ] = (uint8_t) ( ( ( value ) >> 48 ) & 0x0ff ); \
( byte_stream )[ 5 ] = (uint8_t) ( ( ( value ) >> 40 ) & 0x0ff ); \
( byte_stream )[ 4 ] = (uint8_t) ( ( ( value ) >> 32 ) & 0x0ff ); \
( byte_stream )[ 3 ] = (uint8_t) ( ( ( value ) >> 24 ) & 0x0ff ); \
( byte_stream )[ 2 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \
( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \
( byte_stream )[ 0 ] = (uint8_t) ( ( value ) & 0x0ff )

#define byte_stream_bit_rotate_left_8bit( byte_stream, number_of_bits ) \
( ( ( byte_stream ) << ( number_of_bits ) ) | ( ( byte_stream ) >> ( 8 - ( number_of_bits ) ) ) )

#define byte_stream_bit_rotate_right_8bit( byte_stream, number_of_bits ) \
( ( ( byte_stream ) >> ( number_of_bits ) ) | ( ( byte_stream ) << ( 8 - ( number_of_bits ) ) ) )

#define byte_stream_bit_rotate_left_16bit( byte_stream, number_of_bits ) \
( ( ( byte_stream ) << ( number_of_bits ) ) | ( ( byte_stream ) >> ( 16 - ( number_of_bits ) ) ) )

#define byte_stream_bit_rotate_right_16bit( byte_stream, number_of_bits ) \
( ( ( byte_stream ) >> ( number_of_bits ) ) | ( ( byte_stream ) << ( 16 - ( number_of_bits ) ) ) )

#define byte_stream_bit_rotate_left_32bit( byte_stream, number_of_bits ) \
( ( ( byte_stream ) << ( number_of_bits ) ) | ( ( byte_stream ) >> ( 32 - ( number_of_bits ) ) ) )

#define byte_stream_bit_rotate_right_32bit( byte_stream, number_of_bits ) \
( ( ( byte_stream ) >> ( number_of_bits ) ) | ( ( byte_stream ) << ( 32 - ( number_of_bits ) ) ) )

#define byte_stream_bit_rotate_left_64bit( byte_stream, number_of_bits ) \
( ( ( byte_stream ) << ( number_of_bits ) ) | ( ( byte_stream ) >> ( 64 - ( number_of_bits ) ) ) )

#define byte_stream_bit_rotate_right_64bit( byte_stream, number_of_bits ) \
( ( ( byte_stream ) >> ( number_of_bits ) ) | ( ( byte_stream ) << ( 64 - ( number_of_bits ) ) ) )

#define byte_stream_bit_rotate_left( value, number_of_bits ) \
( ( ( value ) << ( number_of_bits ) ) | ( ( value ) >> ( ( sizeof( value ) << 3 ) - ( number_of_bits ) ) ) )

#define byte_stream_bit_rotate_right( value, number_of_bits ) \
( ( ( value ) >> ( number_of_bits ) ) | ( ( value ) << ( ( sizeof( value ) << 3 ) - ( number_of_bits ) ) ) )

#if defined( __cplusplus )
}
#endif

#endif


+ 43
- 0
common/common.h View File

@@ -0,0 +1,43 @@
/*
* Common include file
*
* Copyright (c) 2006-2014, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This software is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/

#if !defined( _COMMON_H )
#define _COMMON_H

#if defined( HAVE_CONFIG_H )
#include <config.h>
#endif

/* Include the Borland/CodeGear C++ Builder compiler specific configuration
*/
#if defined( __BORLANDC__ )
#include <config_borlandc.h>

/* Include the Microsoft Visual Studio C++ compiler specific configuration
*/
#elif defined( _MSC_VER )
#include <config_msc.h>
#endif

#include <config_winapi.h>

#endif


+ 26
- 0
common/config_borlandc.h View File

@@ -0,0 +1,26 @@
/*
* Configuration for the Borland/CodeGear C++ Builder compiler
*
* Copyright (c) 2006-2014, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This software is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/

#if !defined( _CONFIG_BORLANDC_H )
#define _CONFIG_BORLANDC_H

#endif


+ 34
- 0
common/config_msc.h View File

@@ -0,0 +1,34 @@
/*
* Configuration for the Microsoft Visual Studio C++ compiler
*
* Copyright (c) 2006-2014, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This software is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/

#if !defined( _CONFIG_MSC_H )
#define _CONFIG_MSC_H

/* Disable warning C4127: conditional expression is constant
*/
#pragma warning( disable : 4127 )

/* Disable warning C4201: nonstandard extension used : nameless struct/union
*/
#pragma warning( disable : 4201 )

#endif


+ 74
- 0
common/config_winapi.h View File

@@ -0,0 +1,74 @@
/*
* Configuration file for WINAPI
*
* Copyright (c) 2006-2014, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This software is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/

#if !defined( _CONFIG_WINAPI_H )
#define _CONFIG_WINAPI_H

/* Define the earliest supported WINAPI version
#define WINVER 0x0501
*/

/* If necessary make sure WINAPI is defined
*/
#if defined( HAVE_WINDOWS_H ) || defined( __BORLANDC__ ) || defined( _MSC_VER )
#include <windows.h>
#endif

#if defined( WINAPI )

/* Define to the address where bug reports for this package should be sent.
*/
#define PACKAGE_BUGREPORT "joachim.metz@gmail.com"

/* Define the size of the wide character for WINAPI
*/
#if !defined( SIZEOF_WCHAR_T )
#define SIZEOF_WCHAR_T 2
#endif

/* Enable the DllMain function
*/
#define HAVE_DLLMAIN 1

/* Enable verbose output
#define HAVE_VERBOSE_OUTPUT 1
*/

/* Enable debug output
#define HAVE_DEBUG_OUTPUT 1
*/

/* Enable both the narrow and wide character functions
*/
#if !defined( HAVE_WIDE_CHARACTER_TYPE )
#define HAVE_WIDE_CHARACTER_TYPE 1
#endif

/* If not controlled by config.h enable multi-thread support
*/
#if !defined( HAVE_CONFIG_H ) && !defined( HAVE_MULTI_THREAD_SUPPORT )
#define HAVE_MULTI_THREAD_SUPPORT 1
#endif

#endif /* defined( WINAPI ) */

#endif /* !defined( _CONFIG_WINAPI_H ) */


+ 149
- 0
common/file_stream.h View File

@@ -0,0 +1,149 @@
/*
* FILE stream functions
*
* Copyright (c) 2006-2014, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This software is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/

#if !defined( _FILE_STREAM_H )
#define _FILE_STREAM_H

#include "common.h"

#if defined( HAVE_GLIB_H )
#include <glib.h>
#include <glib/gstdio.h>
#endif

#include <stdio.h>

#if defined( __cplusplus )
extern "C" {
#endif

#define FILE_STREAM_OPEN_APPEND "a"
#define FILE_STREAM_OPEN_READ "r"
#define FILE_STREAM_OPEN_WRITE "w"

#if defined( WINAPI )
#define FILE_STREAM_BINARY_OPEN_APPEND "ab"
#define FILE_STREAM_BINARY_OPEN_READ "rb"
#define FILE_STREAM_BINARY_OPEN_WRITE "wb"

#else
#define FILE_STREAM_BINARY_OPEN_APPEND "a"
#define FILE_STREAM_BINARY_OPEN_READ "r"
#define FILE_STREAM_BINARY_OPEN_WRITE "w"

#endif

/* narrow character FILE stream open
*/
#if defined( HAVE_GLIB_H )
#define file_stream_open( filename, mode ) \
g_fopen( filename, mode )

#elif defined( HAVE_FOPEN ) || defined( WINAPI )
#define file_stream_open( filename, mode ) \
fopen( filename, mode )
#endif

/* wide character FILE stream open
*/
#if defined( WINAPI )
#define file_stream_open_wide( filename, mode ) \
_wfopen( filename, mode )
#endif

/* FILE stream close
*/
#if defined( HAVE_FCLOSE ) || defined( WINAPI )
#define file_stream_close( stream ) \
fclose( stream )
#endif

/* FILE stream read
*/
#if defined( HAVE_FREAD ) || defined( WINAPI )
#define file_stream_read( stream, data, size ) \
fread( data, 1, size, stream )
#endif

/* FILE stream write
*/
#if defined( HAVE_FWRITE ) || defined( WINAPI )
#define file_stream_write( stream, data, size ) \
fwrite( data, 1, size, stream )
#endif

/* FILE stream seek
*/
#if defined( WINAPI )
#define file_stream_seek_offset( stream, offset, whence ) \
fseek( stream, offset, whence )

#elif defined( HAVE_FSEEKO )
#define file_stream_seek_offset( stream, offset, whence ) \
fseeko( stream, offset, whence )

#elif defined( HAVE_FSEEKO64 )
#define file_stream_seek_offset( stream, offset, whence ) \
fseeko64( stream, offset, whence )
#endif

/* End of FILE stream
*/
#if defined( HAVE_FEOF ) || defined( WINAPI )
#define file_stream_at_end( stream ) \
feof( stream )
#endif

/* Get narrow character string from FILE stream
*/
#if defined( HAVE_FGETS ) || defined( WINAPI )
#define file_stream_get_string( stream, string, size ) \
fgets( string, size, stream )
#endif

/* Get wide characters string from FILE stream
*/
#if defined( HAVE_FGETWS ) || defined( WINAPI )
#define file_stream_get_string_wide( stream, string, size ) \
fgetws( string, size, stream )
#endif

/* Variable arguments formatted print to stream function
*/
#if defined( HAVE_GLIB_H )
#define file_stream_vfprintf( stream, format, ... ) \
g_vfprintf( stream, format, __VA_ARGS__ )

#elif defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 )
#define file_stream_vfprintf \
vfprintf

#elif defined( HAVE_VFPRINTF ) || defined( WINAPI )
#define file_stream_vfprintf( stream, format, ... ) \
vfprintf( stream, format, __VA_ARGS__ )
#endif

#if defined( __cplusplus )
}
#endif

#endif


+ 124
- 0
common/memory.h View File

@@ -0,0 +1,124 @@
/*
* Memory functions
*
* Copyright (c) 2006-2014, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This software is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/

#if !defined( _MEMORY_H )
#define _MEMORY_H

#include "common.h"

#if defined( HAVE_GLIB_H )
#include <glib.h>
#endif

#if defined( HAVE_STDLIB_H ) || defined( WINAPI )
#include <stdlib.h>
#endif

#if defined( HAVE_STRING_H ) || defined( WINAPI )
#include <string.h>
#endif

#if defined( __cplusplus )
extern "C" {
#endif

/* Memory allocation
*/
#if defined( HAVE_GLIB_H )
#define memory_allocate( size ) \
g_malloc( (gsize) size )

#elif defined( HAVE_MALLOC ) || ( defined( WINAPI ) && defined( USE_CRT_FUNCTIONS ) )
#define memory_allocate( size ) \
malloc( size )

#elif defined( WINAPI )
#define memory_allocate( size ) \
HeapAlloc( GetProcessHeap(), 0, (SIZE_T) size )
#endif

#define memory_allocate_structure( type ) \
(type *) memory_allocate( sizeof( type ) )

#define memory_allocate_structure_as_value( type ) \
(intptr_t *) memory_allocate( sizeof( type ) )

/* Memory reallocation
*/
#if defined( HAVE_GLIB_H )
#define memory_reallocate( buffer, size ) \
g_realloc( (gpointer) buffer, (gsize) size )

#elif defined( HAVE_REALLOC ) || ( defined( WINAPI ) && defined( USE_CRT_FUNCTIONS ) )
#define memory_reallocate( buffer, size ) \
realloc( (void *) buffer, size )

#elif defined( WINAPI )
/* HeapReAlloc does not allocate empty (NULL) buffers as realloc does
*/
#define memory_reallocate( buffer, size ) \
( buffer == NULL ) ? \
HeapAlloc( GetProcessHeap(), 0, (SIZE_T) size ) : \
HeapReAlloc( GetProcessHeap(), 0, (LPVOID) buffer, (SIZE_T) size )
#endif

/* Memory free
*/
#if defined( HAVE_GLIB_H )
#define memory_free( buffer ) \
g_free( (gpointer) buffer )

#elif defined( HAVE_FREE ) || ( defined( WINAPI ) && defined( USE_CRT_FUNCTIONS ) )
#define memory_free( buffer ) \
free( (void *) buffer )

#elif defined( WINAPI )
#define memory_free( buffer ) \
HeapFree( GetProcessHeap(), 0, (LPVOID) buffer )
#endif

/* Memory compare
*/
#if defined( HAVE_MEMCMP ) || defined( WINAPI )
#define memory_compare( buffer1, buffer2, size ) \
memcmp( (const void *) buffer1, (const void *) buffer2, size )
#endif

/* Memory copy
*/
#if defined( HAVE_MEMCPY ) || defined( WINAPI )
#define memory_copy( destination, source, count ) \
memcpy( (void *) destination, (void *) source, count )
#endif

/* Memory set
*/
#if defined( HAVE_MEMSET ) || defined( WINAPI )
#define memory_set( buffer, value, count ) \
memset( (void *) buffer, (int) value, count )
#endif

#if defined( __cplusplus )
}
#endif

#endif


+ 298
- 0
common/types.h.in View File

@@ -0,0 +1,298 @@
/*
* Type and type-support defintions
*
* Copyright (c) 2006-2014, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This software is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/

#if !defined( _TYPES_H )
#define _TYPES_H

#include "common.h"

#if defined( HAVE_LIMITS_H ) || defined( WINAPI )
#include <limits.h>
#endif

/* Make sure to include inttypes.h or stdint.h before
* PRI definitions are defined
*/
#include <@PACKAGE@/types.h>

/* Fix for systems without PRI definitions
*/
#if !defined( PRId8 )
#define PRId8 "d"
#endif

#if !defined( PRId16 )
#define PRId16 "d"
#endif

#if !defined( PRId32 )
#if defined( WINAPI )
#define PRId32 "I32d"

#else
#define PRId32 "d"

#endif
#endif

#if !defined( PRId64 )
#if defined( WINAPI )
#define PRId64 "I64d"

#elif __WORDSIZE == 64
#define PRId64 "ld"

#else
#define PRId64 "lld"

#endif
#endif

#if !defined( PRIi8 )
#define PRIi8 "i"
#endif

#if !defined( PRIi16 )
#define PRIi16 "i"
#endif

#if !defined( PRIi32 )
#if defined( WINAPI )
#define PRIi32 "I32i"

#else
#define PRIi32 "i"

#endif
#endif

#if !defined( PRIi64 )
#if defined( WINAPI )
#define PRIi64 "I64i"

#elif __WORDSIZE == 64
#define PRIi64 "li"

#else
#define PRIi64 "lli"

#endif
#endif

#if !defined( PRIu8 )
#define PRIu8 "u"
#endif

#if !defined( PRIu16 )
#define PRIu16 "u"
#endif

#if !defined( PRIu32 )
#if defined( WINAPI )
#define PRIu32 "I32u"

#else
#define PRIu32 "u"

#endif
#endif

#if !defined( PRIu64 )
#if defined( WINAPI )
#define PRIu64 "I64u"

#elif __WORDSIZE == 64
#define PRIu64 "lu"

#else
#define PRIu64 "llu"

#endif
#endif

#if !defined( PRIx8 )
#define PRIx8 "x"
#endif

#if !defined( PRIx16 )
#define PRIx16 "x"
#endif

#if !defined( PRIx32 )
#if defined( WINAPI )
#define PRIx32 "I32x"

#else
#define PRIx32 "x"

#endif
#endif

#if !defined( PRIx64 )
#if defined( WINAPI )
#define PRIx64 "I64x"

#elif __WORDSIZE == 64
#define PRIx64 "lx"

#else
#define PRIx64 "llx"

#endif
#endif

/* Fix for systems without printf %jd definition
*/
#if defined( HAVE_PRINTF_JD )
#define PRIjd "jd"
#define PRIji "ji"
#define PRIju "ju"
#define PRIjx "jx"

#elif SIZEOF_OFF_T == 8
#define PRIjd PRId64
#define PRIji PRIi64
#define PRIju PRIu64
#define PRIjx PRIx64

#else
#define PRIjd PRId32
#define PRIji PRIi32
#define PRIju PRIu32
#define PRIjx PRIx32

#endif

/* Fix for systems without printf %zd definition
*/
#if defined( HAVE_PRINTF_ZD )
#define PRIzd "zd"
#define PRIzi "zi"
#define PRIzu "zu"
#define PRIzx "zx"

#elif defined( WINAPI )
#define PRIzd "Id"
#define PRIzi "Ii"
#define PRIzu "Iu"
#define PRIzx "Ix"

#elif SIZEOF_SIZE_T == 8
#define PRIzd PRId64
#define PRIzi PRIi64
#define PRIzu PRIu64
#define PRIzx PRIx64

#else
#define PRIzd PRId32
#define PRIzi PRIi32
#define PRIzu PRIu32
#define PRIzx PRIx32

#endif

/* Fix for systems without (U)INTx_MAX definitions
*/

/* The maximum signed 8-bit integer is 127 (0x7f)
*/
#if !defined( INT8_MAX )
#define INT8_MAX (0x7f)
#endif

/* The maximum unsigned 8-bit integer is 256 (0xff)
*/
#if !defined( UINT8_MAX )
#define UINT8_MAX (0xff)
#endif

/* The maximum signed 16-bit integer is 32767 (0xr7ffff)
*/
#if !defined( INT16_MAX )
#define INT16_MAX (0x7fff)
#endif

/* The maximum unsigned 16-bit integer is 65535 (0xffff)
*/
#if !defined( UINT16_MAX )
#define UINT16_MAX (0xffff)
#endif

/* The maximum signed 32-bit integer is 2147483647 (0x7fffffff)
*/
#if !defined( INT32_MAX )
#define INT32_MAX (0x7fffffffL)
#endif

/* The maximum unsigned 32-bit integer is 4294967295 (0xffffffff)
*/
#if !defined( UINT32_MAX )
#define UINT32_MAX (0xffffffffUL)
#endif

/* The maximum signed 64-bit integer is 9223372036854775807 (0x7fffffffffffffff)
*/
#if !defined( INT64_MAX )
#if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 )
#define INT64_MAX (0x7fffffffffffffffUL)
#else
#define INT64_MAX (0x7fffffffffffffffULL)
#endif
#endif

/* The maximum signed integer
*/
#if !defined( INT_MAX )
#define INT_MAX INT32_MAX
#endif

/* The maximum unsigned integer
*/
#if !defined( UINT_MAX )
#define UINT_MAX UINT32_MAX
#endif

/* The maximum signed size type is platform dependent
*/
#if !defined( SSIZE_MAX )

#if defined( WINAPI )

#if defined( _WIN64 )
#define SSIZE_MAX INT64_MAX
#else
#define SSIZE_MAX INT32_MAX
#endif /* _WIN64 */

#else

#if __WORDSIZE == 64
#define SSIZE_MAX INT64_MAX
#else
#define SSIZE_MAX INT32_MAX
#endif /* __WORDSIZE == 64 */

#endif /* WINAPI */

#endif /* SSIZE_MAX */

#endif


+ 289
- 0
configure.ac View File

@@ -0,0 +1,289 @@
AC_PREREQ( 2.59 )

AC_INIT(
[libpff],
[20141002],
[joachim.metz@gmail.com])

AC_CONFIG_SRCDIR(
[include/libpff.h.in])

AM_INIT_AUTOMAKE([gnu 1.6])

AC_CONFIG_MACRO_DIR([m4])

dnl Check for host type
AC_CANONICAL_HOST

dnl Check for large file support
AC_SYS_LARGEFILE

dnl Check for libtool DLL support
AC_LIBTOOL_WIN32_DLL

dnl Checks for programs
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_PROG_MAKE_SET
AC_PROG_INSTALL

dnl Check for libtool
AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)

dnl Check for pkg-config
AC_PATH_PROG(PKGCONFIG,[pkg-config])

dnl Support of internationalization (i18n)
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.18.1])

dnl Check for compiler language support
AC_C_CONST
AC_C_VOLATILE

dnl Check if WINAPI support should be enabled
AX_COMMON_CHECK_ENABLE_WINAPI

dnl Check if wide character type should be enabled
AX_COMMON_CHECK_ENABLE_WIDE_CHARACTER_TYPE

dnl Check for type definitions
AX_TYPES_CHECK_LOCAL

dnl Checks for libraries and library functions
AX_COMMON_CHECK_LOCAL

dnl Check for enabling libcstring for cross-platform C string functions
AX_LIBCSTRING_CHECK_ENABLE

dnl Check for enabling libcerror for cross-platform C error functions
AX_LIBCERROR_CHECK_ENABLE

dnl Check for enabling libcthreads for cross-platform C threads functions
AX_LIBCTHREADS_CHECK_ENABLE

dnl Check for enabling libcdata for cross-platform C generic data functions
AX_LIBCDATA_CHECK_ENABLE

dnl Check for enabling libclocale for cross-platform C locale functions
AX_LIBCLOCALE_CHECK_ENABLE

dnl Check for enabling libcnotify for cross-platform C notification functions
AX_LIBCNOTIFY_CHECK_ENABLE

dnl Check for enabling libcsplit for cross-platform C split string functions
AX_LIBCSPLIT_CHECK_ENABLE

dnl Check for enabling libuna for Unicode string support
AX_LIBUNA_CHECK_ENABLE

dnl Check for enabling libcfile for cross-platform C file functions
AX_LIBCFILE_CHECK_ENABLE

dnl Check for enabling libcpath for cross-platform C path functions
AX_LIBCPATH_CHECK_ENABLE

dnl Check for enabling libbfio for basic file IO support
AX_LIBBFIO_CHECK_ENABLE

dnl Check for enabling libfcache for file value cache support
AX_LIBFCACHE_CHECK_ENABLE

dnl Check for enabling libfdata for file data types support
AX_LIBFDATA_CHECK_ENABLE

dnl Check for enabling libfdatetime for file date and time support
AX_LIBFDATETIME_CHECK_ENABLE

dnl Check for enabling libfguid for file GUID/UUID support
AX_LIBFGUID_CHECK_ENABLE

dnl Check for enabling libfvalue for file value support
AX_LIBFVALUE_CHECK_ENABLE

dnl Check for enabling libfwnt for file Windows NT type support
AX_LIBFWNT_CHECK_ENABLE

dnl Check for enabling libfmapi for file MAPI types support
AX_LIBFMAPI_CHECK_ENABLE

dnl Check for zlib compression support
AX_ZLIB_CHECK_ENABLE

dnl Check for library function support
AX_LIBPFF_CHECK_LOCAL

dnl Check for enabling libcsystem for cross-platform C generic system functions
AX_LIBCSYSTEM_CHECK_ENABLE

dnl Check if pfftools should be build as static executables
AX_COMMON_CHECK_ENABLE_STATIC_EXECUTABLES

dnl Check if libpff should be build with verbose output
AX_COMMON_CHECK_ENABLE_VERBOSE_OUTPUT

dnl Check if libpff should be build with debug output
AX_COMMON_CHECK_ENABLE_DEBUG_OUTPUT

dnl Check if libpff java bindings (jpff) should be build
AX_JAVA_CHECK_ENABLE

dnl Check if libpff python bindings (pypff) should be build
AX_PYTHON_CHECK_ENABLE

dnl Headers included in various places
AC_CHECK_HEADERS([stdarg.h varargs.h])

AS_IF(
[test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes],
[AC_MSG_FAILURE(
[Missing headers: stdarg.h and varargs.h],
[1])
])

dnl Check if DLL support is needed
AS_IF(
[test "x$enable_shared" = xyes],
[AS_CASE(
[$host],
[*cygwin* | *mingw*],
[AC_DEFINE(
[HAVE_DLLMAIN],
[1],
[Define to 1 to enable the DllMain function.])
AC_SUBST(
[HAVE_DLLMAIN],
[1])

AS_IF(
[test "x$ac_cv_enable_static_executables" = xno],
[AC_SUBST(
[LIBPFF_DLL_IMPORT],
["-DLIBPFF_DLL_IMPORT"])
])
])
])

dnl Set additional compiler flags
CFLAGS="$CFLAGS -Wall";

dnl Check if requires and build requires should be set in spec file
AS_IF(
[test "x$ac_cv_libcstring" = xyes || test "x$ac_cv_libcerror" = xyes || test "x$ac_cv_libcthreads" = xyes || test "x$ac_cv_libcdata" = xyes || test "x$ac_cv_libclocale" = xyes || test "x$ac_cv_libcnotify" = xyes || test "x$ac_cv_libcsplit" = xyes || test "x$ac_cv_libuna" = xyes || test "x$ac_cv_libcfile" = xyes || test "x$ac_cv_libcpath" = xyes || test "x$ac_cv_libbfio" = xyes || test "x$ac_cv_libfcache" = xyes || test "x$ac_cv_libfdata" = xyes || test "x$ac_cv_libfdatetime" = xyes || test "x$ac_cv_libfguid" = xyes || test "x$ac_cv_libfvalue" = xyes || test "x$ac_cv_libfwnt" = xyes || test "x$ac_cv_libfmapi" = xyes || test "x$ac_cv_zlib" != xno],
[AC_SUBST(
[libpff_spec_requires],
[Requires:])
AC_SUBST(
[libpff_spec_build_requires],
[BuildRequires:])
])

AS_IF(
[test "x$ac_cv_libcsystem" = xyes],
[AC_SUBST(
[libpff_tools_spec_build_requires],
[BuildRequires:])
])

dnl Set the date for the dpkg files
AC_SUBST(
[DPKG_DATE],
[`date -R 2> /dev/null`])

dnl Set the date for the spec file
AC_SUBST(
[SPEC_DATE],
[`date +"%a %b %e %Y" 2> /dev/null`])

dnl Set the current working directory for PackageMaker files
AC_SUBST(
[PWD],
[`pwd`])

dnl Have configure make the Makefiles
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([include/Makefile])
AC_CONFIG_FILES([common/Makefile])
AC_CONFIG_FILES([libcstring/Makefile])
AC_CONFIG_FILES([libcerror/Makefile])
AC_CONFIG_FILES([libcthreads/Makefile])
AC_CONFIG_FILES([libcdata/Makefile])
AC_CONFIG_FILES([libclocale/Makefile])
AC_CONFIG_FILES([libcnotify/Makefile])
AC_CONFIG_FILES([libcsplit/Makefile])
AC_CONFIG_FILES([libuna/Makefile])
AC_CONFIG_FILES([libcfile/Makefile])
AC_CONFIG_FILES([libcpath/Makefile])
AC_CONFIG_FILES([libbfio/Makefile])
AC_CONFIG_FILES([libfcache/Makefile])
AC_CONFIG_FILES([libfdata/Makefile])
AC_CONFIG_FILES([libfdatetime/Makefile])
AC_CONFIG_FILES([libfguid/Makefile])
AC_CONFIG_FILES([libfvalue/Makefile])
AC_CONFIG_FILES([libfwnt/Makefile])
AC_CONFIG_FILES([libfmapi/Makefile])
AC_CONFIG_FILES([libpff/Makefile])
AC_CONFIG_FILES([libcsystem/Makefile])
AC_CONFIG_FILES([pfftools/Makefile])
AC_CONFIG_FILES([jpff/Makefile])
AC_CONFIG_FILES([pypff/Makefile])
AC_CONFIG_FILES([po/Makefile.in])
AC_CONFIG_FILES([po/Makevars])
AC_CONFIG_FILES([manuals/Makefile])
AC_CONFIG_FILES([tests/Makefile])
AC_CONFIG_FILES([msvscpp/Makefile])
dnl Have configure make the include files
AC_CONFIG_FILES([include/libpff.h])
AC_CONFIG_FILES([include/libpff/definitions.h])
AC_CONFIG_FILES([include/libpff/features.h])
AC_CONFIG_FILES([include/libpff/types.h])
AC_CONFIG_FILES([libpff/libpff_definitions.h])
dnl Have configure make distribution specific files
AC_CONFIG_FILES([common/types.h])
AC_CONFIG_FILES([dpkg/changelog])
AC_CONFIG_FILES([dpkg/copyright])
AC_CONFIG_FILES([libpff/libpff.rc])
AC_CONFIG_FILES([pypff/setup.py])
AC_CONFIG_FILES([libpff.pc])
AC_CONFIG_FILES([libpff.spec])
dnl Have configure write its configuration
AC_CONFIG_HEADERS([common/config.h])

AC_OUTPUT

dnl Print a summary
AC_MSG_NOTICE([
Building:
libcstring support: $ac_cv_libcstring
libcerror support: $ac_cv_libcerror
libcthreads support: $ac_cv_libcthreads
libcdata support: $ac_cv_libcdata
libclocale support: $ac_cv_libclocale
libcnotify support: $ac_cv_libcnotify
libcsplit support: $ac_cv_libcsplit
libuna support: $ac_cv_libuna
libcfile support: $ac_cv_libcfile
libcpath support: $ac_cv_libcpath
libbfio support: $ac_cv_libbfio
libfcache support: $ac_cv_libfcache
libfdata support: $ac_cv_libfdata
libfdatetime support: $ac_cv_libfdatetime
libfguid support: $ac_cv_libfguid
libfvalue support: $ac_cv_libfvalue
libfwnt support: $ac_cv_libfwnt
libfmapi support: $ac_cv_libfmapi
DEFLATE compression support: $ac_cv_zlib
libcsystem support: $ac_cv_libcsystem

Features:
Multi-threading support: $ac_cv_libcthreads_multi_threading
Wide character type support: $ac_cv_enable_wide_character_type
pfftools are build as static executables: $ac_cv_enable_static_executables
Java (jpff) support: $ac_cv_enable_java
Python (pypff) support: $ac_cv_enable_python
Verbose output: $ac_cv_enable_verbose_output
Debug output: $ac_cv_enable_debug_output
]);



+ 5
- 0
dpkg/changelog.in View File

@@ -0,0 +1,5 @@
libpff (@VERSION@-1) unstable; urgency=low

* Auto-generated

-- Joachim Metz <joachim.metz@gmail.com> @DPKG_DATE@

+ 1
- 0
dpkg/compat View File

@@ -0,0 +1 @@
7

+ 51
- 0
dpkg/control View File

@@ -0,0 +1,51 @@
Source: libpff
Section: unknown
Priority: extra
Maintainer: Joachim Metz <joachim.metz@gmail.com>
Build-Depends: debhelper (>= 7), autotools-dev, zlib1g-dev, python-dev
Standards-Version: 3.8.3
Homepage: http://code.google.com/p/libpff/

Package: libpff
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Suggests: libpff-dbg
Description: Library to access the Personal Folder File (PFF) and the Offline Folder File (OFF) format. PFF is used in PAB (Personal Address Book), PST (Personal Storage Table) and OST (Offline Storage Table) files.
libpff is a library to access the Personal Folder File (PFF) and the Offline Folder File (OFF) format. PFF is used in PAB (Personal Address Book), PST (Personal Storage Table) and OST (Offline Storage Table) files.

Package: libpff-dbg
Architecture: any
Section: debug
Depends: libpff (= ${Source-Version}), ${misc:Depends}
Description: Debugging symbols for libpff

Package: libpff-dev
Section: libdevel
Architecture: any
Depends: libpff (= ${Source-Version})
Description: Header files and libraries for developing applications for libpff
Header files and libraries for developing applications for libpff.

Package: libpff-tools
Section: utils
Architecture: any
Depends: libpff (= ${Source-Version}), ${shlibs:Depends}
Description: Several tools for reading Personal Folder Files (OST, PAB and PST)
Several tools for reading Personal Folder Files (OST, PAB and PST)

Package: libpff-python
Section: python
Architecture: any
Depends: libpff (= ${Source-Version}), ${shlibs:Depends}, ${python:Depends}
Suggests: libpff-python-dbg
Description: Python bindings for libpff
Python bindings for libpff.

Package: libpff-python-dbg
Section: debug
Architecture: any
Depends: libpff-python (= ${Source-Version})
Description: Debugging symbols for libpff-python
Debugging symbols for libpff-python.


+ 40
- 0
dpkg/copyright.in View File

@@ -0,0 +1,40 @@
This work was packaged for Debian by:

Joachim Metz <joachim.metz@gmail.com> on @DPKG_DATE@

It was downloaded from http://code.google.com/p/libpff/

Upstream Author(s):

Joachim Metz <joachim.metz@gmail.com>

Copyright:

Copyright (C) 2008-2014, Joachim Metz <joachim.metz@gmail.com>

License:

This package is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.

This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

On Debian systems, the complete text of the GNU Lesser General
Public License can be found in `/usr/share/common-licenses/LGPL-3'.

The Debian packaging is:

Copyright (C) 2008-2014, Joachim Metz <joachim.metz@gmail.com>

and is licensed under the GNU Lesser General Public License,
see `/usr/share/common-licenses/LGPL-3'.


+ 4
- 0
dpkg/libpff-dev.docs View File

@@ -0,0 +1,4 @@
AUTHORS
COPYING
NEWS
README

+ 4
- 0
dpkg/libpff-tools.docs View File

@@ -0,0 +1,4 @@
AUTHORS
COPYING
NEWS
README

+ 4
- 0
dpkg/libpff.docs View File

@@ -0,0 +1,4 @@
AUTHORS
COPYING
NEWS
README

+ 96
- 0
dpkg/rules View File

@@ -0,0 +1,96 @@
#!/usr/bin/make -f
# debian/rules that uses debhelper >= 7.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS

%:
dh $@

.PHONY: override_dh_auto_configure
override_dh_auto_configure:
dh_auto_configure -- --enable-python CFLAGS="-g"

.PHONY: override_dh_auto_test
override_dh_auto_test:

.PHONY: override_dh_install
override_dh_install:
# Create the libpff package.
dh_install "debian/tmp/usr/lib/lib*.so.*.*.*" -p libpff
# Create the libpff-dev package.
dh_install "debian/tmp/usr/include/*.h" -p libpff-dev
dh_install "debian/tmp/usr/include/lib*/*.h" -p libpff-dev
dh_install "debian/tmp/usr/lib/*.a" -p libpff-dev
dh_install "debian/tmp/usr/lib/*.la" -p libpff-dev
dh_install "debian/tmp/usr/lib/*.so" -p libpff-dev
dh_install "debian/tmp/usr/lib/pkgconfig/*" -p libpff-dev
dh_install "debian/tmp/usr/share/man/man3/*" -p libpff-dev
# Create the libpff-tools package.
dh_install "debian/tmp/usr/bin/*" -p libpff-tools
dh_install "debian/tmp/usr/share/man/man1/*" -p libpff-tools
# Create the libpff-python package.
dh_install -X"*_d.so" "debian/tmp/usr/lib/python*/*" -p libpff-python
# The libpff-dbg and libpff-python-dbg packages are created by dh_strip.
dh_install

.PHONY: override_dh_installmenu
override_dh_installmenu:

.PHONY: override_dh_installmime
override_dh_installmime:

.PHONY: override_dh_installmodules
override_dh_installmodules:

.PHONY: override_dh_installlogcheck
override_dh_installlogcheck:

.PHONY: override_dh_installlogrotate
override_dh_installlogrotate:

.PHONY: override_dh_installpam
override_dh_installpam:

.PHONY: override_dh_installppp
override_dh_installppp:

.PHONY: override_dh_installudev
override_dh_installudev:

.PHONY: override_dh_installwm
override_dh_installwm:

.PHONY: override_dh_installxfonts
override_dh_installxfonts:

.PHONY: override_dh_gconf
override_dh_gconf: