Kick libmpq includes and sourcefiles into shape

--HG--
branch : trunk
rename : dep/libmpq/libmpq/common.h => dep/include/libmpq/common.h
rename : dep/libmpq/libmpq/crypt_buf.h => dep/include/libmpq/crypt_buf.h
rename : dep/libmpq/libmpq/explode.h => dep/include/libmpq/explode.h
rename : dep/libmpq/libmpq/extract.h => dep/include/libmpq/extract.h
rename : dep/libmpq/libmpq/huffman.h => dep/include/libmpq/huffman.h
rename : dep/libmpq/libmpq/mpq-internal.h => dep/include/libmpq/mpq-internal.h
rename : dep/libmpq/libmpq/mpq.h => dep/include/libmpq/mpq.h
rename : dep/libmpq/libmpq/wave.h => dep/include/libmpq/wave.h
rename : dep/libmpq/libmpq/common.c => dep/src/libmpq/common.c
rename : dep/libmpq/libmpq/explode.c => dep/src/libmpq/explode.c
rename : dep/libmpq/libmpq/extract.c => dep/src/libmpq/extract.c
rename : dep/libmpq/libmpq/huffman.c => dep/src/libmpq/huffman.c
rename : dep/libmpq/libmpq/mpq.c => dep/src/libmpq/mpq.c
rename : dep/libmpq/libmpq/wave.c => dep/src/libmpq/wave.c
This commit is contained in:
click
2010-06-06 00:33:59 +02:00
parent 75b80d9f5b
commit 57dfe20206
77 changed files with 0 additions and 3771 deletions

View File

@@ -1,10 +0,0 @@
Project Initiator:
* Maik Broemme <mbroemme@plusserver.de>
Developers:
* Maik Broemme <mbroemme@plusserver.de>
* Tilman Sauerbeck <tilman@code-monkey.de>
* Forrest Voight <voights@gmail.com>
* Georg Lukas <georg@op-co.de>

View File

@@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the 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 Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@@ -1,68 +0,0 @@
FAQ - Frequently Asked Questions
================================
Q: What is libmpq?
A: libmpq is a library for manipulating MoPaQ mpq archives mostly used
used by Blizzard in their games.
Q: What can i do with libmpq?
A: With libmpq you can write applications which can extract, create
and manipulate mpq archives.
Q: Is it legal?
A: Yes, i think so. I have no idea why it should not, all informations
about the fileformat are available.
Q: Is there a description of the functions?
A: Since version 0.4.0 libmpq comes with a API documentation for
developers. The documentation is written as manual pages.
Q: Can i help?
A: Yes, help is needed, not only with developing, also with testing.
A good point to start is using a recent SVN version of libmpq and
trying to use it with every mpq archive you could get :)
Q: Can you give a small example to demonstrate the usage?
A: Of course :) The example below takes first parameter as mpq archive
and extracts the first file to a buffer.
/*
* Compile with:
*
* x86_32:
*
* gcc \
* -D_FILE_OFFSET_BITS=64 \
* -D_LARGE_FILES=1 \
* -D_LARGEFILE_SOURCE=1 \
* mpq-example.c -o mpq-example -lmpq -lz -lbz2 -I/usr/local/include/libmpq
*
* x86_64:
*
* gcc \
* -D_LARGE_FILES=1 \
* mpq-example.c -o mpq-example -lmpq -lz -lbz2 -I/usr/local/include/libmpq
*/
#include <mpq.h>
#include <stdlib.h>
#include <limits.h>
int main(int argc, char **argv) {
mpq_archive_s *mpq_archive;
off_t out_size;
char *out_buf;
/* open the mpq archive given as first parameter. */
libmpq__archive_open(&mpq_archive, argv[1], -1);
/* get size of first file (0) and malloc output buffer. */
libmpq__file_unpacked_size(mpq_archive, 0, &out_size);
out_buf = malloc(out_size);
/* read, decrypt and unpack file to output buffer. */
libmpq__file_read(mpq_archive, 0, out_buf, out_size, NULL);
/* close the mpq archive. */
libmpq__archive_close(mpq_archive);
}

View File

@@ -1,26 +0,0 @@
# minimum required automake 1.6
AUTOMAKE_OPTIONS = 1.6
# any directories which should be built and installed.
SUBDIRS = libmpq bindings doc
# the directories which are part of the distribution.
DIST_SUBDIRS = $(SUBDIRS)
# libmpq runtime configuration script.
bin_SCRIPTS = libmpq-config
# pkg-config installation directory.
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libmpq.pc
# extra stuff.
EXTRA_DIST = \
AUTHORS \
COPYING \
FAQ \
INSTALL \
NEWS \
README \
THANKS \
TODO

View File

@@ -1,76 +0,0 @@
Changes version 0.4.2 (2008-05-16)
==================================
* added full extraction support for protected maps used in
warcraft 3.
* added full extraction support for all blizzard titles until
world of warcraft - the burning crusade.
* added support for archives version 2 with extended header and
extended block table.
* added support for the bzip2 compression algorithm.
* added support for archives and files inside archive > 2gb.
* added generic read functions, which will do decryption,
decompression or exploding.
* the info functions are no longer exported by the library and
were replaced by separate api functions.
* the file number and block number are count from 0 instead
of 1.
* added python bindings.
* linking against libmpq requires from now on the usual largefile
macros -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES=1 -D_LARGEFILE_SOURCE=1
Changes version 0.4.1 (2008-04-02)
==================================
* memory, speed and stability improvements.
* split sourcecode into library and utility package.
Changes version 0.4.0 (2008-03-31)
==================================
* added robust error handling to make the library and extracting
utility more stable.
* added c++ bindings to public include and moved internal defines
and functions to private include.
* added support for 64-bit architectures and removed any stupid
pointer to int arithmetics.
* added much better member names to the structures to make
developers able to understand the code on reading.
* added full api documentation using manual pages.
* added full extraction support for all blizzard titles until
warcraft 3 - the frozen throne.
* added support for single sector and stored files (neither
compressed nor imploded).
* added support for files which have compressed size greater than
uncompressed size.
* removed the external listfile database support from 0.3.0 it
was a weird implementation.
Changes version 0.3.0 (2004-02-12)
==================================
* added listfile database support from external files.
Initial version 0.2.1 (2004-01-17)
==================================
* first version which was able to extract some of the older mopaq
archives.

View File

