string = path_basename;
}
+ /* Warning: on Windows native builds, fnmatch() calls the
+ * replacement function in win32.c. */
if (fnmatch(pat, string, FNM_PATHNAME
#ifdef FNM_CASEFOLD
| FNM_CASEFOLD
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
-
#include <unistd.h>
#include "dentry.h"
static int apply_dentry_normal(struct wim_dentry *dentry, void *arg)
{
struct apply_args *args = arg;
- struct wim_inode *inode = dentry->d_inode;
size_t len;
char *output_path;
printf("Lookup Table Size = %"PRIu64"\n",
(u64)hdr->lookup_table_res_entry.size);
printf("Lookup Table Flags = 0x%hhx\n",
- hdr->lookup_table_res_entry.flags);
+ (u8)hdr->lookup_table_res_entry.flags);
printf("Lookup Table Offset = %"PRIu64"\n",
hdr->lookup_table_res_entry.offset);
printf("Lookup Table Original_size = %"PRIu64"\n",
printf("XML Data Size = %"PRIu64"\n",
(u64)hdr->xml_res_entry.size);
printf("XML Data Flags = 0x%hhx\n",
- hdr->xml_res_entry.flags);
+ (u8)hdr->xml_res_entry.flags);
printf("XML Data Offset = %"PRIu64"\n",
hdr->xml_res_entry.offset);
printf("XML Data Original Size = %"PRIu64"\n",
printf("Boot Metadata Size = %"PRIu64"\n",
(u64)hdr->boot_metadata_res_entry.size);
printf("Boot Metadata Flags = 0x%hhx\n",
- hdr->boot_metadata_res_entry.flags);
+ (u8)hdr->boot_metadata_res_entry.flags);
printf("Boot Metadata Offset = %"PRIu64"\n",
hdr->boot_metadata_res_entry.offset);
printf("Boot Metadata Original Size = %"PRIu64"\n",
hdr->boot_metadata_res_entry.original_size);
printf("Boot Index = %u\n", hdr->boot_idx);
printf("Integrity Size = %"PRIu64"\n",
- (u64)hdr->integrity.size);
+ (u64)hdr->integrity.size);
printf("Integrity Flags = 0x%hhx\n",
- hdr->integrity.flags);
+ (u8)hdr->integrity.flags);
printf("Integrity Offset = %"PRIu64"\n",
- hdr->integrity.offset);
+ hdr->integrity.offset);
printf("Integrity Original_size = %"PRIu64"\n",
- hdr->integrity.original_size);
+ hdr->integrity.original_size);
}
#ifdef WITH_FUSE
-#include "sha1.h"
-#include "lookup_table.h"
-#include "xml.h"
#include "buffer_io.h"
+#include "lookup_table.h"
+#include "sha1.h"
#include "timestamp.h"
+#include "xml.h"
+
+#include <errno.h>
+#include <ftw.h>
#include <limits.h>
+#include <mqueue.h>
+#include <signal.h>
#include <stdlib.h>
-#include <unistd.h>
-#include <sys/wait.h>
-#define FUSE_USE_VERSION 26
-#include <errno.h>
#include <string.h>
+#include <sys/stat.h>
#include <sys/time.h>
-#include <fuse.h>
-#include <ftw.h>
-#include <mqueue.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
#include <utime.h>
-#include <signal.h>
+
+#define FUSE_USE_VERSION 26
+#include <fuse.h>
#ifdef ENABLE_XATTR
#include <attr/xattr.h>
#include <ntfs-3g/endians.h>
#include <ntfs-3g/types.h>
-#include "wimlib_internal.h"
-
-
+#include "buffer_io.h"
#include "dentry.h"
#include "lookup_table.h"
-#include "buffer_io.h"
+#include "security.h"
+#include "wimlib_internal.h"
+
#include <ntfs-3g/layout.h>
#include <ntfs-3g/acls.h>
#include <ntfs-3g/attrib.h>
#include <ntfs-3g/misc.h>
#include <ntfs-3g/reparse.h>
-#include <ntfs-3g/security.h> /* security.h before xattrs.h */
+#include <ntfs-3g/security.h> /* ntfs-3g/security.h before ntfs-3g/xattrs.h */
#include <ntfs-3g/xattrs.h>
#include <ntfs-3g/volume.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
-#include "security.h"
+
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
static inline ntfschar *attr_record_name(ATTR_RECORD *ar)
{
# define WARNING wimlib_warning
# define WARNING_WITH_ERRNO wimlib_warning
#else
-# define ERROR(format, ...) dummy_printf
-# define ERROR_WITH_ERRNO(format, ...) dummy_printf
-# define WARNING(format, ...) dummy_printf
-# define WARNING_WITH_ERRNO(format, ...) dummy_printf
+# define ERROR(format, ...) dummy_printf(format, ## __VA_ARGS__)
+# define ERROR_WITH_ERRNO(format, ...) dummy_printf(format, ## __VA_ARGS__)
+# define WARNING(format, ...) dummy_printf(format, ## __VA_ARGS__)
+# define WARNING_WITH_ERRNO(format, ...) dummy_printf(format, ## __VA_ARGS__)
#endif /* ENABLE_ERROR_MESSAGES */
#if defined(ENABLE_DEBUG) || defined(ENABLE_MORE_DEBUG)
*
* This will break if the full path to the WIM changes in the
* intervening time...
+ *
+ * Warning: in Windows native builds, realpath() calls the replacement
+ * function in win32.c.
*/
w->filename = realpath(in_wim_path, NULL);
if (!w->filename) {
/*
* win32.c
*
- * All the code specific to native Windows builds is in here.
+ * All the library code specific to native Windows builds is in here.
*/
/*
#include <windows.h>
#include <ntdef.h>
#include <wchar.h>
-#include <shlwapi.h>
-#ifdef ERROR
+#include <shlwapi.h> /* shlwapi.h for PathMatchSpecA() */
+#ifdef ERROR /* windows.h defines this */
# undef ERROR
#endif
-
-/* Microsoft's swprintf() violates the C standard and they require programmers
- * to do this weird define to get the correct function. */
-#define swprintf _snwprintf
-
#include "win32.h"
#include "dentry.h"
#include "lookup_table.h"
LocalFree(buffer);
}
}
-#else
-#define win32_error(err_code)
#endif
void *win32_open_file_readonly(const void *path)
return ((u64)ft->dwHighDateTime << 32) | (u64)ft->dwLowDateTime;
}
-
-int win32_build_dentry_tree(struct wim_dentry **root_ret,
- const char *root_disk_path,
- struct wim_lookup_table *lookup_table,
- struct wim_security_data *sd,
- const struct capture_config *config,
- int add_image_flags,
- wimlib_progress_func_t progress_func,
- void *extra_arg);
-
static int win32_get_short_name(struct wim_dentry *dentry,
const wchar_t *path_utf16)
{
}
/* Reads the directory entries of directory using a Win32 API and recursively
- * calls build_dentry_tree() on them. */
+ * calls win32_build_dentry_tree() on them. */
static int win32_recurse_directory(struct wim_dentry *root,
const char *root_disk_path,
struct wim_lookup_table *lookup_table,
}
/* Replacement for POSIX fnmatch() (partial functionality only) */
-extern int fnmatch(const char *pattern, const char *string, int flags)
+int fnmatch(const char *pattern, const char *string, int flags)
{
if (PathMatchSpecA(string, pattern))
return 0;
#define FNM_NOMATCH 1
extern int fnmatch(const char *pattern, const char *string, int flags);
-#define mkdir(name, mode) _mkdir(name)
-
extern int win32_do_apply_dentry(const char *output_path,
size_t output_path_len,
struct wim_dentry *dentry,
extern char *realpath(const char *path, char *resolved_path);
+/* Microsoft's swprintf() violates the C standard and they require programmers
+ * to do this weird define to get the correct function. */
+#define swprintf _snwprintf
+
+/* Use Microsoft's weird _mkdir() function instead of mkdir() */
+#define mkdir(name, mode) _mkdir(name)
+
#endif /* _WIMLIB_WIN32_H */