]> wimlib.net Git - wimlib/blob - include/wimlib/write.h
68ada29832e1efa6e0f49972bb7cf32c9162b070
[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_REUSE_INTEGRITY_TABLE         0x20000000
11 #define WIMLIB_WRITE_FLAG_HEADER_AT_END                 0x10000000
12 #define WIMLIB_WRITE_FLAG_FILE_DESCRIPTOR               0x08000000
13 #define WIMLIB_WRITE_FLAG_USE_EXISTING_TOTALBYTES       0x04000000
14 #define WIMLIB_WRITE_FLAG_NO_METADATA                   0x02000000
15 #define WIMLIB_WRITE_FLAG_OVERWRITE                     0x01000000
16
17 /* Keep in sync with wimlib.h  */
18 #define WIMLIB_WRITE_MASK_PUBLIC (                        \
19         WIMLIB_WRITE_FLAG_CHECK_INTEGRITY               | \
20         WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY            | \
21         WIMLIB_WRITE_FLAG_PIPABLE                       | \
22         WIMLIB_WRITE_FLAG_NOT_PIPABLE                   | \
23         WIMLIB_WRITE_FLAG_RECOMPRESS                    | \
24         WIMLIB_WRITE_FLAG_FSYNC                         | \
25         WIMLIB_WRITE_FLAG_REBUILD                       | \
26         WIMLIB_WRITE_FLAG_SOFT_DELETE                   | \
27         WIMLIB_WRITE_FLAG_IGNORE_READONLY_FLAG          | \
28         WIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS            | \
29         WIMLIB_WRITE_FLAG_STREAMS_OK                    | \
30         WIMLIB_WRITE_FLAG_RETAIN_GUID                   | \
31         WIMLIB_WRITE_FLAG_PACK_STREAMS)
32
33 #if defined(HAVE_SYS_FILE_H) && defined(HAVE_FLOCK)
34 extern int
35 lock_wim(WIMStruct *wim, int fd);
36 #else
37 static inline int
38 lock_wim(WIMStruct *wim, int fd)
39 {
40         return 0;
41 }
42 #endif
43
44 struct list_head;
45
46 int
47 write_wim_part(WIMStruct *wim,
48                const void *path_or_fd,
49                int image,
50                int write_flags,
51                unsigned num_threads,
52                unsigned part_number,
53                unsigned total_parts,
54                struct list_head *stream_list_override,
55                const u8 *guid);
56
57 int
58 write_wim_resource_from_buffer(const void *buf, size_t buf_size,
59                                int reshdr_flags, struct filedes *out_fd,
60                                int out_ctype,
61                                u32 out_chunk_size,
62                                struct wim_reshdr *out_reshdr,
63                                u8 *hash,
64                                int write_resource_flags);
65
66 #endif /* _WIMLIB_WRITE_H */