]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - SQUASHFS/squashfs-tools-4.4/squashfs-tools/mksquashfs.h
Update Bengali Translation (#1956)
[Ventoy.git] / SQUASHFS / squashfs-tools-4.4 / squashfs-tools / mksquashfs.h
1 #ifndef MKSQUASHFS_H
2 #define MKSQUASHFS_H
3 /*
4 * Squashfs
5 *
6 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
7 * 2012, 2013, 2014, 2019
8 * Phillip Lougher <phillip@squashfs.org.uk>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2,
13 * or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 *
24 * mksquashfs.h
25 *
26 */
27
28 struct dir_info {
29 char *pathname;
30 char *subpath;
31 unsigned int count;
32 unsigned int directory_count;
33 int depth;
34 unsigned int excluded;
35 char dir_is_ldir;
36 struct dir_ent *dir_ent;
37 struct dir_ent *list;
38 DIR *linuxdir;
39 };
40
41 struct dir_ent {
42 char *name;
43 char *source_name;
44 char *nonstandard_pathname;
45 struct inode_info *inode;
46 struct dir_info *dir;
47 struct dir_info *our_dir;
48 struct dir_ent *next;
49 };
50
51 struct inode_info {
52 struct stat buf;
53 struct inode_info *next;
54 squashfs_inode inode;
55 unsigned int inode_number;
56 unsigned int nlink;
57 int pseudo_id;
58 char type;
59 char read;
60 char root_entry;
61 char pseudo_file;
62 char no_fragments;
63 char always_use_fragments;
64 char noD;
65 char noF;
66 char symlink[0];
67 };
68
69 /* in memory file info */
70 struct file_info {
71 long long file_size;
72 long long bytes;
73 long long start;
74 unsigned int *block_list;
75 struct file_info *next;
76 struct fragment *fragment;
77 unsigned short checksum;
78 unsigned short fragment_checksum;
79 char have_frag_checksum;
80 char have_checksum;
81 };
82
83 /* fragment block data structures */
84 struct fragment {
85 unsigned int index;
86 int offset;
87 int size;
88 };
89
90 /* in memory uid tables */
91 #define ID_ENTRIES 256
92 #define ID_HASH(id) (id & (ID_ENTRIES - 1))
93 #define ISA_UID 1
94 #define ISA_GID 2
95
96 struct id {
97 unsigned int id;
98 int index;
99 char flags;
100 struct id *next;
101 };
102
103 /* fragment to file mapping used when appending */
104 struct append_file {
105 struct file_info *file;
106 struct append_file *next;
107 };
108
109 #define PSEUDO_FILE_OTHER 1
110 #define PSEUDO_FILE_PROCESS 2
111
112 #define IS_PSEUDO(a) ((a)->pseudo_file)
113 #define IS_PSEUDO_PROCESS(a) ((a)->pseudo_file & PSEUDO_FILE_PROCESS)
114 #define IS_PSEUDO_OTHER(a) ((a)->pseudo_file & PSEUDO_FILE_OTHER)
115
116 /*
117 * Amount of physical memory to use by default, and the default queue
118 * ratios
119 */
120 #define SQUASHFS_TAKE 4
121 #define SQUASHFS_READQ_MEM 4
122 #define SQUASHFS_BWRITEQ_MEM 4
123 #define SQUASHFS_FWRITEQ_MEM 4
124
125 /*
126 * Lowest amount of physical memory considered viable for Mksquashfs
127 * to run in Mbytes
128 */
129 #define SQUASHFS_LOWMEM 64
130
131 /* offset of data in compressed metadata blocks (allowing room for
132 * compressed size */
133 #define BLOCK_OFFSET 2
134
135 #ifdef REPRODUCIBLE_DEFAULT
136 #define NOREP_STR
137 #define REP_STR " (default)"
138 #define REP_DEF 1
139 #else
140 #define NOREP_STR " (default)"
141 #define REP_STR
142 #define REP_DEF 0
143 #endif
144
145 extern struct cache *reader_buffer, *fragment_buffer, *reserve_cache;
146 struct cache *bwriter_buffer, *fwriter_buffer;
147 extern struct queue *to_reader, *to_deflate, *to_writer, *from_writer,
148 *to_frag, *locked_fragment, *to_process_frag;
149 extern struct append_file **file_mapping;
150 extern struct seq_queue *to_main, *to_order;
151 extern pthread_mutex_t fragment_mutex, dup_mutex;
152 extern struct squashfs_fragment_entry *fragment_table;
153 extern struct compressor *comp;
154 extern int block_size;
155 extern struct file_info *dupl[];
156 extern int read_fs_bytes(int, long long, int, void *);
157 extern void add_file(long long, long long, long long, unsigned int *, int,
158 unsigned int, int, int);
159 extern struct id *create_id(unsigned int);
160 extern unsigned int get_uid(unsigned int);
161 extern unsigned int get_guid(unsigned int);
162 extern int read_bytes(int, void *, int);
163 extern unsigned short get_checksum_mem(char *, int);
164 extern int reproducible;
165 #endif