From a3e08df7a6655e7baf3505edeed3a1c0dff5bbf8 Mon Sep 17 00:00:00 2001 From: pixel Date: Tue, 10 Jul 2007 09:28:10 +0000 Subject: Adding first prototypes for mpq-fs, and harmonization of the headers. --- Makefile | 1 + int-bios.h | 2 +- inttypes.h | 14 -------------- mpq-bios.h | 2 +- mpq-file.h | 10 +++++++++- mpq-fs.c | 2 ++ mpq-fs.h | 18 ++++++++++++++++++ mpq-misc.h | 2 +- 8 files changed, 33 insertions(+), 18 deletions(-) delete mode 100644 inttypes.h create mode 100644 mpq-fs.c create mode 100644 mpq-fs.h diff --git a/Makefile b/Makefile index 5d0c962..8479930 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ extract.c \ mpq-bios.c \ mpq-errors.c \ mpq-file.c \ +mpq-fs.c \ mpq-misc.c \ diff --git a/int-bios.h b/int-bios.h index c0b437b..1508218 100644 --- a/int-bios.h +++ b/int-bios.h @@ -1,7 +1,7 @@ #ifndef __INT_BIOS_H__ #define __INT_BIOS_H__ -#include "mpq-bios.h" +#include int __mpqlib_seek(struct mpq_archive_t *, uint64_t); int __mpqlib_read(struct mpq_archive_t *, void *, uint32_t); diff --git a/inttypes.h b/inttypes.h deleted file mode 100644 index 09944ee..0000000 --- a/inttypes.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __INTTYPES_H__ -#define __INTTYPES_H__ - -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; - -typedef signed char int8_t; -typedef signed short int16_t; -typedef signed int int32_t; -typedef signed long long int64_t; - -#endif diff --git a/mpq-bios.h b/mpq-bios.h index 84f64ae..3ce553e 100644 --- a/mpq-bios.h +++ b/mpq-bios.h @@ -1,7 +1,7 @@ #ifndef __MPQ_BIOS_H__ #define __MPQ_BIOS_H__ -#include "inttypes.h" +#include struct mpq_archive_t; diff --git a/mpq-file.h b/mpq-file.h index f9b17db..1cec05d 100644 --- a/mpq-file.h +++ b/mpq-file.h @@ -1,7 +1,7 @@ #ifndef __MPQ_FILE_H__ #define __MPQ_FILE_H__ -#include "inttypes.h" +#include struct mpq_file_t; @@ -11,10 +11,18 @@ enum mpqlib_file_seek_t { MPQLIB_SEEK_END, }; +#ifdef __cplusplus +extern "C" { +#endif + struct mpq_file_t * mpqlib_open_file(struct mpq_archive_t * mpq_a, int entry); struct mpq_file_t * mpqlib_open_filename(struct mpq_archive_t * mpq_a, const char * fname); void mpqlib_close(struct mpq_file_t * mpq_f); uint32_t mpqlib_read(struct mpq_file_t * mpq_f, void * buffer, uint32_t size); uint32_t mpqlib_seek(struct mpq_file_t * mpq_f, int32_t offset, enum mpqlib_file_seek_t); +#ifdef __cplusplus +} +#endif + #endif diff --git a/mpq-fs.c b/mpq-fs.c new file mode 100644 index 0000000..87901a0 --- /dev/null +++ b/mpq-fs.c @@ -0,0 +1,2 @@ +#include "mpq-fs.h" + diff --git a/mpq-fs.h b/mpq-fs.h new file mode 100644 index 0000000..9d65269 --- /dev/null +++ b/mpq-fs.h @@ -0,0 +1,18 @@ +#ifndef __MPQ_FS_H__ +#define __MPQ_FS_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void mpqlib_fs_add_archive(struct mpq_archive_t *); +void mpqlib_fs_attach_listfile(struct mpq_archive_t *, const char *); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/mpq-misc.h b/mpq-misc.h index f4fe6f2..714d6de 100644 --- a/mpq-misc.h +++ b/mpq-misc.h @@ -1,7 +1,7 @@ #ifndef __MPQ_MISC_H__ #define __MPQ_MISC_H__ -#include +#include #ifdef __cplusplus extern "C" { -- cgit v1.2.3