aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>2013-12-31 14:43:20 +0100
committerBernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>2014-01-05 00:15:37 +0100
commit18a1444b4f1e6a0948fd38fa0de382d86cfe04de (patch)
tree5fd12e10e50c4056337eea6f5f82063d7937c74f /lib
parent5fe0b41dba699fa14432a633c863ea8cb7bf3f5d (diff)
downloadandroid_external_e2fsprogs-18a1444b4f1e6a0948fd38fa0de382d86cfe04de.tar.gz
android_external_e2fsprogs-18a1444b4f1e6a0948fd38fa0de382d86cfe04de.tar.bz2
android_external_e2fsprogs-18a1444b4f1e6a0948fd38fa0de382d86cfe04de.zip
Add files that would normally be generated by the e2fsprogs build system
Android doesn't run ./configure and friends, so it has to rely on pre-populated versions of the autogenerated files. This is somewhat bogus (e.g. hardcoded little-endian reference in lib/ext2fs/ext2_types.h) and should at some point be fixed, but it's what Android has always done, not a regression from the 1.41.14 branch. Also, don't #include config.h which we don't generate (we pass what it usually contains as -D parameters from Android.mk) anywhere. Add a new Android.mk file for the quota library. Change-Id: I162c6327fee5bd06261d9cdcc34bda10f04a6f21 Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/blkid/blkid.h110
-rw-r--r--lib/blkid/blkid_types.h133
-rw-r--r--lib/blkid/cache.c1
-rw-r--r--lib/blkid/dev.c1
-rw-r--r--lib/blkid/devname.c1
-rw-r--r--lib/blkid/devno.c1
-rw-r--r--lib/blkid/getsize.c1
-rw-r--r--lib/blkid/llseek.c1
-rw-r--r--lib/blkid/probe.c1
-rw-r--r--lib/blkid/read.c1
-rw-r--r--lib/blkid/resolve.c1
-rw-r--r--lib/blkid/save.c1
-rw-r--r--lib/blkid/tag.c1
-rw-r--r--lib/blkid/tst_types.c1
-rw-r--r--lib/blkid/version.c1
-rw-r--r--lib/e2p/feature.c1
-rw-r--r--lib/e2p/fgetflags.c1
-rw-r--r--lib/e2p/fgetversion.c1
-rw-r--r--lib/e2p/fsetflags.c1
-rw-r--r--lib/e2p/fsetversion.c1
-rw-r--r--lib/e2p/getflags.c1
-rw-r--r--lib/e2p/getversion.c1
-rw-r--r--lib/e2p/hashstr.c1
-rw-r--r--lib/e2p/iod.c1
-rw-r--r--lib/e2p/ls.c1
-rw-r--r--lib/e2p/mntopts.c1
-rw-r--r--lib/e2p/ostype.c1
-rw-r--r--lib/e2p/parse_num.c1
-rw-r--r--lib/e2p/pe.c1
-rw-r--r--lib/e2p/percent.c1
-rw-r--r--lib/e2p/pf.c1
-rw-r--r--lib/e2p/ps.c1
-rw-r--r--lib/e2p/setflags.c1
-rw-r--r--lib/e2p/setversion.c1
-rw-r--r--lib/e2p/uuid.c1
-rw-r--r--lib/et/com_err.c1
-rw-r--r--lib/et/com_right.c1
-rw-r--r--lib/et/error_message.c1
-rw-r--r--lib/et/et_name.c1
-rw-r--r--lib/et/init_et.c1
-rw-r--r--lib/et/vfprintf.c1
-rw-r--r--lib/ext2fs/Android.mk9
-rw-r--r--lib/ext2fs/alloc.c1
-rw-r--r--lib/ext2fs/alloc_sb.c1
-rw-r--r--lib/ext2fs/alloc_stats.c1
-rw-r--r--lib/ext2fs/alloc_tables.c1
-rw-r--r--lib/ext2fs/badblocks.c1
-rw-r--r--lib/ext2fs/bb_compat.c1
-rw-r--r--lib/ext2fs/bb_inode.c1
-rw-r--r--lib/ext2fs/bitmaps.c1
-rw-r--r--lib/ext2fs/bitops.c1
-rw-r--r--lib/ext2fs/blkmap64_ba.c1
-rw-r--r--lib/ext2fs/blknum.c1
-rw-r--r--lib/ext2fs/block.c1
-rw-r--r--lib/ext2fs/bmap.c1
-rw-r--r--lib/ext2fs/bmove.c1
-rw-r--r--lib/ext2fs/brel_ma.c1
-rw-r--r--lib/ext2fs/check_desc.c1
-rw-r--r--lib/ext2fs/closefs.c1
-rw-r--r--lib/ext2fs/crc16.c1
-rw-r--r--lib/ext2fs/crc32c.c1
-rw-r--r--lib/ext2fs/csum.c1
-rw-r--r--lib/ext2fs/dblist.c1
-rw-r--r--lib/ext2fs/dblist_dir.c1
-rw-r--r--lib/ext2fs/dir_iterate.c1
-rw-r--r--lib/ext2fs/dirblock.c1
-rw-r--r--lib/ext2fs/dirhash.c1
-rw-r--r--lib/ext2fs/dosio.c1
-rw-r--r--lib/ext2fs/dupfs.c1
-rw-r--r--lib/ext2fs/expanddir.c1
-rw-r--r--lib/ext2fs/ext2_err.c210
-rw-r--r--lib/ext2fs/ext2_err.h174
-rw-r--r--lib/ext2fs/ext2_types.h137
-rw-r--r--lib/ext2fs/ext_attr.c1
-rw-r--r--lib/ext2fs/extent.c1
-rw-r--r--lib/ext2fs/fileio.c1
-rw-r--r--lib/ext2fs/finddev.c1
-rw-r--r--lib/ext2fs/flushb.c1
-rw-r--r--lib/ext2fs/freefs.c1
-rw-r--r--lib/ext2fs/gen_bitmap.c1
-rw-r--r--lib/ext2fs/gen_bitmap64.c1
-rw-r--r--lib/ext2fs/get_pathname.c1
-rw-r--r--lib/ext2fs/getsectsize.c1
-rw-r--r--lib/ext2fs/getsize.c1
-rw-r--r--lib/ext2fs/i_block.c1
-rw-r--r--lib/ext2fs/icount.c1
-rw-r--r--lib/ext2fs/imager.c1
-rw-r--r--lib/ext2fs/ind_block.c1
-rw-r--r--lib/ext2fs/initialize.c1
-rw-r--r--lib/ext2fs/inline.c3
-rw-r--r--lib/ext2fs/inode.c1
-rw-r--r--lib/ext2fs/inode_io.c1
-rw-r--r--lib/ext2fs/io_manager.c1
-rw-r--r--lib/ext2fs/irel_ma.c1
-rw-r--r--lib/ext2fs/ismounted.c1
-rw-r--r--lib/ext2fs/link.c1
-rw-r--r--lib/ext2fs/llseek.c1
-rw-r--r--lib/ext2fs/lookup.c1
-rw-r--r--lib/ext2fs/mkdir.c1
-rw-r--r--lib/ext2fs/mkjournal.c1
-rw-r--r--lib/ext2fs/mmp.c1
-rw-r--r--lib/ext2fs/namei.c1
-rw-r--r--lib/ext2fs/native.c1
-rw-r--r--lib/ext2fs/newdir.c1
-rw-r--r--lib/ext2fs/nt_io.c1
-rw-r--r--lib/ext2fs/openfs.c1
-rw-r--r--lib/ext2fs/progress.c1
-rw-r--r--lib/ext2fs/punch.c1
-rw-r--r--lib/ext2fs/qcow2.c1
-rw-r--r--lib/ext2fs/read_bb.c1
-rw-r--r--lib/ext2fs/read_bb_file.c1
-rw-r--r--lib/ext2fs/res_gdt.c1
-rw-r--r--lib/ext2fs/rw_bitmaps.c1
-rw-r--r--lib/ext2fs/swapfs.c1
-rw-r--r--lib/ext2fs/symlink.c1
-rw-r--r--lib/ext2fs/tdb.c1
-rw-r--r--lib/ext2fs/tdbtool.c1
-rw-r--r--lib/ext2fs/test_io.c1
-rw-r--r--lib/ext2fs/tst_badblocks.c1
-rw-r--r--lib/ext2fs/tst_bitmaps.c1
-rw-r--r--lib/ext2fs/tst_bitops.c1
-rw-r--r--lib/ext2fs/tst_byteswap.c1
-rw-r--r--lib/ext2fs/tst_getsectsize.c1
-rw-r--r--lib/ext2fs/tst_getsize.c1
-rw-r--r--lib/ext2fs/tst_inode_size.c1
-rw-r--r--lib/ext2fs/tst_iscan.c1
-rw-r--r--lib/ext2fs/tst_super_size.c1
-rw-r--r--lib/ext2fs/tst_types.c1
-rw-r--r--lib/ext2fs/undo_io.c1
-rw-r--r--lib/ext2fs/unix_io.c1
-rw-r--r--lib/ext2fs/unlink.c1
-rw-r--r--lib/ext2fs/valid_blk.c1
-rw-r--r--lib/ext2fs/version.c1
-rw-r--r--lib/ext2fs/write_bb_file.c1
-rw-r--r--lib/fpopen.c1
-rw-r--r--lib/quota/Android.mk61
-rw-r--r--lib/quota/mkquota.c1
-rw-r--r--lib/quota/quotaio.c1
-rw-r--r--lib/quota/quotaio_tree.c1
-rw-r--r--lib/quota/quotaio_v2.c1
-rw-r--r--lib/ss/data.c1
-rw-r--r--lib/ss/error.c1
-rw-r--r--lib/ss/execute_cmd.c1
-rw-r--r--lib/ss/get_readline.c1
-rw-r--r--lib/ss/help.c1
-rw-r--r--lib/ss/invocation.c1
-rw-r--r--lib/ss/list_rqs.c1
-rw-r--r--lib/ss/listen.c1
-rw-r--r--lib/ss/pager.c1
-rw-r--r--lib/ss/parse.c1
-rw-r--r--lib/ss/prompt.c1
-rw-r--r--lib/ss/request_tbl.c1
-rw-r--r--lib/ss/requests.c1
-rw-r--r--lib/ss/test_ss.c1
-rw-r--r--lib/uuid/clear.c1
-rw-r--r--lib/uuid/compare.c1
-rw-r--r--lib/uuid/copy.c1
-rw-r--r--lib/uuid/gen_uuid.c1
-rw-r--r--lib/uuid/gen_uuid_nt.c1
-rw-r--r--lib/uuid/isnull.c1
-rw-r--r--lib/uuid/pack.c1
-rw-r--r--lib/uuid/parse.c1
-rw-r--r--lib/uuid/tst_uuid.c1
-rw-r--r--lib/uuid/unpack.c1
-rw-r--r--lib/uuid/unparse.c1
-rw-r--r--lib/uuid/uuid.h103
-rw-r--r--lib/uuid/uuid_time.c2
-rw-r--r--lib/uuid/uuid_types.h50
168 files changed, 988 insertions, 161 deletions
diff --git a/lib/blkid/blkid.h b/lib/blkid/blkid.h
new file mode 100644
index 00000000..81f3098c
--- /dev/null
+++ b/lib/blkid/blkid.h
@@ -0,0 +1,110 @@
+/*
+ * blkid.h - Interface for libblkid, a library to identify block devices
+ *
+ * Copyright (C) 2001 Andreas Dilger
+ * Copyright (C) 2003 Theodore Ts'o
+ *
+ * %Begin-Header%
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
+ * %End-Header%
+ */
+
+#ifndef _BLKID_BLKID_H
+#define _BLKID_BLKID_H
+
+#include <sys/types.h>
+#include <blkid/blkid_types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define BLKID_VERSION "1.0.0"
+#define BLKID_DATE "12-Feb-2003"
+
+typedef struct blkid_struct_dev *blkid_dev;
+typedef struct blkid_struct_cache *blkid_cache;
+typedef __s64 blkid_loff_t;
+
+typedef struct blkid_struct_tag_iterate *blkid_tag_iterate;
+typedef struct blkid_struct_dev_iterate *blkid_dev_iterate;
+
+/*
+ * Flags for blkid_get_dev
+ *
+ * BLKID_DEV_CREATE Create an empty device structure if not found
+ * in the cache.
+ * BLKID_DEV_VERIFY Make sure the device structure corresponds
+ * with reality.
+ * BLKID_DEV_FIND Just look up a device entry, and return NULL
+ * if it is not found.
+ * BLKID_DEV_NORMAL Get a valid device structure, either from the
+ * cache or by probing the device.
+ */
+#define BLKID_DEV_FIND 0x0000
+#define BLKID_DEV_CREATE 0x0001
+#define BLKID_DEV_VERIFY 0x0002
+#define BLKID_DEV_NORMAL (BLKID_DEV_CREATE | BLKID_DEV_VERIFY)
+
+/* cache.c */
+extern void blkid_put_cache(blkid_cache cache);
+extern int blkid_get_cache(blkid_cache *cache, const char *filename);
+extern void blkid_gc_cache(blkid_cache cache);
+
+/* dev.c */
+extern const char *blkid_dev_devname(blkid_dev dev);
+
+extern blkid_dev_iterate blkid_dev_iterate_begin(blkid_cache cache);
+extern int blkid_dev_set_search(blkid_dev_iterate iter,
+ char *search_type, char *search_value);
+extern int blkid_dev_next(blkid_dev_iterate iterate, blkid_dev *dev);
+extern void blkid_dev_iterate_end(blkid_dev_iterate iterate);
+
+/* devno.c */
+extern char *blkid_devno_to_devname(dev_t devno);
+
+/* devname.c */
+extern int blkid_probe_all(blkid_cache cache);
+extern int blkid_probe_all_new(blkid_cache cache);
+extern blkid_dev blkid_get_dev(blkid_cache cache, const char *devname,
+ int flags);
+
+/* getsize.c */
+extern blkid_loff_t blkid_get_dev_size(int fd);
+
+/* probe.c */
+int blkid_known_fstype(const char *fstype);
+extern blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev);
+
+/* read.c */
+
+/* resolve.c */
+extern char *blkid_get_tag_value(blkid_cache cache, const char *tagname,
+ const char *devname);
+extern char *blkid_get_devname(blkid_cache cache, const char *token,
+ const char *value);
+
+/* tag.c */
+extern blkid_tag_iterate blkid_tag_iterate_begin(blkid_dev dev);
+extern int blkid_tag_next(blkid_tag_iterate iterate,
+ const char **type, const char **value);
+extern void blkid_tag_iterate_end(blkid_tag_iterate iterate);
+extern int blkid_dev_has_tag(blkid_dev dev, const char *type,
+ const char *value);
+extern blkid_dev blkid_find_dev_with_tag(blkid_cache cache,
+ const char *type,
+ const char *value);
+extern int blkid_parse_tag_string(const char *token, char **ret_type,
+ char **ret_val);
+
+/* version.c */
+extern int blkid_parse_version_string(const char *ver_string);
+extern int blkid_get_library_version(const char **ver_string,
+ const char **date_string);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _BLKID_BLKID_H */
diff --git a/lib/blkid/blkid_types.h b/lib/blkid/blkid_types.h
new file mode 100644
index 00000000..3ffaee54
--- /dev/null
+++ b/lib/blkid/blkid_types.h
@@ -0,0 +1,133 @@
+/*
+ * If linux/types.h is already been included, assume it has defined
+ * everything we need. (cross fingers) Other header files may have
+ * also defined the types that we need.
+ */
+#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \
+ !defined(_EXT2_TYPES_H))
+#define _BLKID_TYPES_H
+
+
+#ifdef __U8_TYPEDEF
+typedef __U8_TYPEDEF __u8;
+#else
+typedef unsigned char __u8;
+#endif
+
+#ifdef __S8_TYPEDEF
+typedef __S8_TYPEDEF __s8;
+#else
+typedef signed char __s8;
+#endif
+
+#ifdef __U16_TYPEDEF
+typedef __U16_TYPEDEF __u16;
+#else
+#if (4 == 2)
+typedef unsigned int __u16;
+#else
+#if (2 == 2)
+typedef unsigned short __u16;
+#else
+ ?==error: undefined 16 bit type
+#endif /* SIZEOF_SHORT == 2 */
+#endif /* SIZEOF_INT == 2 */
+#endif /* __U16_TYPEDEF */
+
+#ifdef __S16_TYPEDEF
+typedef __S16_TYPEDEF __s16;
+#else
+#if (4 == 2)
+typedef int __s16;
+#else
+#if (2 == 2)
+typedef short __s16;
+#else
+ ?==error: undefined 16 bit type
+#endif /* SIZEOF_SHORT == 2 */
+#endif /* SIZEOF_INT == 2 */
+#endif /* __S16_TYPEDEF */
+
+
+#ifdef __U32_TYPEDEF
+typedef __U32_TYPEDEF __u32;
+#else
+#if (4 == 4)
+typedef unsigned int __u32;
+#else
+#if (4 == 4)
+typedef unsigned long __u32;
+#else
+#if (2 == 4)
+typedef unsigned short __u32;
+#else
+ ?== error: undefined 32 bit type
+#endif /* SIZEOF_SHORT == 4 */
+#endif /* SIZEOF_LONG == 4 */
+#endif /* SIZEOF_INT == 4 */
+#endif /* __U32_TYPEDEF */
+
+#ifdef __S32_TYPEDEF
+typedef __S32_TYPEDEF __s32;
+#else
+#if (4 == 4)
+typedef int __s32;
+#else
+#if (4 == 4)
+typedef long __s32;
+#else
+#if (2 == 4)
+typedef short __s32;
+#else
+ ?== error: undefined 32 bit type
+#endif /* SIZEOF_SHORT == 4 */
+#endif /* SIZEOF_LONG == 4 */
+#endif /* SIZEOF_INT == 4 */
+#endif /* __S32_TYPEDEF */
+
+#ifdef __U64_TYPEDEF
+typedef __U64_TYPEDEF __u64;
+#else
+#if (4 == 8)
+typedef unsigned int __u64;
+#else
+#if (8 == 8)
+typedef unsigned long long __u64;
+#else
+#if (4 == 8)
+typedef unsigned long __u64;
+#endif /* SIZEOF_LONG == 8 */
+#endif /* SIZEOF_LONG_LONG == 8 */
+#endif /* SIZEOF_INT == 8 */
+#endif /* __U64_TYPEDEF */
+
+#ifdef __S64_TYPEDEF
+typedef __S64_TYPEDEF __s64;
+#else
+#if (4 == 8)
+typedef int __s64;
+#else
+#if (8 == 8)
+#if defined(__GNUC__)
+typedef __signed__ long long __s64;
+#else
+typedef signed long long __s64;
+#endif /* __GNUC__ */
+#else
+#if (4 == 8)
+typedef long __s64;
+#endif /* SIZEOF_LONG == 8 */
+#endif /* SIZEOF_LONG_LONG == 8 */
+#endif /* SIZEOF_INT == 8 */
+#endif /* __S64_TYPEDEF */
+
+#undef __S8_TYPEDEF
+#undef __U8_TYPEDEF
+#undef __S16_TYPEDEF
+#undef __U16_TYPEDEF
+#undef __S32_TYPEDEF
+#undef __U32_TYPEDEF
+#undef __S64_TYPEDEF
+#undef __U64_TYPEDEF
+
+#endif /* _*_TYPES_H */
diff --git a/lib/blkid/cache.c b/lib/blkid/cache.c
index 8bdd2399..e2ccafd2 100644
--- a/lib/blkid/cache.c
+++ b/lib/blkid/cache.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#if HAVE_SECURE_GETENV
#define _GNU_SOURCE
#endif
diff --git a/lib/blkid/dev.c b/lib/blkid/dev.c
index 6d8eaeac..128a869d 100644
--- a/lib/blkid/dev.c
+++ b/lib/blkid/dev.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdlib.h>
#include <string.h>
diff --git a/lib/blkid/devname.c b/lib/blkid/devname.c
index a6673c17..b151354d 100644
--- a/lib/blkid/devname.c
+++ b/lib/blkid/devname.c
@@ -13,7 +13,6 @@
#define _GNU_SOURCE 1
-#include "config.h"
#include <stdio.h>
#include <string.h>
#include <limits.h>
diff --git a/lib/blkid/devno.c b/lib/blkid/devno.c
index 479d9776..c9f5c92c 100644
--- a/lib/blkid/devno.c
+++ b/lib/blkid/devno.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/blkid/getsize.c b/lib/blkid/getsize.c
index c2a8f72a..ac4177e2 100644
--- a/lib/blkid/getsize.c
+++ b/lib/blkid/getsize.c
@@ -13,7 +13,6 @@
#define _LARGEFILE64_SOURCE
/* include this before sys/queues.h! */
-#include "config.h"
#include "blkidP.h"
#include <stdio.h>
diff --git a/lib/blkid/llseek.c b/lib/blkid/llseek.c
index 658acc97..5bd0e516 100644
--- a/lib/blkid/llseek.c
+++ b/lib/blkid/llseek.c
@@ -12,7 +12,6 @@
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
-#include "config.h"
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c
index bd31fe05..31385dbb 100644
--- a/lib/blkid/probe.c
+++ b/lib/blkid/probe.c
@@ -13,7 +13,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
diff --git a/lib/blkid/read.c b/lib/blkid/read.c
index efc348b9..ca2798f0 100644
--- a/lib/blkid/read.c
+++ b/lib/blkid/read.c
@@ -12,7 +12,6 @@
#define _XOPEN_SOURCE 600 /* for inclusion of strtoull */
-#include "config.h"
#include <stdio.h>
#include <ctype.h>
#include <string.h>
diff --git a/lib/blkid/resolve.c b/lib/blkid/resolve.c
index 3bc37b0c..6c2e268d 100644
--- a/lib/blkid/resolve.c
+++ b/lib/blkid/resolve.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/blkid/save.c b/lib/blkid/save.c
index 6c20168b..6802e9dc 100644
--- a/lib/blkid/save.c
+++ b/lib/blkid/save.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
diff --git a/lib/blkid/tag.c b/lib/blkid/tag.c
index 1eae7df7..639ef89e 100644
--- a/lib/blkid/tag.c
+++ b/lib/blkid/tag.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/blkid/tst_types.c b/lib/blkid/tst_types.c
index cb612aeb..3003c8b5 100644
--- a/lib/blkid/tst_types.c
+++ b/lib/blkid/tst_types.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <sys/types.h>
#include "blkid/blkid_types.h"
diff --git a/lib/blkid/version.c b/lib/blkid/version.c
index 54c17aa6..c9754fab 100644
--- a/lib/blkid/version.c
+++ b/lib/blkid/version.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/lib/e2p/feature.c b/lib/e2p/feature.c
index 96912638..bd8a64af 100644
--- a/lib/e2p/feature.c
+++ b/lib/e2p/feature.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/e2p/fgetflags.c b/lib/e2p/fgetflags.c
index 2af84627..ca3ea166 100644
--- a/lib/e2p/fgetflags.c
+++ b/lib/e2p/fgetflags.c
@@ -19,7 +19,6 @@
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
-#include "config.h"
#if HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/lib/e2p/fgetversion.c b/lib/e2p/fgetversion.c
index e6cee8bf..37946f77 100644
--- a/lib/e2p/fgetversion.c
+++ b/lib/e2p/fgetversion.c
@@ -19,7 +19,6 @@
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
-#include "config.h"
#if HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/lib/e2p/fsetflags.c b/lib/e2p/fsetflags.c
index 167d16e8..08dd114d 100644
--- a/lib/e2p/fsetflags.c
+++ b/lib/e2p/fsetflags.c
@@ -19,7 +19,6 @@
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
-#include "config.h"
#if HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/lib/e2p/fsetversion.c b/lib/e2p/fsetversion.c
index d41d59f9..fc50cb1e 100644
--- a/lib/e2p/fsetversion.c
+++ b/lib/e2p/fsetversion.c
@@ -19,7 +19,6 @@
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
-#include "config.h"
#if HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/lib/e2p/getflags.c b/lib/e2p/getflags.c
index e4e2ad73..e8716848 100644
--- a/lib/e2p/getflags.c
+++ b/lib/e2p/getflags.c
@@ -16,7 +16,6 @@
* 93/10/30 - Creation
*/
-#include "config.h"
#if HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/lib/e2p/getversion.c b/lib/e2p/getversion.c
index 71031ffc..ec6621dc 100644
--- a/lib/e2p/getversion.c
+++ b/lib/e2p/getversion.c
@@ -16,7 +16,6 @@
* 93/10/30 - Creation
*/
-#include "config.h"
#if HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/lib/e2p/hashstr.c b/lib/e2p/hashstr.c
index a73758c7..5ee62370 100644
--- a/lib/e2p/hashstr.c
+++ b/lib/e2p/hashstr.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/e2p/iod.c b/lib/e2p/iod.c
index 6a030dd4..c53aafeb 100644
--- a/lib/e2p/iod.c
+++ b/lib/e2p/iod.c
@@ -16,7 +16,6 @@
* 93/10/30 - Creation
*/
-#include "config.h"
#include "e2p.h"
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/e2p/ls.c b/lib/e2p/ls.c
index 5b3d3c8b..78cd335e 100644
--- a/lib/e2p/ls.c
+++ b/lib/e2p/ls.c
@@ -13,7 +13,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
diff --git a/lib/e2p/mntopts.c b/lib/e2p/mntopts.c
index d56cc527..9d3879e3 100644
--- a/lib/e2p/mntopts.c
+++ b/lib/e2p/mntopts.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/e2p/ostype.c b/lib/e2p/ostype.c
index d002e75d..978315b8 100644
--- a/lib/e2p/ostype.c
+++ b/lib/e2p/ostype.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include "e2p.h"
#include <string.h>
#include <stdlib.h>
diff --git a/lib/e2p/parse_num.c b/lib/e2p/parse_num.c
index e8d6283c..4caa3a3c 100644
--- a/lib/e2p/parse_num.c
+++ b/lib/e2p/parse_num.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include "e2p.h"
#include <stdlib.h>
diff --git a/lib/e2p/pe.c b/lib/e2p/pe.c
index 1f24545d..78c80993 100644
--- a/lib/e2p/pe.c
+++ b/lib/e2p/pe.c
@@ -16,7 +16,6 @@
* 94/01/09 - Creation
*/
-#include "config.h"
#include <stdio.h>
#include "e2p.h"
diff --git a/lib/e2p/percent.c b/lib/e2p/percent.c
index e340cd76..cfa7046e 100644
--- a/lib/e2p/percent.c
+++ b/lib/e2p/percent.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include "e2p.h"
#include <stdlib.h>
diff --git a/lib/e2p/pf.c b/lib/e2p/pf.c
index e2f8ce50..6dd29f63 100644
--- a/lib/e2p/pf.c
+++ b/lib/e2p/pf.c
@@ -16,7 +16,6 @@
* 93/10/30 - Creation
*/
-#include "config.h"
#include <stdio.h>
#include "e2p.h"
diff --git a/lib/e2p/ps.c b/lib/e2p/ps.c
index 757f8a66..e6ad60ab 100644
--- a/lib/e2p/ps.c
+++ b/lib/e2p/ps.c
@@ -16,7 +16,6 @@
* 93/12/22 - Creation
*/
-#include "config.h"
#include <stdio.h>
#include "e2p.h"
diff --git a/lib/e2p/setflags.c b/lib/e2p/setflags.c
index 0f6a3e04..b203606f 100644
--- a/lib/e2p/setflags.c
+++ b/lib/e2p/setflags.c
@@ -16,7 +16,6 @@
* 93/10/30 - Creation
*/
-#include "config.h"
#if HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/lib/e2p/setversion.c b/lib/e2p/setversion.c
index 202834f1..d72270b6 100644
--- a/lib/e2p/setversion.c
+++ b/lib/e2p/setversion.c
@@ -16,7 +16,6 @@
* 93/10/30 - Creation
*/
-#include "config.h"
#if HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/lib/e2p/uuid.c b/lib/e2p/uuid.c
index a1020927..310b01de 100644
--- a/lib/e2p/uuid.c
+++ b/lib/e2p/uuid.c
@@ -7,7 +7,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#include <ext2fs/ext2_types.h>
diff --git a/lib/et/com_err.c b/lib/et/com_err.c
index d38998a2..5cc5c089 100644
--- a/lib/et/com_err.c
+++ b/lib/et/com_err.c
@@ -11,7 +11,6 @@
* express or implied warranty.
*/
-#include "config.h"
#include <stdio.h>
#ifdef HAVE_TERMIOS_H
#include <termios.h>
diff --git a/lib/et/com_right.c b/lib/et/com_right.c
index 2cceb54c..f00e9104 100644
--- a/lib/et/com_right.c
+++ b/lib/et/com_right.c
@@ -38,7 +38,6 @@
* SUCH DAMAGE.
*/
-#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/et/error_message.c b/lib/et/error_message.c
index 5d8d2422..16a4bcfb 100644
--- a/lib/et/error_message.c
+++ b/lib/et/error_message.c
@@ -16,7 +16,6 @@
* express or implied warranty.
*/
-#include "config.h"
#if HAVE_SECURE_GETENV
#define _GNU_SOURCE
#endif
diff --git a/lib/et/et_name.c b/lib/et/et_name.c
index d9a3e874..3a0790e2 100644
--- a/lib/et/et_name.c
+++ b/lib/et/et_name.c
@@ -11,7 +11,6 @@
* express or implied warranty.
*/
-#include "config.h"
#include "com_err.h"
#include "error_table.h"
#include "internal.h"
diff --git a/lib/et/init_et.c b/lib/et/init_et.c
index 772660d8..bf27da11 100644
--- a/lib/et/init_et.c
+++ b/lib/et/init_et.c
@@ -16,7 +16,6 @@
* express or implied warranty.
*/
-#include "config.h"
#include <stdio.h>
#include <errno.h>
#ifdef HAVE_STDLIB_H
diff --git a/lib/et/vfprintf.c b/lib/et/vfprintf.c
index e3fcd78c..a1dc1e8c 100644
--- a/lib/et/vfprintf.c
+++ b/lib/et/vfprintf.c
@@ -19,7 +19,6 @@
static char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88";
#endif /* LIBC_SCCS and not lint */
-#include "config.h"
#if !HAVE_VPRINTF && HAVE_DOPRNT
#include <stdio.h>
#include <varargs.h>
diff --git a/lib/ext2fs/Android.mk b/lib/ext2fs/Android.mk
index c34efd37..5cf6eb03 100644
--- a/lib/ext2fs/Android.mk
+++ b/lib/ext2fs/Android.mk
@@ -10,6 +10,9 @@ libext2fs_src_files := \
bb_inode.c \
bitmaps.c \
bitops.c \
+ blkmap64_ba.c \
+ blkmap64_rb.c \
+ blknum.c \
block.c \
bmap.c \
check_desc.c \
@@ -25,10 +28,12 @@ libext2fs_src_files := \
expanddir.c \
ext_attr.c \
extent.c \
+ fileio.c \
finddev.c \
flushb.c \
freefs.c \
gen_bitmap.c \
+ gen_bitmap64.c \
get_pathname.c \
getsize.c \
getsectsize.c \
@@ -43,11 +48,15 @@ libext2fs_src_files := \
link.c \
llseek.c \
lookup.c \
+ mmp.c \
mkdir.c \
mkjournal.c \
native.c \
newdir.c \
openfs.c \
+ progress.c \
+ punch.c \
+ rbtree.c \
read_bb.c \
read_bb_file.c \
res_gdt.c \
diff --git a/lib/ext2fs/alloc.c b/lib/ext2fs/alloc.c
index 0c829edb..21d3e5ef 100644
--- a/lib/ext2fs/alloc.c
+++ b/lib/ext2fs/alloc.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/alloc_sb.c b/lib/ext2fs/alloc_sb.c
index 223ec516..73ef2cea 100644
--- a/lib/ext2fs/alloc_sb.c
+++ b/lib/ext2fs/alloc_sb.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/alloc_stats.c b/lib/ext2fs/alloc_stats.c
index adec3636..9a6697e0 100644
--- a/lib/ext2fs/alloc_stats.c
+++ b/lib/ext2fs/alloc_stats.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include "ext2_fs.h"
diff --git a/lib/ext2fs/alloc_tables.c b/lib/ext2fs/alloc_tables.c
index 9f3d4e04..885d2b23 100644
--- a/lib/ext2fs/alloc_tables.c
+++ b/lib/ext2fs/alloc_tables.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/badblocks.c b/lib/ext2fs/badblocks.c
index 0f23983b..4312e190 100644
--- a/lib/ext2fs/badblocks.c
+++ b/lib/ext2fs/badblocks.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/bb_compat.c b/lib/ext2fs/bb_compat.c
index 373792a2..a94e3e48 100644
--- a/lib/ext2fs/bb_compat.c
+++ b/lib/ext2fs/bb_compat.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/bb_inode.c b/lib/ext2fs/bb_inode.c
index 268eecf8..0b6c3dd2 100644
--- a/lib/ext2fs/bb_inode.c
+++ b/lib/ext2fs/bb_inode.c
@@ -13,7 +13,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/bitmaps.c b/lib/ext2fs/bitmaps.c
index 84021917..f215122f 100644
--- a/lib/ext2fs/bitmaps.c
+++ b/lib/ext2fs/bitmaps.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/bitops.c b/lib/ext2fs/bitops.c
index 8e4c05c4..42328478 100644
--- a/lib/ext2fs/bitops.c
+++ b/lib/ext2fs/bitops.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/lib/ext2fs/blkmap64_ba.c b/lib/ext2fs/blkmap64_ba.c
index 8eddde9a..72ef3ebd 100644
--- a/lib/ext2fs/blkmap64_ba.c
+++ b/lib/ext2fs/blkmap64_ba.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/blknum.c b/lib/ext2fs/blknum.c
index 8ced1eec..e2f0f1bb 100644
--- a/lib/ext2fs/blknum.c
+++ b/lib/ext2fs/blknum.c
@@ -11,7 +11,6 @@
* %End-Header%
*/
-#include "config.h"
#include "ext2fs.h"
/*
diff --git a/lib/ext2fs/block.c b/lib/ext2fs/block.c
index b8c68798..3e4bbde2 100644
--- a/lib/ext2fs/block.c
+++ b/lib/ext2fs/block.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/bmap.c b/lib/ext2fs/bmap.c
index b944c273..28a33207 100644
--- a/lib/ext2fs/bmap.c
+++ b/lib/ext2fs/bmap.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/bmove.c b/lib/ext2fs/bmove.c
index e2ea405a..f9480c88 100644
--- a/lib/ext2fs/bmove.c
+++ b/lib/ext2fs/bmove.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/brel_ma.c b/lib/ext2fs/brel_ma.c
index a12afaeb..e398c1e0 100644
--- a/lib/ext2fs/brel_ma.c
+++ b/lib/ext2fs/brel_ma.c
@@ -12,7 +12,6 @@
* %End-Header%
*/
-#include "config.h"
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
diff --git a/lib/ext2fs/check_desc.c b/lib/ext2fs/check_desc.c
index 1a768f92..d2cc5659 100644
--- a/lib/ext2fs/check_desc.c
+++ b/lib/ext2fs/check_desc.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c
index 3e4af7f9..87403839 100644
--- a/lib/ext2fs/closefs.c
+++ b/lib/ext2fs/closefs.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/crc16.c b/lib/ext2fs/crc16.c
index 2fdeb24e..026f040b 100644
--- a/lib/ext2fs/crc16.c
+++ b/lib/ext2fs/crc16.c
@@ -5,7 +5,6 @@
* Version 2. See the file COPYING for more details.
*/
-#include "config.h"
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
diff --git a/lib/ext2fs/crc32c.c b/lib/ext2fs/crc32c.c
index 2512528a..5907500b 100644
--- a/lib/ext2fs/crc32c.c
+++ b/lib/ext2fs/crc32c.c
@@ -28,7 +28,6 @@
* This source code is licensed under the GNU General Public License,
* Version 2. See the file COPYING for more details.
*/
-#include "config.h"
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/lib/ext2fs/csum.c b/lib/ext2fs/csum.c
index b681d342..b588ead3 100644
--- a/lib/ext2fs/csum.c
+++ b/lib/ext2fs/csum.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
diff --git a/lib/ext2fs/dblist.c b/lib/ext2fs/dblist.c
index 3f6ea50d..e5b685a1 100644
--- a/lib/ext2fs/dblist.c
+++ b/lib/ext2fs/dblist.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/dblist_dir.c b/lib/ext2fs/dblist_dir.c
index d4d51114..07ed8afa 100644
--- a/lib/ext2fs/dblist_dir.c
+++ b/lib/ext2fs/dblist_dir.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/dir_iterate.c b/lib/ext2fs/dir_iterate.c
index 589af692..8412218c 100644
--- a/lib/ext2fs/dir_iterate.c
+++ b/lib/ext2fs/dir_iterate.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/dirblock.c b/lib/ext2fs/dirblock.c
index cb3a104c..73e1f0ab 100644
--- a/lib/ext2fs/dirblock.c
+++ b/lib/ext2fs/dirblock.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/dirhash.c b/lib/ext2fs/dirhash.c
index c4ac94e0..5477bfbc 100644
--- a/lib/ext2fs/dirhash.c
+++ b/lib/ext2fs/dirhash.c
@@ -11,7 +11,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
diff --git a/lib/ext2fs/dosio.c b/lib/ext2fs/dosio.c
index 0defff8a..ff3bda69 100644
--- a/lib/ext2fs/dosio.c
+++ b/lib/ext2fs/dosio.c
@@ -11,7 +11,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <bios.h>
#include <string.h>
diff --git a/lib/ext2fs/dupfs.c b/lib/ext2fs/dupfs.c
index 02721e1a..13a48121 100644
--- a/lib/ext2fs/dupfs.c
+++ b/lib/ext2fs/dupfs.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/expanddir.c b/lib/ext2fs/expanddir.c
index 153b838c..c89385be 100644
--- a/lib/ext2fs/expanddir.c
+++ b/lib/ext2fs/expanddir.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/ext2_err.c b/lib/ext2fs/ext2_err.c
new file mode 100644
index 00000000..3d6f0b4a
--- /dev/null
+++ b/lib/ext2fs/ext2_err.c
@@ -0,0 +1,210 @@
+/*
+ * ext2_err.c:
+ * This file is automatically generated; please do not edit it.
+ */
+
+#include <stdlib.h>
+
+#define N_(a) a
+
+static const char * const text[] = {
+ N_( "EXT2FS Library version 1.42.9"),
+ N_( "Wrong magic number for ext2_filsys structure"),
+ N_( "Wrong magic number for badblocks_list structure"),
+ N_( "Wrong magic number for badblocks_iterate structure"),
+ N_( "Wrong magic number for inode_scan structure"),
+ N_( "Wrong magic number for io_channel structure"),
+ N_( "Wrong magic number for unix io_channel structure"),
+ N_( "Wrong magic number for io_manager structure"),
+ N_( "Wrong magic number for block_bitmap structure"),
+ N_( "Wrong magic number for inode_bitmap structure"),
+ N_( "Wrong magic number for generic_bitmap structure"),
+ N_( "Wrong magic number for test io_channel structure"),
+ N_( "Wrong magic number for directory block list structure"),
+ N_( "Wrong magic number for icount structure"),
+ N_( "Wrong magic number for Powerquest io_channel structure"),
+ N_( "Wrong magic number for ext2 file structure"),
+ N_( "Wrong magic number for Ext2 Image Header"),
+ N_( "Wrong magic number for inode io_channel structure"),
+ N_( "Wrong magic number for ext4 extent handle"),
+ N_( "Bad magic number in super-block"),
+ N_( "Filesystem revision too high"),
+ N_( "Attempt to write to filesystem opened read-only"),
+ N_( "Can't read group descriptors"),
+ N_( "Can't write group descriptors"),
+ N_( "Corrupt group descriptor: bad block for block bitmap"),
+ N_( "Corrupt group descriptor: bad block for inode bitmap"),
+ N_( "Corrupt group descriptor: bad block for inode table"),
+ N_( "Can't write an inode bitmap"),
+ N_( "Can't read an inode bitmap"),
+ N_( "Can't write a block bitmap"),
+ N_( "Can't read a block bitmap"),
+ N_( "Can't write an inode table"),
+ N_( "Can't read an inode table"),
+ N_( "Can't read next inode"),
+ N_( "Filesystem has unexpected block size"),
+ N_( "EXT2 directory corrupted"),
+ N_( "Attempt to read block from filesystem resulted in short read"),
+ N_( "Attempt to write block to filesystem resulted in short write"),
+ N_( "No free space in the directory"),
+ N_( "Inode bitmap not loaded"),
+ N_( "Block bitmap not loaded"),
+ N_( "Illegal inode number"),
+ N_( "Illegal block number"),
+ N_( "Internal error in ext2fs_expand_dir"),
+ N_( "Not enough space to build proposed filesystem"),
+ N_( "Illegal block number passed to ext2fs_mark_block_bitmap"),
+ N_( "Illegal block number passed to ext2fs_unmark_block_bitmap"),
+ N_( "Illegal block number passed to ext2fs_test_block_bitmap"),
+ N_( "Illegal inode number passed to ext2fs_mark_inode_bitmap"),
+ N_( "Illegal inode number passed to ext2fs_unmark_inode_bitmap"),
+ N_( "Illegal inode number passed to ext2fs_test_inode_bitmap"),
+ N_( "Attempt to fudge end of block bitmap past the real end"),
+ N_( "Attempt to fudge end of inode bitmap past the real end"),
+ N_( "Illegal indirect block found" ),
+ N_( "Illegal doubly indirect block found" ),
+ N_( "Illegal triply indirect block found" ),
+ N_( "Block bitmaps are not the same"),
+ N_( "Inode bitmaps are not the same"),
+ N_( "Illegal or malformed device name"),
+ N_( "A block group is missing an inode table"),
+ N_( "The ext2 superblock is corrupt"),
+ N_( "Illegal generic bit number passed to ext2fs_mark_generic_bitmap"),
+ N_( "Illegal generic bit number passed to ext2fs_unmark_generic_bitmap"),
+ N_( "Illegal generic bit number passed to ext2fs_test_generic_bitmap"),
+ N_( "Too many symbolic links encountered."),
+ N_( "The callback function will not handle this case"),
+ N_( "The inode is from a bad block in the inode table"),
+ N_( "Filesystem has unsupported feature(s)"),
+ N_( "Filesystem has unsupported read-only feature(s)"),
+ N_( "IO Channel failed to seek on read or write"),
+ N_( "Memory allocation failed"),
+ N_( "Invalid argument passed to ext2 library"),
+ N_( "Could not allocate block in ext2 filesystem"),
+ N_( "Could not allocate inode in ext2 filesystem"),
+ N_( "Ext2 inode is not a directory"),
+ N_( "Too many references in table"),
+ N_( "File not found by ext2_lookup"),
+ N_( "File open read-only"),
+ N_( "Ext2 directory block not found"),
+ N_( "Ext2 directory already exists"),
+ N_( "Unimplemented ext2 library function"),
+ N_( "User cancel requested"),
+ N_( "Ext2 file too big"),
+ N_( "Supplied journal device not a block device"),
+ N_( "Journal superblock not found"),
+ N_( "Journal must be at least 1024 blocks"),
+ N_( "Unsupported journal version"),
+ N_( "Error loading external journal"),
+ N_( "Journal not found"),
+ N_( "Directory hash unsupported"),
+ N_( "Illegal extended attribute block number"),
+ N_( "Cannot create filesystem with requested number of inodes"),
+ N_( "E2image snapshot not in use"),
+ N_( "Too many reserved group descriptor blocks"),
+ N_( "Resize inode is corrupt"),
+ N_( "Tried to set block bmap with missing indirect block"),
+ N_( "TDB: Success"),
+ N_( "TDB: Corrupt database"),
+ N_( "TDB: IO Error"),
+ N_( "TDB: Locking error"),
+ N_( "TDB: Out of memory"),
+ N_( "TDB: Record exists"),
+ N_( "TDB: Lock exists on other keys"),
+ N_( "TDB: Invalid parameter"),
+ N_( "TDB: Record does not exist"),
+ N_( "TDB: Write not permitted"),
+ N_( "Ext2fs directory block list is empty"),
+ N_( "Attempt to modify a block mapping via a read-only block iterator"),
+ N_( "Wrong magic number for ext4 extent saved path"),
+ N_( "Wrong magic number for 64-bit generic bitmap"),
+ N_( "Wrong magic number for 64-bit block bitmap"),
+ N_( "Wrong magic number for 64-bit inode bitmap"),
+ N_( "Wrong magic number --- RESERVED_13"),
+ N_( "Wrong magic number --- RESERVED_14"),
+ N_( "Wrong magic number --- RESERVED_15"),
+ N_( "Wrong magic number --- RESERVED_16"),
+ N_( "Wrong magic number --- RESERVED_17"),
+ N_( "Wrong magic number --- RESERVED_18"),
+ N_( "Wrong magic number --- RESERVED_19"),
+ N_( "Corrupt extent header"),
+ N_( "Corrupt extent index"),
+ N_( "Corrupt extent"),
+ N_( "No free space in extent map"),
+ N_( "Inode does not use extents"),
+ N_( "No 'next' extent"),
+ N_( "No 'previous' extent"),
+ N_( "No 'up' extent"),
+ N_( "No 'down' extent"),
+ N_( "No current node"),
+ N_( "Ext2fs operation not supported"),
+ N_( "No room to insert extent in node"),
+ N_( "Splitting would result in empty node"),
+ N_( "Extent not found"),
+ N_( "Operation not supported for inodes containing extents"),
+ N_( "Extent length is invalid"),
+ N_( "I/O Channel does not support 64-bit block numbers"),
+ N_( "Can't check if filesystem is mounted due to missing mtab file"),
+ N_( "Filesystem too large to use legacy bitmaps"),
+ N_( "MMP: invalid magic number"),
+ N_( "MMP: device currently active"),
+ N_( "MMP: fsck being run"),
+ N_( "MMP: block number beyond filesystem range"),
+ N_( "MMP: undergoing an unknown operation"),
+ N_( "MMP: filesystem still in use"),
+ N_( "MMP: open with O_DIRECT failed"),
+ N_( "Block group descriptor size incorrect"),
+ N_( "Inode checksum does not match inode"),
+ N_( "Inode bitmap checksum does not match bitmap"),
+ N_( "Extent block checksum does not match extent block"),
+ N_( "Directory block does not have space for checksum"),
+ N_( "Directory block checksum does not match directory block"),
+ N_( "Extended attribute block checksum does not match block"),
+ N_( "Superblock checksum does not match superblock"),
+ N_( "Unknown checksum algorithm"),
+ N_( "MMP block checksum does not match MMP block"),
+ N_( "Ext2 file already exists"),
+ 0
+};
+
+struct error_table {
+ char const * const * msgs;
+ long base;
+ int n_msgs;
+};
+struct et_list {
+ struct et_list *next;
+ const struct error_table * table;
+};
+extern struct et_list *_et_list;
+
+const struct error_table et_ext2_error_table = { text, 2133571328L, 156 };
+
+static struct et_list link = { 0, 0 };
+
+void initialize_ext2_error_table_r(struct et_list **list);
+void initialize_ext2_error_table(void);
+
+void initialize_ext2_error_table(void) {
+ initialize_ext2_error_table_r(&_et_list);
+}
+
+/* For Heimdal compatibility */
+void initialize_ext2_error_table_r(struct et_list **list)
+{
+ struct et_list *et, **end;
+
+ for (end = list, et = *list; et; end = &et->next, et = et->next)
+ if (et->table->msgs == text)
+ return;
+ et = malloc(sizeof(struct et_list));
+ if (et == 0) {
+ if (!link.table)
+ et = &link;
+ else
+ return;
+ }
+ et->table = &et_ext2_error_table;
+ et->next = 0;
+ *end = et;
+}
diff --git a/lib/ext2fs/ext2_err.h b/lib/ext2fs/ext2_err.h
new file mode 100644
index 00000000..70224181
--- /dev/null
+++ b/lib/ext2fs/ext2_err.h
@@ -0,0 +1,174 @@
+/*
+ * ext2_err.h:
+ * This file is automatically generated; please do not edit it.
+ */
+
+#include <et/com_err.h>
+
+#define EXT2_ET_BASE (2133571328L)
+#define EXT2_ET_MAGIC_EXT2FS_FILSYS (2133571329L)
+#define EXT2_ET_MAGIC_BADBLOCKS_LIST (2133571330L)
+#define EXT2_ET_MAGIC_BADBLOCKS_ITERATE (2133571331L)
+#define EXT2_ET_MAGIC_INODE_SCAN (2133571332L)
+#define EXT2_ET_MAGIC_IO_CHANNEL (2133571333L)
+#define EXT2_ET_MAGIC_UNIX_IO_CHANNEL (2133571334L)
+#define EXT2_ET_MAGIC_IO_MANAGER (2133571335L)
+#define EXT2_ET_MAGIC_BLOCK_BITMAP (2133571336L)
+#define EXT2_ET_MAGIC_INODE_BITMAP (2133571337L)
+#define EXT2_ET_MAGIC_GENERIC_BITMAP (2133571338L)
+#define EXT2_ET_MAGIC_TEST_IO_CHANNEL (2133571339L)
+#define EXT2_ET_MAGIC_DBLIST (2133571340L)
+#define EXT2_ET_MAGIC_ICOUNT (2133571341L)
+#define EXT2_ET_MAGIC_PQ_IO_CHANNEL (2133571342L)
+#define EXT2_ET_MAGIC_EXT2_FILE (2133571343L)
+#define EXT2_ET_MAGIC_E2IMAGE (2133571344L)
+#define EXT2_ET_MAGIC_INODE_IO_CHANNEL (2133571345L)
+#define EXT2_ET_MAGIC_EXTENT_HANDLE (2133571346L)
+#define EXT2_ET_BAD_MAGIC (2133571347L)
+#define EXT2_ET_REV_TOO_HIGH (2133571348L)
+#define EXT2_ET_RO_FILSYS (2133571349L)
+#define EXT2_ET_GDESC_READ (2133571350L)
+#define EXT2_ET_GDESC_WRITE (2133571351L)
+#define EXT2_ET_GDESC_BAD_BLOCK_MAP (2133571352L)
+#define EXT2_ET_GDESC_BAD_INODE_MAP (2133571353L)
+#define EXT2_ET_GDESC_BAD_INODE_TABLE (2133571354L)
+#define EXT2_ET_INODE_BITMAP_WRITE (2133571355L)
+#define EXT2_ET_INODE_BITMAP_READ (2133571356L)
+#define EXT2_ET_BLOCK_BITMAP_WRITE (2133571357L)
+#define EXT2_ET_BLOCK_BITMAP_READ (2133571358L)
+#define EXT2_ET_INODE_TABLE_WRITE (2133571359L)
+#define EXT2_ET_INODE_TABLE_READ (2133571360L)
+#define EXT2_ET_NEXT_INODE_READ (2133571361L)
+#define EXT2_ET_UNEXPECTED_BLOCK_SIZE (2133571362L)
+#define EXT2_ET_DIR_CORRUPTED (2133571363L)
+#define EXT2_ET_SHORT_READ (2133571364L)
+#define EXT2_ET_SHORT_WRITE (2133571365L)
+#define EXT2_ET_DIR_NO_SPACE (2133571366L)
+#define EXT2_ET_NO_INODE_BITMAP (2133571367L)
+#define EXT2_ET_NO_BLOCK_BITMAP (2133571368L)
+#define EXT2_ET_BAD_INODE_NUM (2133571369L)
+#define EXT2_ET_BAD_BLOCK_NUM (2133571370L)
+#define EXT2_ET_EXPAND_DIR_ERR (2133571371L)
+#define EXT2_ET_TOOSMALL (2133571372L)
+#define EXT2_ET_BAD_BLOCK_MARK (2133571373L)
+#define EXT2_ET_BAD_BLOCK_UNMARK (2133571374L)
+#define EXT2_ET_BAD_BLOCK_TEST (2133571375L)
+#define EXT2_ET_BAD_INODE_MARK (2133571376L)
+#define EXT2_ET_BAD_INODE_UNMARK (2133571377L)
+#define EXT2_ET_BAD_INODE_TEST (2133571378L)
+#define EXT2_ET_FUDGE_BLOCK_BITMAP_END (2133571379L)
+#define EXT2_ET_FUDGE_INODE_BITMAP_END (2133571380L)
+#define EXT2_ET_BAD_IND_BLOCK (2133571381L)
+#define EXT2_ET_BAD_DIND_BLOCK (2133571382L)
+#define EXT2_ET_BAD_TIND_BLOCK (2133571383L)
+#define EXT2_ET_NEQ_BLOCK_BITMAP (2133571384L)
+#define EXT2_ET_NEQ_INODE_BITMAP (2133571385L)
+#define EXT2_ET_BAD_DEVICE_NAME (2133571386L)
+#define EXT2_ET_MISSING_INODE_TABLE (2133571387L)
+#define EXT2_ET_CORRUPT_SUPERBLOCK (2133571388L)
+#define EXT2_ET_BAD_GENERIC_MARK (2133571389L)
+#define EXT2_ET_BAD_GENERIC_UNMARK (2133571390L)
+#define EXT2_ET_BAD_GENERIC_TEST (2133571391L)
+#define EXT2_ET_SYMLINK_LOOP (2133571392L)
+#define EXT2_ET_CALLBACK_NOTHANDLED (2133571393L)
+#define EXT2_ET_BAD_BLOCK_IN_INODE_TABLE (2133571394L)
+#define EXT2_ET_UNSUPP_FEATURE (2133571395L)
+#define EXT2_ET_RO_UNSUPP_FEATURE (2133571396L)
+#define EXT2_ET_LLSEEK_FAILED (2133571397L)
+#define EXT2_ET_NO_MEMORY (2133571398L)
+#define EXT2_ET_INVALID_ARGUMENT (2133571399L)
+#define EXT2_ET_BLOCK_ALLOC_FAIL (2133571400L)
+#define EXT2_ET_INODE_ALLOC_FAIL (2133571401L)
+#define EXT2_ET_NO_DIRECTORY (2133571402L)
+#define EXT2_ET_TOO_MANY_REFS (2133571403L)
+#define EXT2_ET_FILE_NOT_FOUND (2133571404L)
+#define EXT2_ET_FILE_RO (2133571405L)
+#define EXT2_ET_DB_NOT_FOUND (2133571406L)
+#define EXT2_ET_DIR_EXISTS (2133571407L)
+#define EXT2_ET_UNIMPLEMENTED (2133571408L)
+#define EXT2_ET_CANCEL_REQUESTED (2133571409L)
+#define EXT2_ET_FILE_TOO_BIG (2133571410L)
+#define EXT2_ET_JOURNAL_NOT_BLOCK (2133571411L)
+#define EXT2_ET_NO_JOURNAL_SB (2133571412L)
+#define EXT2_ET_JOURNAL_TOO_SMALL (2133571413L)
+#define EXT2_ET_JOURNAL_UNSUPP_VERSION (2133571414L)
+#define EXT2_ET_LOAD_EXT_JOURNAL (2133571415L)
+#define EXT2_ET_NO_JOURNAL (2133571416L)
+#define EXT2_ET_DIRHASH_UNSUPP (2133571417L)
+#define EXT2_ET_BAD_EA_BLOCK_NUM (2133571418L)
+#define EXT2_ET_TOO_MANY_INODES (2133571419L)
+#define EXT2_ET_NOT_IMAGE_FILE (2133571420L)
+#define EXT2_ET_RES_GDT_BLOCKS (2133571421L)
+#define EXT2_ET_RESIZE_INODE_CORRUPT (2133571422L)
+#define EXT2_ET_SET_BMAP_NO_IND (2133571423L)
+#define EXT2_ET_TDB_SUCCESS (2133571424L)
+#define EXT2_ET_TDB_ERR_CORRUPT (2133571425L)
+#define EXT2_ET_TDB_ERR_IO (2133571426L)
+#define EXT2_ET_TDB_ERR_LOCK (2133571427L)
+#define EXT2_ET_TDB_ERR_OOM (2133571428L)
+#define EXT2_ET_TDB_ERR_EXISTS (2133571429L)
+#define EXT2_ET_TDB_ERR_NOLOCK (2133571430L)
+#define EXT2_ET_TDB_ERR_EINVAL (2133571431L)
+#define EXT2_ET_TDB_ERR_NOEXIST (2133571432L)
+#define EXT2_ET_TDB_ERR_RDONLY (2133571433L)
+#define EXT2_ET_DBLIST_EMPTY (2133571434L)
+#define EXT2_ET_RO_BLOCK_ITERATE (2133571435L)
+#define EXT2_ET_MAGIC_EXTENT_PATH (2133571436L)
+#define EXT2_ET_MAGIC_GENERIC_BITMAP64 (2133571437L)
+#define EXT2_ET_MAGIC_BLOCK_BITMAP64 (2133571438L)
+#define EXT2_ET_MAGIC_INODE_BITMAP64 (2133571439L)
+#define EXT2_ET_MAGIC_RESERVED_13 (2133571440L)
+#define EXT2_ET_MAGIC_RESERVED_14 (2133571441L)
+#define EXT2_ET_MAGIC_RESERVED_15 (2133571442L)
+#define EXT2_ET_MAGIC_RESERVED_16 (2133571443L)
+#define EXT2_ET_MAGIC_RESERVED_17 (2133571444L)
+#define EXT2_ET_MAGIC_RESERVED_18 (2133571445L)
+#define EXT2_ET_MAGIC_RESERVED_19 (2133571446L)
+#define EXT2_ET_EXTENT_HEADER_BAD (2133571447L)
+#define EXT2_ET_EXTENT_INDEX_BAD (2133571448L)
+#define EXT2_ET_EXTENT_LEAF_BAD (2133571449L)
+#define EXT2_ET_EXTENT_NO_SPACE (2133571450L)
+#define EXT2_ET_INODE_NOT_EXTENT (2133571451L)
+#define EXT2_ET_EXTENT_NO_NEXT (2133571452L)
+#define EXT2_ET_EXTENT_NO_PREV (2133571453L)
+#define EXT2_ET_EXTENT_NO_UP (2133571454L)
+#define EXT2_ET_EXTENT_NO_DOWN (2133571455L)
+#define EXT2_ET_NO_CURRENT_NODE (2133571456L)
+#define EXT2_ET_OP_NOT_SUPPORTED (2133571457L)
+#define EXT2_ET_CANT_INSERT_EXTENT (2133571458L)
+#define EXT2_ET_CANT_SPLIT_EXTENT (2133571459L)
+#define EXT2_ET_EXTENT_NOT_FOUND (2133571460L)
+#define EXT2_ET_EXTENT_NOT_SUPPORTED (2133571461L)
+#define EXT2_ET_EXTENT_INVALID_LENGTH (2133571462L)
+#define EXT2_ET_IO_CHANNEL_NO_SUPPORT_64 (2133571463L)
+#define EXT2_ET_NO_MTAB_FILE (2133571464L)
+#define EXT2_ET_CANT_USE_LEGACY_BITMAPS (2133571465L)
+#define EXT2_ET_MMP_MAGIC_INVALID (2133571466L)
+#define EXT2_ET_MMP_FAILED (2133571467L)
+#define EXT2_ET_MMP_FSCK_ON (2133571468L)
+#define EXT2_ET_MMP_BAD_BLOCK (2133571469L)
+#define EXT2_ET_MMP_UNKNOWN_SEQ (2133571470L)
+#define EXT2_ET_MMP_CHANGE_ABORT (2133571471L)
+#define EXT2_ET_MMP_OPEN_DIRECT (2133571472L)
+#define EXT2_ET_BAD_DESC_SIZE (2133571473L)
+#define EXT2_ET_INODE_CSUM_INVALID (2133571474L)
+#define EXT2_ET_INODE_BITMAP_CSUM_INVALID (2133571475L)
+#define EXT2_ET_EXTENT_CSUM_INVALID (2133571476L)
+#define EXT2_ET_DIR_NO_SPACE_FOR_CSUM (2133571477L)
+#define EXT2_ET_DIR_CSUM_INVALID (2133571478L)
+#define EXT2_ET_EXT_ATTR_CSUM_INVALID (2133571479L)
+#define EXT2_ET_SB_CSUM_INVALID (2133571480L)
+#define EXT2_ET_UNKNOWN_CSUM (2133571481L)
+#define EXT2_ET_MMP_CSUM_INVALID (2133571482L)
+#define EXT2_ET_FILE_EXISTS (2133571483L)
+extern const struct error_table et_ext2_error_table;
+extern void initialize_ext2_error_table(void);
+
+/* For compatibility with Heimdal */
+extern void initialize_ext2_error_table_r(struct et_list **list);
+
+#define ERROR_TABLE_BASE_ext2 (2133571328L)
+
+/* for compatibility with older versions... */
+#define init_ext2_err_tbl initialize_ext2_error_table
+#define ext2_err_base ERROR_TABLE_BASE_ext2
diff --git a/lib/ext2fs/ext2_types.h b/lib/ext2fs/ext2_types.h
new file mode 100644
index 00000000..18d4f9bd
--- /dev/null
+++ b/lib/ext2fs/ext2_types.h
@@ -0,0 +1,137 @@
+/*
+ * If linux/types.h is already been included, assume it has defined
+ * everything we need. (cross fingers) Other header files may have
+ * also defined the types that we need.
+ */
+#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \
+ !defined(_EXT2_TYPES_H))
+#define _EXT2_TYPES_H
+
+
+#ifdef __U8_TYPEDEF
+typedef __U8_TYPEDEF __u8;
+#else
+typedef unsigned char __u8;
+#endif
+
+#ifdef __S8_TYPEDEF
+typedef __S8_TYPEDEF __s8;
+#else
+typedef signed char __s8;
+#endif
+
+#ifdef __U16_TYPEDEF
+typedef __U16_TYPEDEF __u16;
+#else
+#if (4 == 2)
+typedef unsigned int __u16;
+#else
+#if (2 == 2)
+typedef unsigned short __u16;
+#else
+ ?==error: undefined 16 bit type
+#endif /* SIZEOF_SHORT == 2 */
+#endif /* SIZEOF_INT == 2 */
+#endif /* __U16_TYPEDEF */
+
+#ifdef __S16_TYPEDEF
+typedef __S16_TYPEDEF __s16;
+#else
+#if (4 == 2)
+typedef int __s16;
+#else
+#if (2 == 2)
+typedef short __s16;
+#else
+ ?==error: undefined 16 bit type
+#endif /* SIZEOF_SHORT == 2 */
+#endif /* SIZEOF_INT == 2 */
+#endif /* __S16_TYPEDEF */
+
+
+#ifdef __U32_TYPEDEF
+typedef __U32_TYPEDEF __u32;
+#else
+#if (4 == 4)
+typedef unsigned int __u32;
+#else
+#if (4 == 4)
+typedef unsigned long __u32;
+#else
+#if (2 == 4)
+typedef unsigned short __u32;
+#else
+ ?== error: undefined 32 bit type
+#endif /* SIZEOF_SHORT == 4 */
+#endif /* SIZEOF_LONG == 4 */
+#endif /* SIZEOF_INT == 4 */
+#endif /* __U32_TYPEDEF */
+
+#ifdef __S32_TYPEDEF
+typedef __S32_TYPEDEF __s32;
+#else
+#if (4 == 4)
+typedef int __s32;
+#else
+#if (4 == 4)
+typedef long __s32;
+#else
+#if (2 == 4)
+typedef short __s32;
+#else
+ ?== error: undefined 32 bit type
+#endif /* SIZEOF_SHORT == 4 */
+#endif /* SIZEOF_LONG == 4 */
+#endif /* SIZEOF_INT == 4 */
+#endif /* __S32_TYPEDEF */
+
+#ifdef __U64_TYPEDEF
+typedef __U64_TYPEDEF __u64;
+#else
+#if (4 == 8)
+typedef unsigned int __u64;
+#else
+#if (8 == 8)
+typedef unsigned long long __u64;
+#else
+#if (4 == 8)
+typedef unsigned long __u64;
+#endif /* SIZEOF_LONG_LONG == 8 */
+#endif /* SIZEOF_LONG == 8 */
+#endif /* SIZEOF_INT == 8 */
+#endif /* __U64_TYPEDEF */
+
+#ifdef __S64_TYPEDEF
+typedef __S64_TYPEDEF __s64;
+#else
+#if (4 == 8)
+typedef int __s64;
+#else
+#if (8 == 8)
+#if defined(__GNUC__)
+typedef __signed__ long long __s64;
+#else
+typedef signed long long __s64;
+#endif /* __GNUC__ */
+#else
+#if (4 == 8)
+typedef long __s64;
+#endif /* SIZEOF_LONG_LONG == 8 */
+#endif /* SIZEOF_LONG == 8 */
+#endif /* SIZEOF_INT == 8 */
+#endif /* __S64_TYPEDEF */
+
+#undef __S8_TYPEDEF
+#undef __U8_TYPEDEF
+#undef __S16_TYPEDEF
+#undef __U16_TYPEDEF
+#undef __S32_TYPEDEF
+#undef __U32_TYPEDEF
+#undef __S64_TYPEDEF
+#undef __U64_TYPEDEF
+
+#endif /* _*_TYPES_H */
+
+/* These defines are needed for the public ext2fs.h header file */
+#define HAVE_SYS_TYPES_H 1
+#undef WORDS_BIGENDIAN
diff --git a/lib/ext2fs/ext_attr.c b/lib/ext2fs/ext_attr.c
index 1889824c..ddcc89f7 100644
--- a/lib/ext2fs/ext_attr.c
+++ b/lib/ext2fs/ext_attr.c
@@ -11,7 +11,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c
index 5cdc2e49..fc6c95b8 100644
--- a/lib/ext2fs/extent.c
+++ b/lib/ext2fs/extent.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/fileio.c b/lib/ext2fs/fileio.c
index 5a39c321..2e1b6824 100644
--- a/lib/ext2fs/fileio.c
+++ b/lib/ext2fs/fileio.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/finddev.c b/lib/ext2fs/finddev.c
index 311608de..88eb5cee 100644
--- a/lib/ext2fs/finddev.c
+++ b/lib/ext2fs/finddev.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/flushb.c b/lib/ext2fs/flushb.c
index 98821fc7..c4406fd1 100644
--- a/lib/ext2fs/flushb.c
+++ b/lib/ext2fs/flushb.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#if HAVE_ERRNO_H
#include <errno.h>
diff --git a/lib/ext2fs/freefs.c b/lib/ext2fs/freefs.c
index 1ad2d916..1e01ef5f 100644
--- a/lib/ext2fs/freefs.c
+++ b/lib/ext2fs/freefs.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/gen_bitmap.c b/lib/ext2fs/gen_bitmap.c
index 0bff8546..e4362345 100644
--- a/lib/ext2fs/gen_bitmap.c
+++ b/lib/ext2fs/gen_bitmap.c
@@ -10,7 +10,6 @@
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/gen_bitmap64.c b/lib/ext2fs/gen_bitmap64.c
index 9ba77017..7f49fd9d 100644
--- a/lib/ext2fs/gen_bitmap64.c
+++ b/lib/ext2fs/gen_bitmap64.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/get_pathname.c b/lib/ext2fs/get_pathname.c
index 52aea624..93a9ec81 100644
--- a/lib/ext2fs/get_pathname.c
+++ b/lib/ext2fs/get_pathname.c
@@ -21,7 +21,6 @@
*
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/getsectsize.c b/lib/ext2fs/getsectsize.c
index 9c3f4a2e..c7ae6594 100644
--- a/lib/ext2fs/getsectsize.c
+++ b/lib/ext2fs/getsectsize.c
@@ -13,7 +13,6 @@
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
-#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/getsize.c b/lib/ext2fs/getsize.c
index a9a4812e..2f4495ed 100644
--- a/lib/ext2fs/getsize.c
+++ b/lib/ext2fs/getsize.c
@@ -15,7 +15,6 @@
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
-#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/i_block.c b/lib/ext2fs/i_block.c
index 5ca57e49..f36c3c47 100644
--- a/lib/ext2fs/i_block.c
+++ b/lib/ext2fs/i_block.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/icount.c b/lib/ext2fs/icount.c
index c5ebf744..f99824f8 100644
--- a/lib/ext2fs/icount.c
+++ b/lib/ext2fs/icount.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/lib/ext2fs/imager.c b/lib/ext2fs/imager.c
index 378a3c88..5c7003a6 100644
--- a/lib/ext2fs/imager.c
+++ b/lib/ext2fs/imager.c
@@ -13,7 +13,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/ind_block.c b/lib/ext2fs/ind_block.c
index aa82ae6b..722d3bdc 100644
--- a/lib/ext2fs/ind_block.c
+++ b/lib/ext2fs/ind_block.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c
index 2db8b3c2..a57ffcb5 100644
--- a/lib/ext2fs/initialize.c
+++ b/lib/ext2fs/initialize.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/inline.c b/lib/ext2fs/inline.c
index 05da1f79..4d0f4ad1 100644
--- a/lib/ext2fs/inline.c
+++ b/lib/ext2fs/inline.c
@@ -15,7 +15,6 @@
#define _XOPEN_SOURCE 600 /* for posix_memalign() */
#endif
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
@@ -29,7 +28,7 @@
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#if HAVE_MALLOC_H
+#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c
index 573a8fa5..d0b528cf 100644
--- a/lib/ext2fs/inode.c
+++ b/lib/ext2fs/inode.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/inode_io.c b/lib/ext2fs/inode_io.c
index 8e0944ef..ced32448 100644
--- a/lib/ext2fs/inode_io.c
+++ b/lib/ext2fs/inode_io.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/io_manager.c b/lib/ext2fs/io_manager.c
index 34e48592..116f2aea 100644
--- a/lib/ext2fs/io_manager.c
+++ b/lib/ext2fs/io_manager.c
@@ -2,7 +2,6 @@
* io_manager.c --- the I/O manager abstraction
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/irel_ma.c b/lib/ext2fs/irel_ma.c
index c64b7e76..b0557906 100644
--- a/lib/ext2fs/irel_ma.c
+++ b/lib/ext2fs/irel_ma.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c
index 6c6ecff0..db80c460 100644
--- a/lib/ext2fs/ismounted.c
+++ b/lib/ext2fs/ismounted.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/link.c b/lib/ext2fs/link.c
index bf3c859a..8c5553c9 100644
--- a/lib/ext2fs/link.c
+++ b/lib/ext2fs/link.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/llseek.c b/lib/ext2fs/llseek.c
index c3a98a2c..774d1d4d 100644
--- a/lib/ext2fs/llseek.c
+++ b/lib/ext2fs/llseek.c
@@ -12,7 +12,6 @@
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
-#include "config.h"
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
diff --git a/lib/ext2fs/lookup.c b/lib/ext2fs/lookup.c
index 0e66e712..97aa0887 100644
--- a/lib/ext2fs/lookup.c
+++ b/lib/ext2fs/lookup.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/mkdir.c b/lib/ext2fs/mkdir.c
index b12bf2dd..9b6b7996 100644
--- a/lib/ext2fs/mkdir.c
+++ b/lib/ext2fs/mkdir.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c
index d09c4589..02ffb97c 100644
--- a/lib/ext2fs/mkjournal.c
+++ b/lib/ext2fs/mkjournal.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/mmp.c b/lib/ext2fs/mmp.c
index e4c7dccd..a9eae504 100644
--- a/lib/ext2fs/mmp.c
+++ b/lib/ext2fs/mmp.c
@@ -13,7 +13,6 @@
#define _GNU_SOURCE
#endif
-#include "config.h"
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/namei.c b/lib/ext2fs/namei.c
index 307aecc8..dd710b89 100644
--- a/lib/ext2fs/namei.c
+++ b/lib/ext2fs/namei.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/native.c b/lib/ext2fs/native.c
index ba3e0c8e..c71a95ee 100644
--- a/lib/ext2fs/native.c
+++ b/lib/ext2fs/native.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include "ext2_fs.h"
diff --git a/lib/ext2fs/newdir.c b/lib/ext2fs/newdir.c
index 3e2c0dbe..bccaecdb 100644
--- a/lib/ext2fs/newdir.c
+++ b/lib/ext2fs/newdir.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/nt_io.c b/lib/ext2fs/nt_io.c
index 0f10543a..a29e1d49 100644
--- a/lib/ext2fs/nt_io.c
+++ b/lib/ext2fs/nt_io.c
@@ -13,7 +13,6 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
#endif
diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
index 4cdbde16..45b3627e 100644
--- a/lib/ext2fs/openfs.c
+++ b/lib/ext2fs/openfs.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/progress.c b/lib/ext2fs/progress.c
index 8c9a6f1d..ad6a3d4d 100644
--- a/lib/ext2fs/progress.c
+++ b/lib/ext2fs/progress.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include "ext2fs.h"
#include "ext2fsP.h"
diff --git a/lib/ext2fs/punch.c b/lib/ext2fs/punch.c
index 25d79532..adfcdecb 100644
--- a/lib/ext2fs/punch.c
+++ b/lib/ext2fs/punch.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/qcow2.c b/lib/ext2fs/qcow2.c
index 547edc02..9d56ae58 100644
--- a/lib/ext2fs/qcow2.c
+++ b/lib/ext2fs/qcow2.c
@@ -26,7 +26,6 @@
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
-#include "config.h"
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
diff --git a/lib/ext2fs/read_bb.c b/lib/ext2fs/read_bb.c
index b5a0d7b4..e5d63227 100644
--- a/lib/ext2fs/read_bb.c
+++ b/lib/ext2fs/read_bb.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/read_bb_file.c b/lib/ext2fs/read_bb_file.c
index 8d1ad1a5..89c567bb 100644
--- a/lib/ext2fs/read_bb_file.c
+++ b/lib/ext2fs/read_bb_file.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/res_gdt.c b/lib/ext2fs/res_gdt.c
index 6449228c..acce650d 100644
--- a/lib/ext2fs/res_gdt.c
+++ b/lib/ext2fs/res_gdt.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#include <time.h>
diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c
index b7d65a9d..eacf86a5 100644
--- a/lib/ext2fs/rw_bitmaps.c
+++ b/lib/ext2fs/rw_bitmaps.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/swapfs.c b/lib/ext2fs/swapfs.c
index 56c66cc4..46d60ef4 100644
--- a/lib/ext2fs/swapfs.c
+++ b/lib/ext2fs/swapfs.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/symlink.c b/lib/ext2fs/symlink.c
index ad804441..4478dffe 100644
--- a/lib/ext2fs/symlink.c
+++ b/lib/ext2fs/symlink.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/tdb.c b/lib/ext2fs/tdb.c
index 61e30ed2..869c4057 100644
--- a/lib/ext2fs/tdb.c
+++ b/lib/ext2fs/tdb.c
@@ -38,7 +38,6 @@ Last Changed Date: 2007-06-22 13:36:10 -0400 (Fri, 22 Jun 2007)
#endif
#define _XOPEN_SOURCE 600
-#include "config.h"
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/lib/ext2fs/tdbtool.c b/lib/ext2fs/tdbtool.c
index eeac0c87..130fc588 100644
--- a/lib/ext2fs/tdbtool.c
+++ b/lib/ext2fs/tdbtool.c
@@ -21,7 +21,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include "config.h"
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/lib/ext2fs/test_io.c b/lib/ext2fs/test_io.c
index cac67219..d79c6d58 100644
--- a/lib/ext2fs/test_io.c
+++ b/lib/ext2fs/test_io.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#if HAVE_SECURE_GETENV
#define _GNU_SOURCE
#endif
diff --git a/lib/ext2fs/tst_badblocks.c b/lib/ext2fs/tst_badblocks.c
index 3b39ef13..717b95b9 100644
--- a/lib/ext2fs/tst_badblocks.c
+++ b/lib/ext2fs/tst_badblocks.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/tst_bitmaps.c b/lib/ext2fs/tst_bitmaps.c
index 57bfd6c8..d433e77d 100644
--- a/lib/ext2fs/tst_bitmaps.c
+++ b/lib/ext2fs/tst_bitmaps.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/lib/ext2fs/tst_bitops.c b/lib/ext2fs/tst_bitops.c
index ed71447c..b64735cd 100644
--- a/lib/ext2fs/tst_bitops.c
+++ b/lib/ext2fs/tst_bitops.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/tst_byteswap.c b/lib/ext2fs/tst_byteswap.c
index c500cae3..d0f2ee42 100644
--- a/lib/ext2fs/tst_byteswap.c
+++ b/lib/ext2fs/tst_byteswap.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/tst_getsectsize.c b/lib/ext2fs/tst_getsectsize.c
index a6b234e0..5591b5d3 100644
--- a/lib/ext2fs/tst_getsectsize.c
+++ b/lib/ext2fs/tst_getsectsize.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/tst_getsize.c b/lib/ext2fs/tst_getsize.c
index 4ac2ea1f..9a578fab 100644
--- a/lib/ext2fs/tst_getsize.c
+++ b/lib/ext2fs/tst_getsize.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/tst_inode_size.c b/lib/ext2fs/tst_inode_size.c
index e20ec981..3f0ab82c 100644
--- a/lib/ext2fs/tst_inode_size.c
+++ b/lib/ext2fs/tst_inode_size.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/lib/ext2fs/tst_iscan.c b/lib/ext2fs/tst_iscan.c
index 70bfbecc..efeeb772 100644
--- a/lib/ext2fs/tst_iscan.c
+++ b/lib/ext2fs/tst_iscan.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/tst_super_size.c b/lib/ext2fs/tst_super_size.c
index 85d87e12..eef5a630 100644
--- a/lib/ext2fs/tst_super_size.c
+++ b/lib/ext2fs/tst_super_size.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/lib/ext2fs/tst_types.c b/lib/ext2fs/tst_types.c
index 3e411288..5274984c 100644
--- a/lib/ext2fs/tst_types.c
+++ b/lib/ext2fs/tst_types.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/lib/ext2fs/undo_io.c b/lib/ext2fs/undo_io.c
index 56b0eeb5..df55abf3 100644
--- a/lib/ext2fs/undo_io.c
+++ b/lib/ext2fs/undo_io.c
@@ -14,7 +14,6 @@
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c
index 19be6308..419564fe 100644
--- a/lib/ext2fs/unix_io.c
+++ b/lib/ext2fs/unix_io.c
@@ -21,7 +21,6 @@
#define _GNU_SOURCE
#endif
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/unlink.c b/lib/ext2fs/unlink.c
index d2d31cc4..7ffeb9e8 100644
--- a/lib/ext2fs/unlink.c
+++ b/lib/ext2fs/unlink.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
diff --git a/lib/ext2fs/valid_blk.c b/lib/ext2fs/valid_blk.c
index 895e36ef..7c3defc7 100644
--- a/lib/ext2fs/valid_blk.c
+++ b/lib/ext2fs/valid_blk.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/ext2fs/version.c b/lib/ext2fs/version.c
index f8c8acfc..ab406fea 100644
--- a/lib/ext2fs/version.c
+++ b/lib/ext2fs/version.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/lib/ext2fs/write_bb_file.c b/lib/ext2fs/write_bb_file.c
index 58343408..70bcf08e 100644
--- a/lib/ext2fs/write_bb_file.c
+++ b/lib/ext2fs/write_bb_file.c
@@ -9,7 +9,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include "ext2_fs.h"
diff --git a/lib/fpopen.c b/lib/fpopen.c
index 60af2086..0df25e4e 100644
--- a/lib/fpopen.c
+++ b/lib/fpopen.c
@@ -21,7 +21,6 @@
* USE OF THIS SOFTWARE.
*/
-#include "config.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/lib/quota/Android.mk b/lib/quota/Android.mk
new file mode 100644
index 00000000..8d0bfc32
--- /dev/null
+++ b/lib/quota/Android.mk
@@ -0,0 +1,61 @@
+LOCAL_PATH := $(call my-dir)
+
+libext2_quota_src_files := \
+ mkquota.c \
+ quotaio.c \
+ quotaio_tree.c \
+ quotaio_v2.c \
+ ../../e2fsck/dict.c
+
+libext2_quota_c_includes := external/e2fsprogs/lib
+
+libext2_quota_cflags := -O2 -g -W -Wall \
+ -DHAVE_UNISTD_H \
+ -DHAVE_ERRNO_H \
+ -DHAVE_NETINET_IN_H \
+ -DHAVE_SYS_IOCTL_H \
+ -DHAVE_SYS_MMAN_H \
+ -DHAVE_SYS_MOUNT_H \
+ -DHAVE_SYS_PRCTL_H \
+ -DHAVE_SYS_RESOURCE_H \
+ -DHAVE_SYS_SELECT_H \
+ -DHAVE_SYS_STAT_H \
+ -DHAVE_SYS_TYPES_H \
+ -DHAVE_STDLIB_H \
+ -DHAVE_STRDUP \
+ -DHAVE_MMAP \
+ -DHAVE_UTIME_H \
+ -DHAVE_GETPAGESIZE \
+ -DHAVE_LSEEK64 \
+ -DHAVE_LSEEK64_PROTOTYPE \
+ -DHAVE_EXT2_IOCTLS \
+ -DHAVE_LINUX_FD_H \
+ -DHAVE_TYPE_SSIZE_T \
+ -DHAVE_SYS_TIME_H \
+ -DHAVE_SYS_PARAM_H \
+ -DHAVE_SYSCONF
+
+libext2_quota_shared_libraries := libext2fs libext2_com_err
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(libext2_quota_src_files)
+LOCAL_C_INCLUDES := $(libext2_quota_c_includes)
+LOCAL_CFLAGS := $(libext2_quota_cflags)
+LOCAL_SYSTEM_SHARED_LIBRARIES := libc $(libext2_quota_shared_libraries)
+LOCAL_PRELINK_MODULE := false
+LOCAL_MODULE := libext2_quota
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(libext2_quota_src_files)
+LOCAL_C_INCLUDES := $(libext2_quota_c_includes)
+LOCAL_CFLAGS := $(libext2_quota_cflags)
+LOCAL_MODULE := libext2_quota_host
+LOCAL_MODULE_TAGS := optional
+LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(libext2_quota_shared_libraries))
+
+include $(BUILD_HOST_SHARED_LIBRARY)
diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c
index 3aa81003..46e17b6c 100644
--- a/lib/quota/mkquota.c
+++ b/lib/quota/mkquota.c
@@ -3,7 +3,6 @@
*
* Aditya Kali <adityakali@google.com>
*/
-#include "config.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
diff --git a/lib/quota/quotaio.c b/lib/quota/quotaio.c
index 1bdcba6c..b518bc86 100644
--- a/lib/quota/quotaio.c
+++ b/lib/quota/quotaio.c
@@ -5,7 +5,6 @@
* Aditya Kali <adityakali@google.com> - Ported to e2fsprogs
*/
-#include "config.h"
#include <stdio.h>
#include <errno.h>
#include <string.h>
diff --git a/lib/quota/quotaio_tree.c b/lib/quota/quotaio_tree.c
index c1653a39..964494d1 100644
--- a/lib/quota/quotaio_tree.c
+++ b/lib/quota/quotaio_tree.c
@@ -4,7 +4,6 @@
* Jan Kara <jack@suse.cz> - sponsored by SuSE CR
*/
-#include "config.h"
#include <sys/types.h>
#include <errno.h>
#include <stdio.h>
diff --git a/lib/quota/quotaio_v2.c b/lib/quota/quotaio_v2.c
index e7bf29c3..de53e7d4 100644
--- a/lib/quota/quotaio_v2.c
+++ b/lib/quota/quotaio_v2.c
@@ -4,7 +4,6 @@
* Jan Kara <jack@suse.cz> - sponsored by SuSE CR
*/
-#include "config.h"
#include <sys/types.h>
#include <errno.h>
#include <stdio.h>
diff --git a/lib/ss/data.c b/lib/ss/data.c
index 80d1b295..8f7cda59 100644
--- a/lib/ss/data.c
+++ b/lib/ss/data.c
@@ -12,7 +12,6 @@
* express or implied warranty.
*/
-#include "config.h"
#include <stdio.h>
#include "ss_internal.h"
diff --git a/lib/ss/error.c b/lib/ss/error.c
index 8d345a9f..c7ebc4a2 100644
--- a/lib/ss/error.c
+++ b/lib/ss/error.c
@@ -12,7 +12,6 @@
* express or implied warranty.
*/
-#include "config.h"
#include <stdio.h>
#include "et/com_err.h"
diff --git a/lib/ss/execute_cmd.c b/lib/ss/execute_cmd.c
index d443a468..02dfbfde 100644
--- a/lib/ss/execute_cmd.c
+++ b/lib/ss/execute_cmd.c
@@ -11,7 +11,6 @@
* express or implied warranty.
*/
-#include "config.h"
#ifdef HAS_STDLIB_H
#include <stdlib.h>
#endif
diff --git a/lib/ss/get_readline.c b/lib/ss/get_readline.c
index 8da85f12..4421052d 100644
--- a/lib/ss/get_readline.c
+++ b/lib/ss/get_readline.c
@@ -11,7 +11,6 @@
* express or implied warranty.
*/
-#include "config.h"
#ifdef HAS_STDLIB_H
#include <stdlib.h>
#endif
diff --git a/lib/ss/help.c b/lib/ss/help.c
index 5204401b..fbc040f8 100644
--- a/lib/ss/help.c
+++ b/lib/ss/help.c
@@ -11,7 +11,6 @@
* express or implied warranty.
*/
-#include "config.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/lib/ss/invocation.c b/lib/ss/invocation.c
index 61c2e350..57666ecc 100644
--- a/lib/ss/invocation.c
+++ b/lib/ss/invocation.c
@@ -11,7 +11,6 @@
* express or implied warranty.
*/
-#include "config.h"
#ifdef HAS_STDLIB_H
#include <stdlib.h>
#endif
diff --git a/lib/ss/list_rqs.c b/lib/ss/list_rqs.c
index 6baed419..220534c7 100644
--- a/lib/ss/list_rqs.c
+++ b/lib/ss/list_rqs.c
@@ -10,7 +10,6 @@
* this software for any purpose. It is provided "as is" without
* express or implied warranty.
*/
-#include "config.h"
#include "ss_internal.h"
#include <signal.h>
#include <setjmp.h>
diff --git a/lib/ss/listen.c b/lib/ss/listen.c
index 9578c3e8..bd7c8c09 100644
--- a/lib/ss/listen.c
+++ b/lib/ss/listen.c
@@ -16,7 +16,6 @@
* express or implied warranty.
*/
-#include "config.h"
#include "ss_internal.h"
#include <stdio.h>
#include <setjmp.h>
diff --git a/lib/ss/pager.c b/lib/ss/pager.c
index 330249ec..bb149d69 100644
--- a/lib/ss/pager.c
+++ b/lib/ss/pager.c
@@ -14,7 +14,6 @@
* express or implied warranty.
*/
-#include "config.h"
#if HAVE_SECURE_GETENV
#define _GNU_SOURCE
#endif
diff --git a/lib/ss/parse.c b/lib/ss/parse.c
index e2928e22..54b768b8 100644
--- a/lib/ss/parse.c
+++ b/lib/ss/parse.c
@@ -11,7 +11,6 @@
* express or implied warranty.
*/
-#include "config.h"
#ifdef HAS_STDLIB_H
#include <stdlib.h>
#endif
diff --git a/lib/ss/prompt.c b/lib/ss/prompt.c
index c56c2a09..6fe42637 100644
--- a/lib/ss/prompt.c
+++ b/lib/ss/prompt.c
@@ -16,7 +16,6 @@
* express or implied warranty.
*/
-#include "config.h"
#include <stdio.h>
#include "ss_internal.h"
diff --git a/lib/ss/request_tbl.c b/lib/ss/request_tbl.c
index 135cb28b..16cb4213 100644
--- a/lib/ss/request_tbl.c
+++ b/lib/ss/request_tbl.c
@@ -11,7 +11,6 @@
* express or implied warranty.
*/
-#include "config.h"
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/lib/ss/requests.c b/lib/ss/requests.c
index 33ce5d20..2e061000 100644
--- a/lib/ss/requests.c
+++ b/lib/ss/requests.c
@@ -13,7 +13,6 @@
* express or implied warranty.
*/
-#include "config.h"
#include <stdio.h>
#include "ss_internal.h"
diff --git a/lib/ss/test_ss.c b/lib/ss/test_ss.c
index 53ca99fc..41d84ea7 100644
--- a/lib/ss/test_ss.c
+++ b/lib/ss/test_ss.c
@@ -14,7 +14,6 @@
*/
-#include "config.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/lib/uuid/clear.c b/lib/uuid/clear.c
index 436f8f78..2d91fee9 100644
--- a/lib/uuid/clear.c
+++ b/lib/uuid/clear.c
@@ -32,7 +32,6 @@
* %End-Header%
*/
-#include "config.h"
#include "string.h"
#include "uuidP.h"
diff --git a/lib/uuid/compare.c b/lib/uuid/compare.c
index d5fc5037..f28a7267 100644
--- a/lib/uuid/compare.c
+++ b/lib/uuid/compare.c
@@ -34,7 +34,6 @@
* %End-Header%
*/
-#include "config.h"
#include "uuidP.h"
#include <string.h>
diff --git a/lib/uuid/copy.c b/lib/uuid/copy.c
index 32e6f502..ead33aa2 100644
--- a/lib/uuid/copy.c
+++ b/lib/uuid/copy.c
@@ -32,7 +32,6 @@
* %End-Header%
*/
-#include "config.h"
#include "uuidP.h"
void uuid_copy(uuid_t dst, const uuid_t src)
diff --git a/lib/uuid/gen_uuid.c b/lib/uuid/gen_uuid.c
index 1b23d112..ddc14d71 100644
--- a/lib/uuid/gen_uuid.c
+++ b/lib/uuid/gen_uuid.c
@@ -38,7 +38,6 @@
*/
#define _SVID_SOURCE
-#include "config.h"
#ifdef _WIN32
#define _WIN32_WINNT 0x0500
diff --git a/lib/uuid/gen_uuid_nt.c b/lib/uuid/gen_uuid_nt.c
index 79a40507..aa44bfd3 100644
--- a/lib/uuid/gen_uuid_nt.c
+++ b/lib/uuid/gen_uuid_nt.c
@@ -5,7 +5,6 @@
*/
-#include "config.h"
#include "uuidP.h"
#pragma warning(push,4)
diff --git a/lib/uuid/isnull.c b/lib/uuid/isnull.c
index 170c9a20..931e7e7d 100644
--- a/lib/uuid/isnull.c
+++ b/lib/uuid/isnull.c
@@ -32,7 +32,6 @@
* %End-Header%
*/
-#include "config.h"
#include "uuidP.h"
/* Returns 1 if the uuid is the NULL uuid */
diff --git a/lib/uuid/pack.c b/lib/uuid/pack.c
index 3db21aef..097516d2 100644
--- a/lib/uuid/pack.c
+++ b/lib/uuid/pack.c
@@ -32,7 +32,6 @@
* %End-Header%
*/
-#include "config.h"
#include <string.h>
#include "uuidP.h"
diff --git a/lib/uuid/parse.c b/lib/uuid/parse.c
index 4c0857df..074383ef 100644
--- a/lib/uuid/parse.c
+++ b/lib/uuid/parse.c
@@ -32,7 +32,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
diff --git a/lib/uuid/tst_uuid.c b/lib/uuid/tst_uuid.c
index 33fb80b9..8c1b6552 100644
--- a/lib/uuid/tst_uuid.c
+++ b/lib/uuid/tst_uuid.c
@@ -32,7 +32,6 @@
* %End-Header%
*/
-#include "config.h"
#ifdef _WIN32
#define _WIN32_WINNT 0x0500
diff --git a/lib/uuid/unpack.c b/lib/uuid/unpack.c
index 2c8043df..beaaff3c 100644
--- a/lib/uuid/unpack.c
+++ b/lib/uuid/unpack.c
@@ -32,7 +32,6 @@
* %End-Header%
*/
-#include "config.h"
#include <string.h>
#include "uuidP.h"
diff --git a/lib/uuid/unparse.c b/lib/uuid/unparse.c
index c556ae63..a95bbb04 100644
--- a/lib/uuid/unparse.c
+++ b/lib/uuid/unparse.c
@@ -32,7 +32,6 @@
* %End-Header%
*/
-#include "config.h"
#include <stdio.h>
#include "uuidP.h"
diff --git a/lib/uuid/uuid.h b/lib/uuid/uuid.h
new file mode 100644
index 00000000..ca846da0
--- /dev/null
+++ b/lib/uuid/uuid.h
@@ -0,0 +1,103 @@
+/*
+ * Public include file for the UUID library
+ *
+ * Copyright (C) 1996, 1997, 1998 Theodore Ts'o.
+ *
+ * %Begin-Header%
+ * 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, and the entire permission notice in its entirety,
+ * including the disclaimer of warranties.
+ * 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 not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF
+ * WHICH ARE HEREBY 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 NOT ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ * %End-Header%
+ */
+
+#ifndef _UUID_UUID_H
+#define _UUID_UUID_H
+
+#include <sys/types.h>
+#ifndef _WIN32
+#include <sys/time.h>
+#endif
+#include <time.h>
+
+typedef unsigned char uuid_t[16];
+
+/* UUID Variant definitions */
+#define UUID_VARIANT_NCS 0
+#define UUID_VARIANT_DCE 1
+#define UUID_VARIANT_MICROSOFT 2
+#define UUID_VARIANT_OTHER 3
+
+/* UUID Type definitions */
+#define UUID_TYPE_DCE_TIME 1
+#define UUID_TYPE_DCE_RANDOM 4
+
+/* Allow UUID constants to be defined */
+#ifdef __GNUC__
+#define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) \
+ static const uuid_t name __attribute__ ((unused)) = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15}
+#else
+#define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) \
+ static const uuid_t name = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15}
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* clear.c */
+void uuid_clear(uuid_t uu);
+
+/* compare.c */
+int uuid_compare(const uuid_t uu1, const uuid_t uu2);
+
+/* copy.c */
+void uuid_copy(uuid_t dst, const uuid_t src);
+
+/* gen_uuid.c */
+void uuid_generate(uuid_t out);
+void uuid_generate_random(uuid_t out);
+void uuid_generate_time(uuid_t out);
+
+/* isnull.c */
+int uuid_is_null(const uuid_t uu);
+
+/* parse.c */
+int uuid_parse(const char *in, uuid_t uu);
+
+/* unparse.c */
+void uuid_unparse(const uuid_t uu, char *out);
+void uuid_unparse_lower(const uuid_t uu, char *out);
+void uuid_unparse_upper(const uuid_t uu, char *out);
+
+/* uuid_time.c */
+time_t uuid_time(const uuid_t uu, struct timeval *ret_tv);
+int uuid_type(const uuid_t uu);
+int uuid_variant(const uuid_t uu);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _UUID_UUID_H */
diff --git a/lib/uuid/uuid_time.c b/lib/uuid/uuid_time.c
index 97fd3358..849427f1 100644
--- a/lib/uuid/uuid_time.c
+++ b/lib/uuid/uuid_time.c
@@ -34,8 +34,6 @@
* %End-Header%
*/
-#include "config.h"
-
#ifdef _WIN32
#define _WIN32_WINNT 0x0500
#include <windows.h>
diff --git a/lib/uuid/uuid_types.h b/lib/uuid/uuid_types.h
new file mode 100644
index 00000000..169a88a7
--- /dev/null
+++ b/lib/uuid/uuid_types.h
@@ -0,0 +1,50 @@
+/*
+ * If linux/types.h is already been included, assume it has defined
+ * everything we need. (cross fingers) Other header files may have
+ * also defined the types that we need.
+ */
+#if (!defined(_STDINT_H) && !defined(_UUID_STDINT_H))
+#define _UUID_STDINT_H
+
+typedef unsigned char uint8_t;
+typedef signed char int8_t;
+
+#if (4 == 8)
+typedef int int64_t;
+typedef unsigned int uint64_t;
+#elif (4 == 8)
+typedef long int64_t;
+typedef unsigned long uint64_t;
+#elif (8 == 8)
+#if defined(__GNUC__)
+typedef __signed__ long long int64_t;
+#else
+typedef signed long long int64_t;
+#endif
+typedef unsigned long long uint64_t;
+#endif
+
+#if (4 == 2)
+typedef int int16_t;
+typedef unsigned int uint16_t;
+#elif (2 == 2)
+typedef short int16_t;
+typedef unsigned short uint16_t;
+#else
+ ?==error: undefined 16 bit type
+#endif
+
+#if (4 == 4)
+typedef int int32_t;
+typedef unsigned int uint32_t;
+#elif (4 == 4)
+typedef long int32_t;
+typedef unsigned long uint32_t;
+#elif (2 == 4)
+typedef short int32_t;
+typedef unsigned short uint32_t;
+#else
+ ?== error: undefined 32 bit type
+#endif
+
+#endif