]> wimlib.net Git - wimlib/blobdiff - include/wimlib/scan.h
mount_image.c: add fallback definitions of RENAME_* constants
[wimlib] / include / wimlib / scan.h
index 13cd26d57c0796a7a942f24a179dbc603f36ff6d..cfd7835e2067f17aae0d6deb2e336fb76b2daf25 100644 (file)
@@ -57,10 +57,14 @@ struct scan_params {
        /* Progress data.  */
        union wimlib_progress_info progress;
 
-       /* Before calling try_exclude(), the scan implementation must set this
-        * to the number of characters that try_exclude() will strip from the
-        * path when testing exclusion patterns.  */
-       size_t capture_root_nchars;
+       /* Path to the file or directory currently being scanned */
+       tchar *cur_path;
+       size_t cur_path_nchars;
+       size_t cur_path_alloc_nchars;
+
+       /* Length of the prefix of 'cur_path' which names the root of the
+        * directory tree currently being scanned */
+       size_t root_path_nchars;
 
        /* Can be used by the scan implementation.  */
        u64 capture_root_ino;
@@ -69,64 +73,82 @@ struct scan_params {
 
 /* scan.c */
 
-extern int
+int
 do_scan_progress(struct scan_params *params, int status,
                 const struct wim_inode *inode);
 
-extern int
+int
 mangle_pat(tchar *pat, const tchar *path, unsigned long line_no);
 
-extern int
+int
 read_capture_config(const tchar *config_file, const void *buf,
                    size_t bufsize, struct capture_config *config);
 
-extern void
+void
 destroy_capture_config(struct capture_config *config);
 
-extern bool
-match_pattern_list(const tchar *path, const struct string_list *list);
+bool
+match_pattern_list(const tchar *path, const struct string_list *list,
+                  int match_flags);
 
-extern int
-try_exclude(const tchar *full_path, const struct scan_params *params);
+int
+try_exclude(const struct scan_params *params);
 
 typedef int (*scan_tree_t)(struct wim_dentry **, const tchar *,
                           struct scan_params *);
 
 #ifdef WITH_NTFS_3G
 /* ntfs-3g_capture.c */
-extern int
+int
 ntfs_3g_build_dentry_tree(struct wim_dentry **root_ret,
                          const tchar *device, struct scan_params *params);
 #endif
 
-#ifdef __WIN32__
+#ifdef _WIN32
 /* win32_capture.c */
-extern int
+int
 win32_build_dentry_tree(struct wim_dentry **root_ret,
                        const tchar *root_disk_path,
                        struct scan_params *params);
 #define platform_default_scan_tree win32_build_dentry_tree
 #else
 /* unix_capture.c */
-extern int
+int
 unix_build_dentry_tree(struct wim_dentry **root_ret,
                       const tchar *root_disk_path, struct scan_params *params);
 #define platform_default_scan_tree unix_build_dentry_tree
 #endif
 
+#ifdef ENABLE_TEST_SUPPORT
+int
+generate_dentry_tree(struct wim_dentry **root_ret,
+                    const tchar *root_disk_path, struct scan_params *params);
+#endif
+
 #define WIMLIB_ADD_FLAG_ROOT   0x80000000
 
 static inline int
-report_scan_error(struct scan_params *params, int error_code, const tchar *path)
+report_scan_error(struct scan_params *params, int error_code)
 {
-       return report_error(params->progfunc, params->progctx, error_code, path);
+       return report_error(params->progfunc, params->progctx, error_code,
+                           params->cur_path);
 }
 
-extern bool
+bool
 should_ignore_filename(const tchar *name, int name_nchars);
 
-extern void
+void
 attach_scanned_tree(struct wim_dentry *parent, struct wim_dentry *child,
                    struct blob_table *blob_table);
 
+int
+pathbuf_init(struct scan_params *params, const tchar *root_path);
+
+const tchar *
+pathbuf_append_name(struct scan_params *params, const tchar *name,
+                   size_t name_nchars, size_t *orig_path_nchars_ret);
+
+void
+pathbuf_truncate(struct scan_params *params, size_t nchars);
+
 #endif /* _WIMLIB_SCAN_H */