}
#ifndef __WIN32__
-static int unix_apply_dentry(const char *output_path,
- size_t output_path_len,
- const struct wim_dentry *dentry,
- const struct apply_args *args)
+static int unix_do_apply_dentry(const char *output_path,
+ size_t output_path_len,
+ struct wim_dentry *dentry,
+ struct apply_args *args)
{
const struct wim_inode *inode = dentry->d_inode;
return extract_regular_file(dentry, args, output_path);
}
-static int unix_apply_dentry_timestamps(const char *output_path,
- size_t output_path_len,
- const struct wim_dentry *dentry,
- struct apply_args *args)
+static int unix_do_apply_dentry_timestamps(const char *output_path,
+ size_t output_path_len,
+ const struct wim_dentry *dentry,
+ struct apply_args *args)
{
int ret;
+ const struct wim_inode *inode = dentry->d_inode;
+
/* Convert the WIM timestamps, which are accurate to 100 nanoseconds,
* into struct timeval's. */
struct timeval tv[2];
len += dentry->full_path_utf8_len;
}
#ifdef __WIN32__
- return win32_apply_dentry(output_path, len, dentry, args);
+ return win32_do_apply_dentry(output_path, len, dentry, args);
#else
- return unix_apply_dentry(output_path, len, dentry, args);
+ return unix_do_apply_dentry(output_path, len, dentry, args);
#endif
}
len += dentry->full_path_utf8_len;
}
#ifdef __WIN32__
- return win32_apply_dentry_timestamps(output_path, len, dentry, args);
+ return win32_do_apply_dentry_timestamps(output_path, len, dentry, args);
#else
- return unix_apply_dentry_timestamps(output_path, len, dentry, args);
+ return unix_do_apply_dentry_timestamps(output_path, len, dentry, args);
#endif
}
return 0;
}
-int win32_apply_dentry(const char *output_path,
- size_t output_path_len,
- const struct wim_dentry *dentry,
- struct apply_args *args)
+/* Extract a file, directory, reparse point, or hard link to an
+ * already-extracted file using the Win32 API */
+int win32_do_apply_dentry(const char *output_path,
+ size_t output_path_len,
+ struct wim_dentry *dentry,
+ struct apply_args *args)
{
char *utf16_path;
size_t utf16_path_len;
return ret;
}
-int win32_apply_dentry_timestamps(const char *output_path,
- size_t output_path_len,
- const struct wim_dentry *dentry,
- const struct apply_args *args)
+/* Set timestamps on an extracted file using the Win32 API */
+int win32_do_apply_dentry_timestamps(const char *output_path,
+ size_t output_path_len,
+ const struct wim_dentry *dentry,
+ const struct apply_args *args)
{
/* Win32 */
char *utf16_path;
return 0;
}
+/* Use the Win32 API to get the number of processors */
unsigned win32_get_number_of_processors()
{
SYSTEM_INFO sysinfo;
return sysinfo.dwNumberOfProcessors;
}
+/* Replacement for POSIX-2008 realpath(). Warning: partial functionality only
+ * (resolved_path must be NULL). Also I highly doubt that GetFullPathName
+ * really does the right thing under all circumstances. */
char *realpath(const char *path, char *resolved_path)
{
DWORD ret;
#define mkdir(name, mode) _mkdir(name)
-extern int win32_apply_dentry(const char *output_path,
- size_t output_path_len,
- const struct wim_dentry *dentry,
- struct apply_args *args);
-
-extern int win32_apply_dentry_timestamps(const char *output_path,
- size_t output_path_len,
- const struct wim_dentry *dentry,
- const struct apply_args *args);
+extern int win32_do_apply_dentry(const char *output_path,
+ size_t output_path_len,
+ struct wim_dentry *dentry,
+ struct apply_args *args);
+
+extern int win32_do_apply_dentry_timestamps(const char *output_path,
+ size_t output_path_len,
+ const struct wim_dentry *dentry,
+ const struct apply_args *args);
extern int fsync(int fd);