@@ -1,34 +0,0 @@
Introduction
============
'libmpq' is a library which can be easily used in own applications
to extract, create or manipulate MoPaQ mpq archives.
MPQ, or MoPaQ, is a proprietary archive format created by
Mike O'Brien, the man hailed as Blizzard's multiplayer engine
genius, back in 1996 as a general purpose archive for use with
Diablo, and named narcissistically for its creator
"Mike O'brien PaCK". The copyrights to it, however, are held by
Havas Interactive, Blizzard's parent company. The archive format
is used by many Blizzard titles like Diablo, Diablo 2, Starcraft,
Warcraft 2: BNE, a newer version in Warcraft 3 and World of
Warcraft (WoW).
Manual
======
Since version 0.4.0 the 'libmpq' package comes with a manpage for
every library function. If you use 'libmpq' first time it is a good
idea to read the `FAQ' file.
Reporting Bugs
==============
Bug reports for 'libmpq' can be send to me directly.
* Maik Broemme <mbroemme@plusserver.de>
Enjoy!
Maik Broemme <mbroemme@plusserver.de>
http://www.babelize.org/

View File

@@ -1,21 +0,0 @@
'libmpq' was originaly created by Maik Broemme <mbroemme@plusserver.de>
and i want to thank some people which helped by supplying knowledge, code or
something else.
* Romy Trompke <rtnet@web.de>
- my lovely girlfriend for her patience
* Ladislav Zezula <ladik@zezula.net>
- stormlib creator
* Marko Friedemann <marko.friedemann@bmx-chemnitz.de>
- initial port of stormlib to linux
* Tom Amigo <tomamigo@apexmail.com>
- first people who decrypts the MoPaQ archive format
* ShadowFlare <BlakFlare@hiotmail.com>
- creator of the ShadowFlare MPQ API
* Justin Olbrantz (Quantam) <omega@dragonfire.net>
- creator of the client using ShadowFlare MPQ API

View File

@@ -1,10 +0,0 @@
Features and functionality which should be added in the future.
* Porting for big endian systems.
* Porting for Windows? :)
* Creating mpq archives.
* Brute all unknown filenames, Blizzard uses in their
archives.
Look at the AUTHORS file if you want help me with 'libmpq', or
if you have other interesting features which should be added.

View File

@@ -1,19 +0,0 @@
#!/bin/sh
#
echo "Generating build information using aclocal, autoheader, automake and autoconf"
echo "This may take a while ..."
# Touch the timestamps on all the files since CVS messes them up
directory=`dirname $0`
touch $directory/configure.ac
# Regenerate configuration files
libtoolize --copy
aclocal
autoheader
automake --foreign --add-missing --copy
autoconf
# Run configure for this platform
#./configure $*
echo "Now you are ready to run ./configure"

View File

@@ -1,6 +0,0 @@
# any directories which should be built and installed.
SUBDIRS = d
if HAVE_PYTHON
SUBDIRS += python
endif

View File

@@ -1,6 +0,0 @@
# minimum required automake 1.6
AUTOMAKE_OPTIONS = 1.6
# install D binding to /usr/include/d by default
libmpq_includedir = $(includedir)/d
libmpq_include_HEADERS = mpq.d

View File

@@ -1,2 +0,0 @@
[mpq.d]
type=sourcelibrary

View File

@@ -1,318 +0,0 @@
/*
* mpq.d -- D programming language module for libmpq
*
* Copyright (c) 2008 Georg Lukas <georg@op-co.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* This module is written to support Phobos. Patches to allow binding to
* Tango are welcome.
*/
module mpq;
/* the following pragma does not work on DMD/Linux, generates a warning on
* GDC/Linux and has not been tested on Windows. Commented out for now. */
// pragma(lib, "libmpq");
import std.string; // for format() and toStringz()
import std.traits; // for ParameterTypeTuple!()
/* XXX: this assumes that libmpq is compiled with Large File Support on */
alias long off_t;
/* libmpq error return values */
const LIBMPQ_ERROR_OPEN = -1; /* open error on file. */
const LIBMPQ_ERROR_CLOSE = -2; /* close error on file. */
const LIBMPQ_ERROR_SEEK = -3; /* lseek error on file. */
const LIBMPQ_ERROR_READ = -4; /* read error on file. */
const LIBMPQ_ERROR_WRITE = -5; /* write error on file. */
const LIBMPQ_ERROR_MALLOC = -6; /* memory allocation error. */
const LIBMPQ_ERROR_FORMAT = -7; /* format errror. */
const LIBMPQ_ERROR_NOT_INITIALIZED = -8; /* init() wasn't called. */
const LIBMPQ_ERROR_SIZE = -9; /* buffer size is to small. */
const LIBMPQ_ERROR_EXIST = -10; /* file or block does not exist in archive. */
const LIBMPQ_ERROR_DECRYPT = -11; /* we don't know the decryption seed. */
const LIBMPQ_ERROR_UNPACK = -12; /* error on unpacking file. */
/** libmpq internal meta-data for an archive */
struct mpq_archive_s;
extern(C) {
/* libmpq__generic information about library. */
char *libmpq__version();
/* libmpq__generic mpq archive information. */
int libmpq__archive_open(mpq_archive_s **mpq_archive, char *mpq_filename, off_t archive_offset);
int libmpq__archive_close(mpq_archive_s *mpq_archive);
int libmpq__archive_packed_size(mpq_archive_s *mpq_archive, off_t *packed_size);
int libmpq__archive_unpacked_size(mpq_archive_s *mpq_archive, off_t *unpacked_size);
int libmpq__archive_offset(mpq_archive_s *mpq_archive, off_t *offset);
int libmpq__archive_version(mpq_archive_s *mpq_archive, uint *version_);
int libmpq__archive_files(mpq_archive_s *mpq_archive, uint *files);
/* libmpq__generic file processing functions. */
int libmpq__file_packed_size(mpq_archive_s *mpq_archive, uint file_number, off_t *packed_size);
int libmpq__file_unpacked_size(mpq_archive_s *mpq_archive, uint file_number, off_t *unpacked_size);
int libmpq__file_offset(mpq_archive_s *mpq_archive, uint file_number, off_t *offset);
int libmpq__file_blocks(mpq_archive_s *mpq_archive, uint file_number, uint *blocks);
int libmpq__file_encrypted(mpq_archive_s *mpq_archive, uint file_number, uint *encrypted);
int libmpq__file_compressed(mpq_archive_s *mpq_archive, uint file_number, uint *compressed);
int libmpq__file_imploded(mpq_archive_s *mpq_archive, uint file_number, uint *imploded);
int libmpq__file_number(mpq_archive_s *mpq_archive, char *filename, uint *number);
int libmpq__file_read(mpq_archive_s *mpq_archive, uint file_number, ubyte *out_buf, off_t out_size, off_t *transferred);
/* libmpq__generic block processing functions. */
int libmpq__block_open_offset(mpq_archive_s *mpq_archive, uint file_number);
int libmpq__block_close_offset(mpq_archive_s *mpq_archive, uint file_number);
int libmpq__block_unpacked_size(mpq_archive_s *mpq_archive, uint file_number, uint block_number, off_t *unpacked_size);
int libmpq__block_read(mpq_archive_s *mpq_archive, uint file_number, uint block_number, ubyte *out_buf, off_t out_size, off_t *transferred);
}
/** exception class for failed libmpq calls */
class MPQException : Exception {
const string[] Errors = [
"unknown error",
"open error on file",
"close error on file",
"lseek error on file",
"read error on file",
"write error on file",
"memory allocation error",
"format errror",
"init() wasn't called",
"buffer size is to small",
"file or block does not exist in archive",
"we don't know the decryption seed",
"error on unpacking file"];
public int errno;
this(char[] fnname = "unknown_function", int errno = 0) {
this.errno = errno;
if (-errno >= Errors.length)
errno = 0;
super(std.string.format("Error in %s(): %s (%d)",
fnname, Errors[-errno], errno));
}
}
/** template to wrap function calls and throw exceptions in case of error
*
* thanks for the idea to while(nan) blog,
* http://while-nan.blogspot.com/2007/06/wrapping-functions-for-fun-and-profit.html
*
* use: MPQ_CHECKERR(libmpq__archive_open)(&m, "foo.mpq", -1);
* returns the retval of archive_open on success;
* throws an MPQException on failure.
*
* @param Fn libmpq__function reference
* @param args libmpq__function parameters
* @return return value of libmpq__function on success
* @throw MPQException on error
*/
int MPQ_CHECKERR(alias Fn)(ParameterTypeTuple!(Fn) args)
{
int result = Fn(args);
if (result < 0) {
/* XXX: relying on non-specified stringof() behaviour */
throw new MPQException((&Fn).stringof[2..$], result);
}
return result;
}
/** mixin alias to wrap library functions into MPQ_CHECKERR.
*
* alias mpq.func_name(...) to MPQ_CHECKERR(libmpq__func_name)(...)
* @param func_name name of the function to be wrapped
*/
template MPQ_FUNC(char[] func_name) {
const char[] MPQ_FUNC = "alias MPQ_CHECKERR!(libmpq__" ~ func_name ~ ") " ~ func_name ~ ";";
}
alias libmpq__version libversion; /* must be direct alias because it returns char*, not error int */
mixin(MPQ_FUNC!("archive_open"));
mixin(MPQ_FUNC!("archive_close"));
mixin(MPQ_FUNC!("archive_packed_size"));
mixin(MPQ_FUNC!("archive_unpacked_size"));
mixin(MPQ_FUNC!("archive_offset"));
mixin(MPQ_FUNC!("archive_version"));
mixin(MPQ_FUNC!("archive_files"));
mixin(MPQ_FUNC!("file_packed_size"));
mixin(MPQ_FUNC!("file_unpacked_size"));
mixin(MPQ_FUNC!("file_offset"));
mixin(MPQ_FUNC!("file_blocks"));
mixin(MPQ_FUNC!("file_encrypted"));
mixin(MPQ_FUNC!("file_compressed"));
mixin(MPQ_FUNC!("file_imploded"));
mixin(MPQ_FUNC!("file_number"));
mixin(MPQ_FUNC!("file_read"));
mixin(MPQ_FUNC!("block_open_offset"));
mixin(MPQ_FUNC!("block_close_offset"));
mixin(MPQ_FUNC!("block_unpacked_size"));
mixin(MPQ_FUNC!("block_read"));
/** getter function named name for returning archive_* single values:
*
* <type> Archive.<name>() { return libmpq__archive_<name>() }
*
* @param type return type for the original function reference
* @param name name of the original function
* @param name2 name for the prototype (defaults to name, used for "version")
* @return getter function mixin
*/
template MPQ_A_GET(char[] type, char[] name, char[] name2 = name) {
const char[] MPQ_A_GET = type ~ " " ~ name2 ~ "() { " ~
type ~ " ret; " ~
"archive_" ~ name ~ "(m, &ret); return ret;" ~
"}";
}
/** wrapper class for an MPQ Archive
*
* syntax: auto a = new mpq.Archive("somefile.mpq");
*/
class Archive {
mpq_archive_s *m;
File listfile;
char[][] listfiledata;
this(char[] archivename, off_t offset = -1) {
archive_open(&m, toStringz(archivename), offset);
}
mixin(MPQ_A_GET!("off_t", "packed_size"));
mixin(MPQ_A_GET!("off_t", "unpacked_size"));
mixin(MPQ_A_GET!("off_t", "offset"));
mixin(MPQ_A_GET!("uint", "version", "version_"));
mixin(MPQ_A_GET!("uint", "files"));
~this() {
archive_close(m);
}
mpq_archive_s* archive() {
return m;
}
File opIndex(char[] fname) {
return new File(this, fname);
}
File opIndex(int fno) {
return new File(this, fno);
}
char[][] filelist() {
try {
if (!listfile) {
listfile = this["(listfile)"];
listfiledata = (cast(char[])listfile.read()).splitlines();
}
return listfiledata;
} catch (MPQException e) {
return [];
}
}
/+uint filenumber(char[] filename) {
try {
if (!listfile) {
listfile = this["(listfile)"];
listfiledata = (cast(char[])listfile.read()).splitlines();
}
return listfiledata;
} catch (MPQException e) {
return [];
}
}+/
}
/** getter function named name for returning file_* single values:
*
* <type> File.<name>() { return libmpq__file_<name>() }
*
* @param type return type for the original function reference
* @param name name of the original function
* @param name2 name for the prototype (defaults to name, used for "version")
* @return getter function mixin
*/
template MPQ_F_GET(char[] type, char[] name, char[] name2 = name) {
const char[] MPQ_F_GET = type ~ " " ~ name2 ~ "() { " ~
type ~ " ret; " ~
"file_" ~ name ~ "(am, fileno, &ret); " ~
"return ret;" ~
"}";
}
/** wrapper class for a single file in an MPQ Archive
*
* syntax:
* auto a = new mpq.Archive("somefile.mpq");
* auto f = a["(listfile)"];
* auto f2 = a[0];
* auto f3 = new File(a, "(listfile)");
*/
class File {
Archive a;
mpq_archive_s* am;
char[] filename;
uint fileno;
this(Archive a, int fileno) {
this.a = a;
this.am = a.archive();
if (fileno >= a.files) {
throw new MPQException(format("File(%d)", fileno),
LIBMPQ_ERROR_EXIST);
}
this.filename = format("file%04d.xxx", fileno);
this.fileno = fileno;
}
this(Archive a, char[] filename) {
this.a = a;
this.am = a.archive();
this.filename = filename;
/* this line will throw an exception when the file is not there */
mpq.file_number(am, toStringz(filename), &this.fileno);
}
mixin(MPQ_F_GET!("off_t", "packed_size"));
mixin(MPQ_F_GET!("off_t", "unpacked_size"));
mixin(MPQ_F_GET!("off_t", "offset"));
mixin(MPQ_F_GET!("uint", "blocks"));
mixin(MPQ_F_GET!("uint", "encrypted"));
mixin(MPQ_F_GET!("uint", "compressed"));
mixin(MPQ_F_GET!("uint", "imploded"));
uint no() { return fileno; }
char[] name() { return filename; }
ubyte[] read() {
ubyte[] content;
content.length = this.unpacked_size();
off_t trans;
mpq.file_read(am, fileno, content.ptr, content.length, &trans);
content.length = trans;
return content;
}
}

View File

@@ -1,5 +0,0 @@
# minimum required automake 1.6
AUTOMAKE_OPTIONS = 1.6
# library information and headers which should not be installed.
python_PYTHON = mpq.py

View File

@@ -1,16 +0,0 @@
#!/usr/bin/env python
from __future__ import division
import sys
import mpq
archive = mpq.Archive(sys.argv[1])
print "Name: %s" % sys.argv[1]
print "Version: %s" % archive.filename
print "Offset: %s" % archive.offset
print "Packed size: %s" % archive.packed_size
print "Unpacked size: %s" % archive.unpacked_size
print "Compression ratio: %s" % (archive.packed_size/archive.unpacked_size)

View File

@@ -1,322 +0,0 @@
"""wrapper for libmpq"""
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import ctypes
import ctypes.util
import os
libmpq = ctypes.CDLL(ctypes.util.find_library("mpq"))
class Error(Exception):
pass
errors = {
-1: (IOError, "open"),
-2: (IOError, "close"),
-3: (IOError, "seek"),
-4: (IOError, "read"),
-5: (IOError, "write"),
-6: (MemoryError,),
-7: (Error, "file is not an mpq or is corrupted"),
-8: (AssertionError, "not initialized"),
-9: (AssertionError, "buffer size too small"),
-10: (IndexError, "file not in archive"),
-11: (AssertionError, "decrypt"),
-12: (AssertionError, "unpack"),
}
def check_error(result, func, arguments, errors=errors):
try:
error = errors[result]
except KeyError:
return result
else:
raise error[0](*error[1:])
libmpq.libmpq__version.restype = ctypes.c_char_p
libmpq.libmpq__archive_open.errcheck = check_error
libmpq.libmpq__archive_close.errcheck = check_error
libmpq.libmpq__archive_packed_size.errcheck = check_error
libmpq.libmpq__archive_unpacked_size.errcheck = check_error
libmpq.libmpq__archive_offset.errcheck = check_error
libmpq.libmpq__archive_version.errcheck = check_error
libmpq.libmpq__archive_files.errcheck = check_error
libmpq.libmpq__file_packed_size.errcheck = check_error
libmpq.libmpq__file_unpacked_size.errcheck = check_error
libmpq.libmpq__file_offset.errcheck = check_error
libmpq.libmpq__file_blocks.errcheck = check_error
libmpq.libmpq__file_encrypted.errcheck = check_error
libmpq.libmpq__file_compressed.errcheck = check_error
libmpq.libmpq__file_imploded.errcheck = check_error
libmpq.libmpq__file_number.errcheck = check_error
libmpq.libmpq__file_read.errcheck = check_error
libmpq.libmpq__block_open_offset.errcheck = check_error
libmpq.libmpq__block_close_offset.errcheck = check_error
libmpq.libmpq__block_unpacked_size.errcheck = check_error
libmpq.libmpq__block_read.errcheck = check_error
__version__ = libmpq.libmpq__version()
class Reader(object):
def __init__(self, file, libmpq=libmpq):
self._file = file
self._pos = 0
self._buf = []
self._cur_block = 0
libmpq.libmpq__block_open_offset(self._file._archive._mpq,
self._file.number)
def __iter__(self):
return self
def __repr__(self):
return "iter(%r)" % self._file
def seek(self, offset, whence=os.SEEK_SET, os=os):
if whence == os.SEEK_SET:
pass
elif whence == os.SEEK_CUR:
offset += self._pos
elif whence == os.SEEK_END:
offset += self._file.unpacked_size
else:
raise ValueError, "invalid whence"
if offset >= self._pos:
self.read(offset - self._pos)
else:
self._pos = 0
self._buf = []
self._cur_block = 0
self.read(offset)
def tell(self):
return self._pos
def _read_block(self, ctypes=ctypes, libmpq=libmpq):
block_size = ctypes.c_uint64()
libmpq.libmpq__block_unpacked_size(self._file._archive._mpq,
self._file.number, self._cur_block, ctypes.byref(block_size))
block_data = ctypes.create_string_buffer(block_size.value)
libmpq.libmpq__block_read(self._file._archive._mpq,
self._file.number, self._cur_block,
block_data, ctypes.c_uint64(len(block_data)), None)
self._buf.append(block_data.raw)
self._cur_block += 1
def read(self, size=-1):
while size < 0 or sum(map(len, self._buf)) < size:
if self._cur_block == self._file.blocks:
break
self._read_block()
buf = "".join(self._buf)
if size < 0:
ret = buf
self._buf = []
else:
ret = buf[:size]
self._buf = [buf[size:]]
self._pos += len(ret)
return ret
def readline(self, os=os):
line = []
while True:
char = self.read(1)
if char == "":
break
if char not in '\r\n' and line and line[-1] in '\r\n':
self.seek(-1, os.SEEK_CUR)
break
line.append(char)
return ''.join(line)
def next(self):
line = self.readline()
if not line:
raise StopIteration
return line
def readlines(self, sizehint=-1):
res = []
while sizehint < 0 or sum(map(len, res)) < sizehint:
line = self.readline()
if not line:
break
res.append(line)
return res
xreadlines = __iter__
def __del__(self, libmpq=libmpq):
libmpq.libmpq__block_close_offset(self._file._archive._mpq,
self._file.number)
class File(object):
def __init__(self, archive, number, ctypes=ctypes, libmpq=libmpq):
self._archive = archive
self.number = number
for name, atype in [
("packed_size", ctypes.c_uint64),
("unpacked_size", ctypes.c_uint64),
("offset", ctypes.c_uint64),
("blocks", ctypes.c_uint32),
("encrypted", ctypes.c_uint32),
("compressed", ctypes.c_uint32),
("imploded", ctypes.c_uint32),
]:
data = atype()
func = getattr(libmpq, "libmpq__file_"+name)
func(self._archive._mpq, self.number, ctypes.byref(data))
setattr(self, name, data.value)
def __str__(self, ctypes=ctypes, libmpq=libmpq):
data = ctypes.create_string_buffer(self.unpacked_size)
libmpq.libmpq__file_read(self._archive._mpq, self.number,
data, ctypes.c_uint64(len(data)), None)
return data.raw
def __repr__(self):
return "%r[%i]" % (self._archive, self.number)
def __iter__(self, Reader=Reader):
return Reader(self)
class Archive(object):
def __init__(self, source, ctypes=ctypes, File=File, libmpq=libmpq):
self._source = source
if isinstance(source, File):
assert not source.encrypted
assert not source.compressed
assert not source.imploded
self.filename = source._archive.filename
offset = source._archive.offset + source.offset
else:
self.filename = source
offset = -1
self._mpq = ctypes.c_void_p()
libmpq.libmpq__archive_open(ctypes.byref(self._mpq), self.filename,
ctypes.c_uint64(offset))
self._opened = True
for field_name, field_type in [
("packed_size", ctypes.c_uint64),
("unpacked_size", ctypes.c_uint64),
("offset", ctypes.c_uint64),
("version", ctypes.c_uint32),
("files", ctypes.c_uint32),
]:
func = getattr(libmpq, "libmpq__archive_" + field_name)
data = field_type()
func(self._mpq, ctypes.byref(data))
setattr(self, field_name, data.value)
def __del__(self, libmpq=libmpq):
if getattr(self, "_opened", False):
libmpq.libmpq__archive_close(self._mpq)
def __len__(self):
return self.files
def __contains__(self, item, ctypes=ctypes, libmpq=libmpq):
if isinstance(item, str):
data = ctypes.c_uint32()
try:
libmpq.libmpq__file_number(self._mpq, ctypes.c_char_p(item),
ctypes.byref(data))
except IndexError:
return False
return True
return 0 <= item < self.files
def __getitem__(self, item, ctypes=ctypes, File=File, libmpq=libmpq):
if isinstance(item, str):
data = ctypes.c_int()
libmpq.libmpq__file_number(self._mpq, ctypes.c_char_p(item),
ctypes.byref(data))
item = data.value
else:
if not 0 <= item < self.files:
raise IndexError, "file not in archive"
return File(self, item)
def __repr__(self):
return "mpq.Archive(%r)" % self._source
# Remove clutter - everything except Error and Archive.
del os, check_error, ctypes, errors, File, libmpq, Reader
if __name__ == "__main__":
import sys, random
archive = Archive(sys.argv[1])
print repr(archive)
for k, v in archive.__dict__.iteritems():
#if k[0] == '_': continue
print " " * (4 - 1), k, v
assert '(listfile)' in archive
assert 0 in archive
assert len(archive) == archive.files
files = [x.strip() for x in archive['(listfile)']]
files.extend(xrange(archive.files))
for key in files: #sys.argv[2:] if sys.argv[2:] else xrange(archive.files):
file = archive[key]
print
print " " * (4 - 1), repr(file)
for k, v in file.__dict__.iteritems():
#if k[0] == '_': continue
print " " * (8 - 1), k, v
a = str(file)
b = iter(file).read()
reader = iter(file)
c = []
while True:
l = random.randrange(1, 10)
d = reader.read(l)
if not d: break
assert len(d) <= l
c.append(d)
c = "".join(c)
d = []
reader.seek(0)
for line in reader:
d.append(line)
d = "".join(d)
assert a == b == c == d, map(hash, [a,b,c,d])
assert len(a) == file.unpacked_size
repr(iter(file))
reader.seek(0)
a = reader.readlines()
reader.seek(0)
b = list(reader)
assert a == b

View File

@@ -1,84 +0,0 @@
# the autoconf initilization.
AC_INIT(libmpq, 0.4.2, [mbroemme@plusserver.de], [libmpq])
# detect the canonical host and target build environment.
AC_CANONICAL_SYSTEM
# initialize autoconf and automake system.
AM_INIT_AUTOMAKE([no-dependencies])
AC_CONFIG_HEADERS([config.h:config.h.in])
# notices.
AC_PREREQ(2.53)
AC_REVISION($Revision: 1.6 $)
# checking for programs.
AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
AC_PROG_CC
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
# check if we need to export some largefile flags.
if test "$enable_largefile" != no; then
if test "$ac_cv_sys_file_offset_bits" != 'no'; then
if test -z "$LFS_CFLAGS" ; then
LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
else
LFS_CFLAGS="$LFS_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
fi
fi
if test "$ac_cv_sys_large_files" != 'no'; then
if test -z "$LFS_CFLAGS" ; then
LFS_CFLAGS="-D_LARGE_FILES=1"
else
LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES=1"
fi
fi
if test "$ac_cv_sys_largefile_source" != 'no'; then
if test -z "$LFS_CFLAGS" ; then
LFS_CFLAGS="-D_LARGEFILE_SOURCE=1"
else
LFS_CFLAGS="$LFS_CFLAGS -D_LARGEFILE_SOURCE=1"
fi
fi
fi
# export largefile flags.
AC_SUBST(LFS_CFLAGS)
# check for zlib library.
AC_CHECK_HEADER([zlib.h], [], [AC_MSG_ERROR([*** zlib.h is required, install zlib header files])])
AC_CHECK_LIB([z], [inflateEnd], [], [AC_MSG_ERROR([*** inflateEnd is required, install zlib library files])])
# check for bzlib2 library.
AC_CHECK_HEADER([bzlib.h], [], [AC_MSG_ERROR([*** bzlib.h is required, install bzip2 header files])])
AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit], [], [AC_MSG_ERROR([*** BZ2_bzDecompressInit is required, install bzip2 library files])])
# When we're running gcc 4 or greater, compile with -fvisibility=hidden.
AC_TRY_COMPILE([
#if !defined(__GNUC__) || (__GNUC__ < 4)
#error not gcc4
#endif
], [], [CFLAGS="$CFLAGS -fvisibility=hidden"])
# find python for binding
AM_PATH_PYTHON([2.4],,[:])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
# configuration files.
AC_CONFIG_FILES([libmpq.pc])
AC_CONFIG_FILES([libmpq-config],[chmod +x libmpq-config])
# creating files.
AC_OUTPUT([
Makefile
libmpq/Makefile
bindings/Makefile
bindings/d/Makefile
bindings/python/Makefile
doc/Makefile
doc/man1/Makefile
doc/man3/Makefile
tools/Makefile
])

View File

@@ -1,35 +0,0 @@
libmpq (0.4.2-svn288-1) unstable; urgency=low
[ babyface ]
* Due to the nature of MPQ archives which can have valid block entries
* removed function libmpq__init() and libmpq__shutdown(), because they
are no longer required and libmpq__file_name(), because it is up to
the application to provide listfile support
* updated documentation to latest API changes
* removed API documentation for removed function prototypes
* removed no longer required files from target
[ forrestv ]
* mpq.py fix
* spelling - huffmann to huffman
* changed pkware/pkzip to pkzip and used constants instead of numbers
in extract.c
* sanified huffman decoder a bit
* cleanup + update of mpq.py
* Added support for library finding on platforms besides Linux.
* python bindings - sequence methods on Archive, example code
[ georg ]
* libmpq: file number search now continued over hashtable end
* debian debug package
-- Georg Lukas <georg@op-co.de> Fri, 22 May 2009 22:38:26 +0200
libmpq (0.4.2-svn270-1) unstable; urgency=low
* First debian package
* compatible to new libmpq API (post 0.4.2)
* contains preliminary python-mpq package
-- Georg Lukas <georg@op-co.de> Tue, 07 Oct 2008 14:38:58 +0200

View File

@@ -1 +0,0 @@
7

View File

@@ -1,50 +0,0 @@
Source: libmpq
Priority: extra
Maintainer: Georg Lukas <georg@op-co.de>
Build-Depends: debhelper (>= 7), autotools-dev, libbz2-dev
Standards-Version: 3.7.3
Section: libs
Homepage: https://libmpq.org/
Package: libmpq-dev
Section: libdevel
Architecture: any
Depends: libmpq0 (= ${binary:Version})
Description: Headers for libmpq, a library for MoPaQ mpq archives
libmpq is a library for extracting and manipulating MoPaQ mpq archives.
This package provides header files and bindings for applications using
the libmpq library for the following languages:
* C
* Python
* D
Package: libmpq0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: A library for extracting and manipulating MoPaQ mpq archives
MPQ, or MoPaQ, is a proprietary archive format created by
Mike O'Brien, the man hailed as Blizzard's multiplayer engine
genius, back in 1996 as a general purpose archive for use with
Diablo, and named narcissistically for its creator
"Mike O'brien PaCK". The copyrights to it, however, are held by
Havas Interactive, Blizzard's parent company. The archive format
is used by many Blizzard titles like Diablo, Diablo 2, Starcraft,
Warcraft 2: BNE, a newer version in Warcraft 3 and World of
Warcraft (WoW).
Package: libmpq0-dbg
Section: libdevel
Architecture: any
Depends: libmpq0 (= ${binary:Version})
Description: Debug symbols for libmpq0 library package
Package: python-mpq
Architecture: all
Depends: ${python:Depends}
XB-Python-Version: ${python:Versions}
XS-Python-Version: current
Description: Python bindings for libmpq, a library for MoPaQ mpq archives
libmpq is a library for extracting and manipulating MoPaQ mpq archives.
This package provides the python bindings for libmpq.

View File

@@ -1,23 +0,0 @@
This package was debianized by Georg Lukas <georg@op-co.de> on
Fri, 04 Jul 2008 18:17:08 +0200.
It was downloaded from <https://libmpq.org/>
Upstream Author:
Maik Broemme <mbroemme@plusserver.de>
Copyright:
Copyright (C) 2008 Maik Broemme
License:
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
The Debian packaging is (C) 2008, Georg Lukas <georg@op-co.de> and
is licensed under the GPL, see `/usr/share/common-licenses/GPL'.

