2 * makewim.c - A simple program to make a LZX-compressed WIM file from a
9 int main(int argc, char **argv)
15 fprintf(stderr, "Usage: makewim DIR WIM\n");
20 /* Initialize the library. */
21 ret = wimlib_global_init(0);
25 /* Create a WIMStruct for a LZX-compressed WIM. */
26 ret = wimlib_create_new_wim(WIMLIB_COMPRESSION_TYPE_LZX, &wim);
28 goto out_wimlib_global_cleanup;
30 /* Add the directory tree to the WIMStruct as an image. */
31 ret = wimlib_add_image(wim, argv[1], "1", NULL, 0, NULL);
35 /* Write the desired WIM file. */
36 ret = wimlib_write(wim, argv[2], WIMLIB_ALL_IMAGES, 0, 0, NULL);
39 /* Free the WIM file */
42 out_wimlib_global_cleanup:
43 /* Finalize the library */
44 wimlib_global_cleanup();