]> wimlib.net Git - wimlib/blob - include/wimlib/write.h
e3f2a217d406f511795591c78cffb3f08425ccd1
[wimlib] / include / wimlib / write.h
1 #ifndef _WIMLIB_WRITE_H
2 #define _WIMLIB_WRITE_H
3
4 #include "wimlib.h"
5 #include "wimlib/types.h"
6
7 /* Internal use only */
8 #define WIMLIB_WRITE_FLAG_NO_LOOKUP_TABLE               0x80000000
9 #define WIMLIB_WRITE_FLAG_CHECKPOINT_AFTER_XML          0x40000000
10 #define WIMLIB_WRITE_FLAG_HEADER_AT_END                 0x20000000
11 #define WIMLIB_WRITE_FLAG_FILE_DESCRIPTOR               0x10000000
12 #define WIMLIB_WRITE_FLAG_USE_EXISTING_TOTALBYTES       0x08000000
13 #define WIMLIB_WRITE_FLAG_NO_METADATA                   0x04000000
14 #define WIMLIB_WRITE_FLAG_OVERWRITE                     0x02000000
15
16 /* Keep in sync with wimlib.h  */
17 #define WIMLIB_WRITE_MASK_PUBLIC (                        \
18         WIMLIB_WRITE_FLAG_CHECK_INTEGRITY               | \
19         WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY            | \
20         WIMLIB_WRITE_FLAG_PIPABLE                       | \
21         WIMLIB_WRITE_FLAG_NOT_PIPABLE                   | \
22         WIMLIB_WRITE_FLAG_RECOMPRESS                    | \
23         WIMLIB_WRITE_FLAG_FSYNC                         | \
24         WIMLIB_WRITE_FLAG_REBUILD                       | \
25         WIMLIB_WRITE_FLAG_SOFT_DELETE                   | \
26         WIMLIB_WRITE_FLAG_IGNORE_READONLY_FLAG          | \
27         WIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS            | \
28         WIMLIB_WRITE_FLAG_STREAMS_OK                    | \
29         WIMLIB_WRITE_FLAG_RETAIN_GUID                   | \
30         WIMLIB_WRITE_FLAG_PACK_STREAMS                  | \
31         WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES)
32
33 #if defined(HAVE_SYS_FILE_H) && defined(HAVE_FLOCK)
34 extern int
35 lock_wim_for_append(WIMStruct *wim);
36 extern void
37 unlock_wim_for_append(WIMStruct *wim);
38 #else
39 static inline int
40 lock_wim_for_append(WIMStruct *wim)
41 {
42         return 0;
43 }
44 static inline void
45 unlock_wim_for_append(WIMStruct *wim)
46 {
47 }
48 #endif
49
50 struct filedes;
51 struct list_head;
52 struct wim_reshdr;
53
54 int
55 write_wim_part(WIMStruct *wim,
56                const void *path_or_fd,
57                int image,
58                int write_flags,
59                unsigned num_threads,
60                unsigned part_number,
61                unsigned total_parts,
62                struct list_head *stream_list_override,
63                const u8 *guid);
64
65 int
66 write_wim_resource_from_buffer(const void *buf, size_t buf_size,
67                                int reshdr_flags, struct filedes *out_fd,
68                                int out_ctype,
69                                u32 out_chunk_size,
70                                struct wim_reshdr *out_reshdr,
71                                u8 *hash,
72                                int write_resource_flags);
73
74 #endif /* _WIMLIB_WRITE_H */