View File

@@ -1,6 +0,0 @@
usr/bin
usr/lib
usr/lib/pkgconfig
usr/include
usr/share/man/man1
usr/share/man/man3

View File

@@ -1,6 +0,0 @@
usr/bin/*
usr/include/*
usr/lib/lib*.a
usr/lib/pkgconfig/*
usr/lib/*.la
usr/share/man/man?/*

View File

@@ -1 +0,0 @@
usr/lib

View File

@@ -1,6 +0,0 @@
FAQ
NEWS
README
TODO
THANKS
AUTHORS

View File

@@ -1 +0,0 @@
usr/lib/lib*.so*

View File

@@ -1 +0,0 @@
usr/lib/python?.?

View File

@@ -1,112 +0,0 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
else
CROSS= --build $(DEB_BUILD_GNU_TYPE)
endif
# shared library versions, option 1
version=2.0.5
major=2
# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
#version=`ls src/.libs/lib*.so.* | \
# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
#major=`ls src/.libs/lib*.so.* | \
# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
config.status: configure
dh_testdir
# Add here commands to configure the package.
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
cp -f /usr/share/misc/config.guess config.guess
endif
./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"
build: build-stamp
build-stamp: config.status
dh_testdir
# Add here commands to compile the package.
$(MAKE)
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
[ ! -f Makefile ] || $(MAKE) distclean
rm -f config.sub config.guess
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/tmp
$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
# Build architecture-independent files here.
binary-indep: build install
dh_pysupport usr/lib/python?.?/site-packages
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_install
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
# dh_installcron
# dh_installinfo
dh_installman
dh_link
dh_strip --dbg-package=libmpq0-dbg
dh_compress
dh_fixperms
# dh_perl
dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

View File

@@ -1,5 +0,0 @@
# minimum required automake 1.6
AUTOMAKE_OPTIONS = 1.6
# any directories which should be built and installed.
SUBDIRS = man1 man3

View File

@@ -1,9 +0,0 @@
# minimum required automake 1.6
AUTOMAKE_OPTIONS = 1.6
# manual page directory.
EXTRA_DIST = $(man_MANS)
# manual pages for the installed binaries.
man_MANS = \
libmpq-config.1

View File

@@ -1,69 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 1 2008-02-10 "The MoPaQ archive library"
.SH NAME
libmpq-config \- script to get information about the installed version of libmpq.
.SH SYNOPSIS
.B libmpq-config
[\-\-prefix\fI[=DIR]\fP] [\-\-exec\-prefix\fI[=DIR]\fP] [\-\-version]
.br
[\-\-cflags] [\-\-libs] [\-\-static\-libs]
.SH DESCRIPTION
.PP
\fIlibmpq-config\fP is a tool that is used to determine the compiler and linker flags that should be used to compile and link programs that use \fIlibmpq\fP. Finally, it's also used internally by the .m4 macros for GNU autoconf that are included with \fIlibmpq\fP.
.SH OPTIONS
\fIlibmpq-config\fP accepts the following options:
.TP 8
.B \-\-version
.ti 15
Print the currently installed version of \fIlibmpq\fP on the standard output.
.TP 8
.B \-\-libs
.ti 15
Print the linker flags that are necessary to link \fIlibmpq\fP to a program.
.TP 8
.B \-\-static\-libs
.ti 15
Print the linker flags that are necessary to statically link \fIlibmpq\fP to a program.
.TP 8
.B \-\-cflags
.ti 15
Print the compiler flags that are necessary to compile a program that use \fIlibmpq\fP.
.TP 8
.B \-\-prefix=PREFIX
.ti 15
If specified, use PREFIX instead of the installation prefix that \fIlibmpq\fP was built with when computing the output for the \-\-cflags and \-\-libs options. This option is also used for the exec prefix if \-\-exec\-prefix was not specified. This option must be specified before any \-\-libs or \-\-cflags options.
.TP 8
.B \-\-exec\-prefix=PREFIX
.ti 15
If specified, use PREFIX instead of the installation exec prefix that \fIlibmpq\fP was built with when computing the output for the \-\-cflags and \-\-libs options. This option must be specified before any \-\-libs or \-\-cflags options.
.SH NOTE
Instead of using this configuration script you should better use the pkg-config version because this would be more platform independent and makes the usage within GNU autoconf much easier.
.SH SEE ALSO
\fBlibmpq\fR(3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,30 +0,0 @@
# minimum required automake 1.6
AUTOMAKE_OPTIONS = 1.6
# manual page directory.
EXTRA_DIST = $(man_MANS)
# manual pages for the installed binaries.
man_MANS = \
libmpq.3 \
libmpq__archive_close.3 \
libmpq__archive_files.3 \
libmpq__archive_offset.3 \
libmpq__archive_open.3 \
libmpq__archive_packed_size.3 \
libmpq__archive_unpacked_size.3 \
libmpq__archive_version.3 \
libmpq__block_close_offset.3 \
libmpq__block_open_offset.3 \
libmpq__block_read.3 \
libmpq__block_unpacked_size.3 \
libmpq__file_blocks.3 \
libmpq__file_compressed.3 \
libmpq__file_encrypted.3 \
libmpq__file_imploded.3 \
libmpq__file_number.3 \
libmpq__file_offset.3 \
libmpq__file_packed_size.3 \
libmpq__file_read.3 \
libmpq__file_unpacked_size.3 \
libmpq__version.3

View File

@@ -1,204 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-04-29 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "const char *libmpq__version();"
.sp
.BI "int32_t libmpq__archive_open("
.BI " mpq_archive_s **" "mpq_archive",
.BI " const char *" "mpq_filename",
.BI " off_t " "archive_offset"
.BI ");"
.sp
.BI "int32_t libmpq__archive_close("
.BI " mpq_archive_s *" "mpq_archive"
.BI ");"
.sp
.BI "int32_t libmpq__archive_packed_size("
.BI " mpq_archive_s *" "mpq_archive",
.BI " off_t *" "packed_size"
.BI ");"
.sp
.BI "int32_t libmpq__archive_unpacked_size("
.BI " mpq_archive_s *" "mpq_archive",
.BI " off_t *" "unpacked_size"
.BI ");"
.sp
.BI "int32_t libmpq__archive_offset("
.BI " mpq_archive_s *" "mpq_archive",
.BI " off_t *" "offset"
.BI ");"
.sp
.BI "int32_t libmpq__archive_version("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t *" "version"
.BI ");"
.sp
.BI "int32_t libmpq__archive_files("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t *" "files"
.BI ");"
.sp
.BI "int32_t libmpq__file_packed_size("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " off_t *" "packed_size"
.BI ");"
.sp
.BI "int32_t libmpq__file_unpacked_size("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " off_t *" "unpacked_size"
.BI ");"
.sp
.BI "int32_t libmpq__file_offset("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " off_t *" "offset"
.BI ");"
.sp
.BI "int32_t libmpq__file_blocks("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " off_t *" "blocks"
.BI ");"
.sp
.BI "int32_t libmpq__file_encrypted("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " off_t *" "encrypted"
.BI ");"
.sp
.BI "int32_t libmpq__file_compressed("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " off_t *" "compressed"
.BI ");"
.sp
.BI "int32_t libmpq__file_imploded("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " off_t *" "imploded"
.BI ");"
.sp
.BI "int32_t libmpq__file_number("
.BI " mpq_archive_s *" "mpq_archive",
.BI " const char *" "filename",
.BI " uint32_t *" "number"
.BI ");"
.sp
.BI "int32_t libmpq__file_read("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " uint8_t *" "out_buf",
.BI " off_t " "out_size",
.BI " off_t *" "transferred"
.BI ");"
.sp
.BI "int32_t libmpq__block_open_offset("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number"
.BI ");"
.sp
.BI "int32_t libmpq__block_close_offset("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number"
.BI ");"
.sp
.BI "int32_t libmpq__block_packed_size("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " uint32_t " "block_number",
.BI " off_t *" "packed_size"
.BI ");"
.sp
.BI "int32_t libmpq__block_unpacked_size("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " uint32_t " "block_number",
.BI " off_t *" "unpacked_size"
.BI ");"
.sp
.BI "int32_t libmpq__block_offset("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " uint32_t " "block_number",
.BI " off_t *" "offset"
.BI ");"
.sp
.BI "int32_t libmpq__block_seed("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " uint32_t " "block_number",
.BI " uint32_t *" "seed"
.BI ");"
.sp
.BI "int32_t libmpq__block_read("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " uint32_t " "block_number",
.BI " uint8_t *" "out_buf",
.BI " off_t " "out_size",
.BI " off_t *" "transferred"
.BI ");"
.fi
.SH DESCRIPTION
.PP
The \fIlibmpq\fP library supports decrypting, decompressing, exploding and various manipulations of the MoPaQ archive files. It uses \fIzlib(3)\fP and \fIbzip2(1)\fP compression library. At this moment \fIlibmpq\fP is not able to create MoPaQ archives, this limitation will be removed in a future version.
.SH SEE ALSO
.BR libmpq__version (3),
.BR libmpq__archive_open (3),
.BR libmpq__archive_close (3),
.BR libmpq__archive_packed_size (3),
.BR libmpq__archive_unpacked_size (3),
.BR libmpq__archive_offset (3),
.BR libmpq__archive_version (3),
.BR libmpq__archive_files (3),
.BR libmpq__file_packed_size (3),
.BR libmpq__file_unpacked_size (3),
.BR libmpq__file_offset (3),
.BR libmpq__file_blocks (3),
.BR libmpq__file_encrypted (3),
.BR libmpq__file_compressed (3),
.BR libmpq__file_imploded (3),
.BR libmpq__file_number (3),
.BR libmpq__file_read (3),
.BR libmpq__block_open_offset (3),
.BR libmpq__block_close_offset (3),
.BR libmpq__block_packed_size (3),
.BR libmpq__block_unpacked_size (3),
.BR libmpq__block_offset (3),
.BR libmpq__block_seed (3),
.BR libmpq__block_read (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,57 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-04-29 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__archive_close("
.BI " mpq_archive_s *" "mpq_archive"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__archive_close\fP() to close a mpq archive which was opened by \fBlibmpq__archive_open\fP(). The function frees the archive structure itself and the contents of it.
.LP
The \fBlibmpq__archive_close\fP() function one takes one argument of the archive structure \fImpq_archive\fP which has to be set by \fBlibmpq__archive_open\fP.
.SH RETURN VALUE
On success, a zero is returned and on error one of the following constants.
.TP
.B LIBMPQ_ERROR_CLOSE
The given file could not be closed.
.SH SEE ALSO
.BR libmpq__archive_open (3),
.BR libmpq__archive_packed_size (3),
.BR libmpq__archive_unpacked_size (3),
.BR libmpq__archive_offset (3),
.BR libmpq__archive_version (3),
.BR libmpq__archive_files (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,50 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-14 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__archive_files("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t *" "files"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__archive_files\fP() to get the number of files inside the archive. It will count only valid files and skip files which have deleted or freed hash entries.
.LP
The \fBlibmpq__archive_files\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument is a reference to the number of \fIfiles\fP in the archive.
.SH RETURN VALUE
On success, a zero is returned.
.SH SEE ALSO
.BR libmpq__file_blocks (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,51 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-14 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__archive_offset("
.BI " mpq_archive_s *" "mpq_archive",
.BI " off_t *" "offset"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__archive_offset\fP() to get the offset of the archive, which is the absolute position in the file. It also supports archives within archives.
.LP
The \fBlibmpq__archive_offset\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument is a reference to the archive starting position \fIoffset\fP in file.
.SH RETURN VALUE
On success, a zero is returned.
.SH SEE ALSO
.BR libmpq__file_offset (3),
.BR libmpq__block_offset (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,71 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-04-29 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__archive_open("
.BI " mpq_archive_s **" "mpq_archive",
.BI " const char *" "mpq_filename",
.BI " off_t " "archive_offset"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__archive_open\fP() to open a given mpq archive for later use to extract or manipulate files inside the archive. It will create all required file structures and you have to call \fBlibmpq__archive_close\fP() on success to clean the opened structures. On failure there is no need to call \fBlibmpq__archive_close\fP() because everything will be cleaned up.
.LP
The \fBlibmpq__archive_open\fP() function takes as first argument a reference to the archive structure \fImpq_archive\fP and will open the file \fImpq_filename\fP to the structure pointed to by \fImpq_archive\fP. The last argument, \fIarchive_offset\fP is normally -1, but can be specified when the archive offset is known, or not 512-byte aligned.
.SH RETURN VALUE
On success, *\fImpq_archive\fP is set to a new \fBmpq_archive_s\fP* and zero is returned, and on error one of the following constants is returned.
.TP
.B LIBMPQ_ERROR_OPEN
The given file could not be opened.
.TP
.B LIBMPQ_ERROR_MALLOC
Not enough memory for creating required structures.
.TP
.B LIBMPQ_ERROR_SEEK
Seeking in file failed.
.TP
.B LIBMPQ_ERROR_FORMAT
The given file is no valid mpq archive.
.TP
.B LIBMPQ_ERROR_READ
Reading in archive failed.
.SH SEE ALSO
.BR libmpq__archive_close (3),
.BR libmpq__archive_packed_size (3),
.BR libmpq__archive_unpacked_size (3),
.BR libmpq__archive_offset (3),
.BR libmpq__archive_version (3),
.BR libmpq__archive_files (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,51 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-04-29 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__archive_packed_size("
.BI " mpq_archive_s *" "mpq_archive",
.BI " off_t *" "packed_size"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__archive_packed_size\fP() to get the packed size of all files in the archive. It will count compressed and imploded files as well as stored only.
.LP
The \fBlibmpq__archive_packed_size\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument is a reference to the compressed, imploded or stored size \fIpacked_size\fP of file.
.SH RETURN VALUE
On success, a zero is returned.
.SH SEE ALSO
.BR libmpq__file_packed_size (3),
.BR libmpq__block_packed_size (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,51 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-04-29 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__archive_unpacked_size("
.BI " mpq_archive_s *" "mpq_archive",
.BI " off_t *" "unpacked_size"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__archive_unpacked_size\fP() to get the unpacked size of all files in the archive. It will count uncompressed and exploded files as well as stored only.
.LP
The \fBlibmpq__archive_unpacked_size\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument is a reference to the uncompressed, exploded or stored size \fIunpacked_size\fP of file.
.SH RETURN VALUE
On success, a zero is returned.
.SH SEE ALSO
.BR libmpq__file_unpacked_size (3),
.BR libmpq__block_unpacked_size (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,48 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-14 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__archive_version("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t *" "version"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__archive_version\fP() to get the archive version. Currently there exist two known versions, version 1 which supports archives until 2GB total size and version 2 which supports archives above 2GB total size and both are supported.
.LP
The \fBlibmpq__archive_version\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument is a reference to the \fIversion\fP of archive.
.SH RETURN VALUE
On success, a zero is returned.
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,53 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-16 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__block_close_offset("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__block_close_offset\fP() to close the block offset table for the given file. It will close the block offset table regardless of compression (compressed, imploded or stored) type of file.
.LP
The \fBlibmpq__block_close_offset\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file to close.
.SH RETURN VALUE
On success, a zero is returned and on error one of the following constants.
.TP
.B LIBMPQ_ERROR_EXIST
File or block does not exist in archive.
.SH SEE ALSO
.BR libmpq__block_open_offset (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,65 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-16 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__block_open_offset("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__block_open_offset\fP() to open the block offset table for the given file. It will open the block offset table regardless of compression (compressed, imploded or stored) type of file.
.LP
The \fBlibmpq__block_open_offset\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file to open.
.SH RETURN VALUE
On success, a zero is returned and on error one of the following constants.
.TP
.B LIBMPQ_ERROR_EXIST
File or block does not exist in archive.
.TP
.B LIBMPQ_ERROR_SEEK
Seeking in file failed.
.TP
.B LIBMPQ_ERROR_MALLOC
Not enough memory for creating required structures.
.TP
.B LIBMPQ_ERROR_READ
Reading in archive failed.
.TP
.B LIBMPQ_ERROR_DECRYPT
Decrypting block failed.
.SH SEE ALSO
.BR libmpq__block_close_offset (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,78 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-16 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__block_read("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " uint32_t " "block_number,
.BI " uint8_t *" "out_buf",
.BI " off_t " "out_size",
.BI " off_t " "transferred"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__block_read\fP() to read a given block into memory. If the block is encrypted it will be first decrypted and then if it is packed (compressed or imploded) it will be unpacked.
.LP
The \fBlibmpq__block_read\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file, the third argument \fIblock_number\fP is the number of block. The fourth argument \fIout_buf\fP is the output data buffer which contains the extracted data and the fifth argument \fIout_size\fP is the size of \fIout_buf\fP. The sixth argument is a reference to the \fItransferred\fP bytes of the file.
.SH RETURN VALUE
On success, a zero is returned and on error one of the following constants.
.TP
.B LIBMPQ_ERROR_EXIST
Block does not exist in archive.
.TP
.B LIBMPQ_ERROR_OPEN
Block offset table was not opened by calling \fBlibmpq__block_open_offset\fP(), or it was closed by an \fBlibmpq__block_close_offset\fP() call.
.TP
.B LIBMPQ_ERROR_SIZE
The output buffer is to small.
.TP
.B LIBMPQ_ERROR_SEEK
Seeking in file failed.
.TP
.B LIBMPQ_ERROR_MALLOC
Not enough memory for creating required structures.
.TP
.B LIBMPQ_ERROR_READ
Reading in archive failed.
.TP
.B LIBMPQ_ERROR_DECRYPT
Decrypting block failed.
.TP
.B LIBMPQ_ERROR_UNPACK
Unpacking block failed.
.SH SEE ALSO
.BR libmpq__file_read (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,59 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-16 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__block_unpacked_size("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " uint32_t " "block_number",
.BI " off_t *" "unpacked_size"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__block_unpacked_size\fP() to get the unpacked size of a given block in the file. It will return a valid size for compressed and imploded blocks as well as stored only.
.LP
The \fBlibmpq__block_unpacked_size\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file, the third argument \fIblock_number\fP is the number of block and the fourth argument is a reference to the uncompressed, exploded or stored size \fIunpacked_size\fP of block.
.SH RETURN VALUE
On success, a zero is returned and on error one of the following constants.
.TP
.B LIBMPQ_ERROR_EXIST
File or block does not exist in archive.
.TP
.B LIBMPQ_ERROR_OPEN
Block offset table was not opened by calling \fBlibmpq__block_open_offset\fP(), or it was closed by an \fBlibmpq__block_close_offset\fP() call.
.SH SEE ALSO
.BR libmpq__archive_unpacked_size (3),
.BR libmpq__file_unpacked_size (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,54 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-16 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__file_blocks("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " uint32_t *" "blocks"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__file_blocks\fP() to get the number of blocks for a given file. It will count all blocks for files stored in multiple sectors or count one for files stored in single sector.
.LP
The \fBlibmpq__file_blocks\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the number of \fIblocks\fP of the file.
.SH RETURN VALUE
On success, a zero is returned and on error one of the following constants.
.TP
.B LIBMPQ_ERROR_EXIST
File does not exist in archive.
.SH SEE ALSO
.BR libmpq__archive_files (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,54 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-16 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__file_compressed("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " uint32_t *" "compressed"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__file_compressed\fP() to get the compression status of the given file. It will return true for compressed files and false otherwise.
.LP
The \fBlibmpq__file_compressed\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the compression status \fIcompressed\fP of the file.
.SH RETURN VALUE
On success, a zero is returned and on error one of the following constants.
.TP
.B LIBMPQ_ERROR_EXIST
File does not exist in archive.
.SH SEE ALSO
.BR libmpq__archive_files (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,54 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-16 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__file_encrypted("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " uint32_t *" "encrypted"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__file_encrypted\fP() to get the encryption status of the given file. It will return true for encrypted files and false otherwise.
.LP
The \fBlibmpq__file_encrypted\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the encryption status \fIencrypted\fP of the file.
.SH RETURN VALUE
On success, a zero is returned and on error one of the following constants.
.TP
.B LIBMPQ_ERROR_EXIST
File does not exist in archive.
.SH SEE ALSO
.BR libmpq__archive_files (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,54 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-16 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__file_imploded("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " uint32_t *" "imploded"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__file_imploded\fP() to get the implosion status of the given file. It will return true for imploded files and false otherwise.
.LP
The \fBlibmpq__file_imploded\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the implosion status \fIimploded\fP of the file.
.SH RETURN VALUE
On success, a zero is returned and on error one of the following constants.
.TP
.B LIBMPQ_ERROR_EXIST
File does not exist in archive.
.SH SEE ALSO
.BR libmpq__archive_files (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,52 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-16 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__file_number("
.BI " mpq_archive_s *" "mpq_archive",
.BI " const char *" "filename",
.BI " uint32_t *" "number"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__file_number\fP() to get the number of a given file in the archive. This function will return a file number regardless of a known or opened listfile.
.LP
The \fBlibmpq__file_number\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfilename\fP is the name of the file and the third argument is a reference to the \fInumber\fP of the file.
.SH RETURN VALUE
On success, the number of the file is returned and on error one of the following constants.
.TP
.B LIBMPQ_ERROR_EXIST
File does not exist in archive.
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,55 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-15 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__file_offset("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " off_t *" "offset"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__file_offset\fP() to get the offset of the file, which is the absolute position in the archive. It also supports archives within archives.
.LP
The \fBlibmpq__file_offset\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the file starting position \fIoffset\fP in archive.
.SH RETURN VALUE
On success, a zero is returned and on error one of the following constants.
.TP
.B LIBMPQ_ERROR_EXIST
File does not exist in archive.
.SH SEE ALSO
.BR libmpq__archive_offset (3),
.BR libmpq__block_offset (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,55 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-15 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__file_packed_size("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " off_t *" "packed_size"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__file_packed_size\fP() to get the packed size of a given file in the archive. It will return a valid size for compressed and imploded files as well as stored only.
.LP
The \fBlibmpq__file_packed_size\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the compressed, imploded or stored size \fIpacked_size\fP of file.
.SH RETURN VALUE
On success, a zero is returned and on error one of the following constants.
.TP
.B LIBMPQ_ERROR_EXIST
File does not exist in archive.
.SH SEE ALSO
.BR libmpq__archive_packed_size (3),
.BR libmpq__block_packed_size (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,77 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-16 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__file_read("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " uint8_t *" "out_buf",
.BI " off_t " "out_size",
.BI " off_t *" "transferred"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__file_read\fP() to read a given file into memory. If the file is encrypted it will be first decrypted and then if it is packed (compressed or imploded) it will be unpacked.
.LP
The \fBlibmpq__file_read\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the file to extract, the third argument \fIout_buf\fP is the output data buffer which contains the extracted data. The fourth argument \fIout_size\fP is the size of \fIout_buf\fP and the fifth argument is a reference to the \fItransferred\fP bytes of the file.
.SH RETURN VALUE
On success, a zero is returned and on error one of the following constants.
.TP
.B LIBMPQ_ERROR_EXIST
File does not exist in archive.
.TP
.B LIBMPQ_ERROR_OPEN
Block offset table was not opened by calling \fBlibmpq__block_open_offset\fP(), or it was closed by an \fBlibmpq__block_close_offset\fP() call.
.TP
.B LIBMPQ_ERROR_SIZE
The output buffer is to small.
.TP
.B LIBMPQ_ERROR_SEEK
Seeking in file failed.
.TP
.B LIBMPQ_ERROR_MALLOC
Not enough memory for creating required structures.
.TP
.B LIBMPQ_ERROR_READ
Reading in archive failed.
.TP
.B LIBMPQ_ERROR_DECRYPT
Decrypting file failed.
.TP
.B LIBMPQ_ERROR_UNPACK
Unpacking file failed.
.SH SEE ALSO
.BR libmpq__block_read (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,55 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-05-15 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "int32_t libmpq__file_unpacked_size("
.BI " mpq_archive_s *" "mpq_archive",
.BI " uint32_t " "file_number",
.BI " off_t *" "unpacked_size"
.BI ");"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__file_unpacked_size\fP() to get the unpacked size of a given file in the archive. It will return a valid size for compressed and imploded files as well as stored only.
.LP
The \fBlibmpq__file_unpacked_size\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the uncompressed, exploded or stored size \fIunpacked_size\fP of file.
.SH RETURN VALUE
On success, a zero is returned and on error one of the following constants.
.TP
.B LIBMPQ_ERROR_EXIST
File does not exist in archive.
.SH SEE ALSO
.BR libmpq__archive_unpacked_size (3),
.BR libmpq__block_unpacked_size (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,45 +0,0 @@
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual 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 General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH libmpq 3 2008-03-31 "The MoPaQ archive library"
.SH NAME
libmpq \- cross-platform C library for manipulating mpq archives.
.SH SYNOPSIS
.nf
.B
#include <mpq.h>
.sp
.BI "const char *libmpq__version();"
.fi
.SH DESCRIPTION
.PP
Call \fBlibmpq__version\fP() to get information about the version of the library, it is useful to create minimum required version verifications.
.SH RETURN VALUE
The function returns the library version.
.SH SEE ALSO
.BR libmpq (3)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.

View File

@@ -1,57 +0,0 @@
#!/bin/sh
prefix="@prefix@"
exec_prefix="@exec_prefix@"
exec_prefix_set=no
usage="\
Usage: libmpq-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]"
if test "$#" -eq "0"; then
echo "${usage}" 1>&2
exit 1
fi
while test "$#" -gt "0"; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case "$1" in
--prefix=*)
prefix="$optarg"
if test "$exec_prefix_set" = "no" ; then
exec_prefix="$optarg"
fi
;;
--prefix)
echo "$prefix"
;;
--exec-prefix=*)
exec_prefix="$optarg"
exec_prefix_set=yes
;;
--exec-prefix)
echo "$exec_prefix"
;;
--version)
echo "@VERSION@"
;;
--cflags)
largefile="@LFS_CFLAGS@"
includes=-I@includedir@/libmpq
echo "$includes $largefile"
;;
--libs)
libdirs="-L@libdir@"
echo "$libdirs -lmpq"
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done

View File

@@ -1,10 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libmpq
Description: GPL version of the libmpq library
Version: @VERSION@
Libs: -L${libdir} -lmpq
Cflags: -I${includedir}/libmpq @LFS_CFLAGS@

View File

@@ -1,23 +0,0 @@
# minimum required automake 1.6
AUTOMAKE_OPTIONS = 1.6
# library information and headers which should not be installed.
lib_LTLIBRARIES = libmpq.la
noinst_HEADERS = common.h explode.h extract.h huffman.h mpq-internal.h wave.h
# directory where the include files will be installed.
libmpq_includedir = $(includedir)/libmpq
# header files to install.
libmpq_include_HEADERS = mpq.h
libmpq_la_SOURCES = $(GENERAL_SRCS)
libmpq_la_LDFLAGS = -release $(PACKAGE_VERSION)
GENERAL_SRCS = \
common.c \
huffman.c \
extract.c \
explode.c \
mpq.c \
wave.c

View File

@@ -1,8 +0,0 @@
# minimum required automake 1.6
AUTOMAKE_OPTIONS = 1.6
# the main programs.
bin_PROGRAMS = crypt_buf_gen
# sources for crypt_buf_gen program.
crypt_buf_gen_SOURCES = crypt_buf_gen.c

View File

@@ -1,85 +0,0 @@
/*
* crypt_buf_gen.c -- tool to re-create the static decryption buffer.
*
* Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
* Copyright (c) 2008 Georg Lukas <georg@op-co.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
* Usage:
* $ make crypt_buf_gen
* $ ./crypt_buf_gen > crypt_buf.h
*
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
static uint32_t *buffer;
int32_t libmpq__buffer_init() {
buffer = malloc(sizeof(uint32_t) * 0x500);
if (!buffer)
return -1;
/* some common variables. */
uint32_t seed = 0x00100001;
uint32_t index1 = 0;
uint32_t index2 = 0;
uint32_t i;
/* initialize the decryption buffer. */
for (index1 = 0; index1 < 0x100; index1++) {
for(index2 = index1, i = 0; i < 5; i++, index2 += 0x100) {
/* some common variables. */
uint32_t temp1, temp2;
/* temporary copy. */
seed = (seed * 125 + 3) % 0x2AAAAB;
temp1 = (seed & 0xFFFF) << 0x10;
/* temporary copy. */
seed = (seed * 125 + 3) % 0x2AAAAB;
temp2 = (seed & 0xFFFF);
/* assign buffer. */
buffer[index2] = (temp1 | temp2);
}
}
/* if no error was found, return zero. */
return 0;
}
int main() {
if (libmpq__buffer_init() != 0)
perror("libmpq__buffer_init()");
int x;
printf("/* DO NOT CHANGE! this file is auto-generated by crypt_buf_gen.c */\n");
printf("static const uint32_t crypt_buf[0x500] = {\n\t");
for (x = 0; x < 0x500; x++) {
printf("0x%08x", buffer[x]);
if (x < 0x500 - 1) {
if (x % 6 == 5)
printf(",\n\t");
else
printf(", ");
}
}
printf("\n};\n");
}

