return (off_t)-1;
}
+static const char *default_capture_config =
+"[ExclusionList]\n"
+"\\$ntfs.log\n"
+"\\hiberfil.sys\n"
+"\\pagefile.sys\n"
+"\\System Volume Information\n"
+"\\RECYCLER\n"
+"\\Windows\\CSC\n"
+"\n"
+"[CompressionExclusionList]\n"
+"*.mp3\n"
+"*.zip\n"
+"*.cab\n"
+"\\WINDOWS\\inf\\*.pnf\n";
+
static char *file_get_contents(const char *filename, size_t *len_ret)
{
struct stat stbuf;
}
}
- ret = wimlib_add_image(w, source, name, config_str, config_len,
- add_image_flags, imagex_progress_func);
+ ret = wimlib_add_image(w, source, name,
+ config_str ? config_str : default_capture_config,
+ config_len, add_image_flags,
+ imagex_progress_func);
if (ret != 0)
goto out;
ALIGNMENT_LIST,
};
+#define COMPAT_DEFAULT_CONFIG
+
/* Default capture configuration file when none is specified. */
static const char *default_config =
+#ifdef COMPAT_DEFAULT_CONFIG /* XXX: This policy is being moved to library
+ users. The next ABI-incompatible library
+ version will default to the empty string here. */
"[ExclusionList]\n"
"\\$ntfs.log\n"
"\\hiberfil.sys\n"
"*.zip\n"
"*.cab\n"
"\\WINDOWS\\inf\\*.pnf\n";
+#else
+"";
+#endif
static void destroy_pattern_list(struct pattern_list *list)
{
return false;
}
-static void print_pattern_list(const struct pattern_list *list)
-{
- for (size_t i = 0; i < list->num_pats; i++)
- printf(" %s\n", list->pats[i]);
-}
-
-static void print_capture_config(const struct capture_config *config)
-{
- if (config->exclusion_list.num_pats) {
- puts("Files or folders excluded from image capture:");
- print_pattern_list(&config->exclusion_list);
- putchar('\n');
- }
-}
-
/* Return true if the image capture configuration file indicates we should
* exclude the filename @path from capture.
*
ret = init_capture_config(config_str, config_len, source, &config);
if (ret != 0)
return ret;
- print_capture_config(&config);
DEBUG("Allocating security data");
* NULL, a default string is used. Please see the manual page for
* <b>imagex capture</b> for more information.
* @param config_len
- * Length of the string @a config in bytes. Ignored if @a config is @c
- * NULL.
+ * Length of the string @a config in bytes, not including an optional
+ * null-terminator. Ignored if @a config is @c NULL.
* @param add_image_flags
* Bitwise OR of flags prefixed with WIMLIB_ADD_IMAGE_FLAG.
* @param progress_func