]> wimlib.net Git - wimlib/blob - include/wimlib/wim.h
9d01522a3bdeae1c9521182a66154dd55a063870
[wimlib] / include / wimlib / wim.h
1 #ifndef _WIMLIB_WIM_H
2 #define _WIMLIB_WIM_H
3
4 #include "wimlib/header.h"
5 #include "wimlib/types.h"
6
7 struct wim_info;
8 struct wim_lookup_table;
9 struct wim_image_metadata;
10
11 /* The opaque structure exposed to the wimlib API. */
12 struct WIMStruct {
13
14         /* File descriptor for the WIM file, opened for reading, or -1 if it has
15          * not been opened or there is no associated file backing it yet. */
16         int in_fd;
17
18         /* File descriptor, opened either for writing only or for
19          * reading+writing, for the WIM file (if any) currently being written.
20          * */
21         int out_fd;
22
23         /* The name of the WIM file (if any) that has been opened. */
24         tchar *filename;
25
26         /* The lookup table for the WIM file. */
27         struct wim_lookup_table *lookup_table;
28
29         /* Information retrieved from the XML data, arranged in an orderly
30          * manner. */
31         struct wim_info *wim_info;
32
33         /* Array of the image metadata, one for each image in the WIM. */
34         struct wim_image_metadata **image_metadata;
35
36         /* The header of the WIM file. */
37         struct wim_header hdr;
38
39         /* Temporary field */
40         void *private;
41
42         /* The currently selected image, indexed starting at 1.  If not 0,
43          * subtract 1 from this to get the index of the current image in the
44          * image_metadata array. */
45         int current_image;
46
47         /* Have any images been deleted? */
48         u8 deletion_occurred : 1;
49
50         u8 all_images_verified : 1;
51         u8 wim_locked : 1;
52 };
53
54 extern int
55 wim_run_full_verifications(WIMStruct *w);
56
57 extern int
58 read_header(const tchar *filename, int in_fd, struct wim_header *hdr);
59
60 extern int
61 write_header(const struct wim_header *hdr, int out_fd);
62
63 extern int
64 init_header(struct wim_header *hdr, int ctype);
65
66
67 extern int
68 rename_wim_path(WIMStruct *wim, const tchar *from, const tchar *to);
69
70 extern int
71 select_wim_image(WIMStruct *w, int image);
72
73 extern int
74 for_image(WIMStruct *w, int image, int (*visitor)(WIMStruct *));
75
76 extern int
77 wim_checksum_unhashed_streams(WIMStruct *w);
78
79 extern int
80 reopen_wim(WIMStruct *w);
81
82 extern int
83 close_wim(WIMStruct *w);
84
85 extern int
86 can_modify_wim(WIMStruct *wim);
87
88 extern int
89 can_delete_from_wim(WIMStruct *wim);
90
91 #endif /* _WIMLIB_WIM_H */