View File

@@ -1,115 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>libmpq</ProjectName>
<ProjectGuid>{03AB0F44-628E-4855-99A0-C98A1EB52C50}</ProjectGuid>
<RootNamespace>libmpq</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\$(Platform)_$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\$(ProjectName)__$(Platform)_$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\$(Platform)_$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\bin\$(ProjectName)__$(Platform)_$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\; ..\..\..\..\dep\include\zlib; ..\..\..\..\dep\include\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<AdditionalLibraryDirectories>..\dep\lib\$(Platform)_$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\; ..\..\..\..\dep\include\zlib; ..\..\..\..\dep\include\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<AdditionalLibraryDirectories>..\dep\lib\$(Platform)_$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\libmpq\common.c" />
<ClCompile Include="..\..\libmpq\explode.c" />
<ClCompile Include="..\..\libmpq\extract.c" />
<ClCompile Include="..\..\libmpq\huffman.c" />
<ClCompile Include="..\..\libmpq\mpq.c" />
<ClCompile Include="..\..\libmpq\wave.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\libmpq\common.h" />
<ClInclude Include="..\..\libmpq\crypt_buf.h" />
<ClInclude Include="..\..\libmpq\explode.h" />
<ClInclude Include="..\..\libmpq\extract.h" />
<ClInclude Include="..\..\libmpq\huffman.h" />
<ClInclude Include="..\..\libmpq\mpq-internal.h" />
<ClInclude Include="..\..\libmpq\mpq.h" />
<ClInclude Include="..\..\libmpq\wave.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\win\VC100\bzip2.vcxproj">
<Project>{b96f612a-c91d-43b3-a4c3-d4294817ec6c}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\..\..\win\VC100\zlib.vcxproj">
<Project>{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,81 +0,0 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#define HAVE_FSEEKO 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `bz2' library (-lbz2). */
#define HAVE_LIBBZ2 1
/* Define to 1 if you have the `z' library (-lz). */
#define HAVE_LIBZ 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 0
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"
/* Name of package */
#define PACKAGE "libmpq"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "mbroemme@plusserver.de"
/* Define to the full name of this package. */
#define PACKAGE_NAME "libmpq"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libmpq 0.4.2"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libmpq"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "0.4.2"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "0.4.2"
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
/* #undef _LARGEFILE_SOURCE */
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */

View File

@@ -1,35 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmpq", "VC90\libmpq.vcproj", "{03AB0F44-628E-4855-99A0-C98A1EB52C50}"
ProjectSection(ProjectDependencies) = postProject
{B96F612A-C91D-43B3-A4C3-D4294817EC6C} = {B96F612A-C91D-43B3-A4C3-D4294817EC6C}
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} = {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "..\..\..\win\VC90\zlib.vcproj", "{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bzip2", "..\..\..\win\VC90\bzip2.vcproj", "{B96F612A-C91D-43B3-A4C3-D4294817EC6C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{03AB0F44-628E-4855-99A0-C98A1EB52C50}.Debug|Win32.ActiveCfg = Debug|Win32
{03AB0F44-628E-4855-99A0-C98A1EB52C50}.Debug|Win32.Build.0 = Debug|Win32
{03AB0F44-628E-4855-99A0-C98A1EB52C50}.Release|Win32.ActiveCfg = Release|Win32
{03AB0F44-628E-4855-99A0-C98A1EB52C50}.Release|Win32.Build.0 = Release|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.ActiveCfg = Debug|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.Build.0 = Debug|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.ActiveCfg = Release|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.Build.0 = Release|Win32
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.Debug|Win32.ActiveCfg = Debug|Win32
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.Debug|Win32.Build.0 = Debug|Win32
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.Release|Win32.ActiveCfg = Release|Win32
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -1,247 +0,0 @@
// ISO C9x compliant stdint.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
//
// Copyright (c) 2006-2008 Alexander Chemeris
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [
#error "Use this header only with Microsoft Visual C++ compilers!"
#endif // _MSC_VER ]
#ifndef _MSC_STDINT_H_ // [
#define _MSC_STDINT_H_
#if _MSC_VER > 1000
#pragma once
#endif
#include <limits.h>
// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
// or compiler give many errors like this:
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
#ifdef __cplusplus
extern "C" {
#endif
# include <wchar.h>
#ifdef __cplusplus
}
#endif
// Define _W64 macros to mark types changing their size, like intptr_t.
#ifndef _W64
# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
# define _W64 __w64
# else
# define _W64
# endif
#endif
// 7.18.1 Integer types
// 7.18.1.1 Exact-width integer types
// Visual Studio 6 and Embedded Visual C++ 4 doesn't
// realize that, e.g. char has the same size as __int8
// so we give up on __intX for them.
#if (_MSC_VER < 1300)
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
#else
typedef signed __int8 int8_t;
typedef signed __int16 int16_t;
typedef signed __int32 int32_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
#endif
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
// 7.18.1.2 Minimum-width integer types
typedef int8_t int_least8_t;
typedef int16_t int_least16_t;
typedef int32_t int_least32_t;
typedef int64_t int_least64_t;
typedef uint8_t uint_least8_t;
typedef uint16_t uint_least16_t;
typedef uint32_t uint_least32_t;
typedef uint64_t uint_least64_t;
// 7.18.1.3 Fastest minimum-width integer types
typedef int8_t int_fast8_t;
typedef int16_t int_fast16_t;
typedef int32_t int_fast32_t;
typedef int64_t int_fast64_t;
typedef uint8_t uint_fast8_t;
typedef uint16_t uint_fast16_t;
typedef uint32_t uint_fast32_t;
typedef uint64_t uint_fast64_t;
// 7.18.1.4 Integer types capable of holding object pointers
#ifdef _WIN64 // [
typedef signed __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
#else // _WIN64 ][
typedef _W64 signed int intptr_t;
typedef _W64 unsigned int uintptr_t;
#endif // _WIN64 ]
// 7.18.1.5 Greatest-width integer types
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;
// 7.18.2 Limits of specified-width integer types
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
// 7.18.2.1 Limits of exact-width integer types
#define INT8_MIN ((int8_t)_I8_MIN)
#define INT8_MAX _I8_MAX
#define INT16_MIN ((int16_t)_I16_MIN)
#define INT16_MAX _I16_MAX
#define INT32_MIN ((int32_t)_I32_MIN)
#define INT32_MAX _I32_MAX
#define INT64_MIN ((int64_t)_I64_MIN)
#define INT64_MAX _I64_MAX
#define UINT8_MAX _UI8_MAX
#define UINT16_MAX _UI16_MAX
#define UINT32_MAX _UI32_MAX
#define UINT64_MAX _UI64_MAX
// 7.18.2.2 Limits of minimum-width integer types
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MIN INT64_MIN
#define INT_LEAST64_MAX INT64_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
// 7.18.2.3 Limits of fastest minimum-width integer types
#define INT_FAST8_MIN INT8_MIN
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MIN INT16_MIN
#define INT_FAST16_MAX INT16_MAX
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MIN INT64_MIN
#define INT_FAST64_MAX INT64_MAX
#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT16_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
// 7.18.2.4 Limits of integer types capable of holding object pointers
#ifdef _WIN64 // [
# define INTPTR_MIN INT64_MIN
# define INTPTR_MAX INT64_MAX
# define UINTPTR_MAX UINT64_MAX
#else // _WIN64 ][
# define INTPTR_MIN INT32_MIN
# define INTPTR_MAX INT32_MAX
# define UINTPTR_MAX UINT32_MAX
#endif // _WIN64 ]
// 7.18.2.5 Limits of greatest-width integer types
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
// 7.18.3 Limits of other integer types
#ifdef _WIN64 // [
# define PTRDIFF_MIN _I64_MIN
# define PTRDIFF_MAX _I64_MAX
#else // _WIN64 ][
# define PTRDIFF_MIN _I32_MIN
# define PTRDIFF_MAX _I32_MAX
#endif // _WIN64 ]
#define SIG_ATOMIC_MIN INT_MIN
#define SIG_ATOMIC_MAX INT_MAX
#ifndef SIZE_MAX // [
# ifdef _WIN64 // [
# define SIZE_MAX _UI64_MAX
# else // _WIN64 ][
# define SIZE_MAX _UI32_MAX
# endif // _WIN64 ]
#endif // SIZE_MAX ]
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
#ifndef WCHAR_MIN // [
# define WCHAR_MIN 0
#endif // WCHAR_MIN ]
#ifndef WCHAR_MAX // [
# define WCHAR_MAX _UI16_MAX
#endif // WCHAR_MAX ]
#define WINT_MIN 0
#define WINT_MAX _UI16_MAX
#endif // __STDC_LIMIT_MACROS ]
// 7.18.4 Limits of other integer types
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
// 7.18.4.1 Macros for minimum-width integer constants
#define INT8_C(val) val##i8
#define INT16_C(val) val##i16
#define INT32_C(val) val##i32
#define INT64_C(val) val##i64
#define UINT8_C(val) val##ui8
#define UINT16_C(val) val##ui16
#define UINT32_C(val) val##ui32
#define UINT64_C(val) val##ui64
// 7.18.4.2 Macros for greatest-width integer constants
#define INTMAX_C INT64_C
#define UINTMAX_C UINT64_C
#endif // __STDC_CONSTANT_MACROS ]
#endif // _MSC_STDINT_H_ ]