12 #include "../config.h"
65 while (child != NULL) {
99 while (info != NULL) {
141 if (node == NULL || proc == NULL) {
146 while (pos != NULL) {
176 if (node == NULL || proc == NULL) {
182 while (pos != NULL) {
217 if (node == NULL || proc == NULL || data == NULL) {
223 while (pos != NULL) {
241 if (node == NULL || handle == NULL || proc == NULL || data == NULL)
262 for (pos = node->
xinfo; pos != NULL; pos = next) {
277 for (pos = node->
xinfo; pos != NULL; pos = next) {
288 void *handle = NULL, *data, *new_data;
303 ret = (*cloner)(data, &new_data, 0);
334 int truncate_length,
int flag)
336 char *
new, *name, *trunc = NULL;
345 name = (
char *) in_name;
346 if (truncate_length >= 64) {
347 trunc = strdup(name);
362 if (node->
parent != NULL) {
377 if (node->
parent != NULL) {
417 static char *root = {
""};
419 if (node->
name == NULL)
434 node->
mode = (node->
mode & S_IFMT) | (mode & ~S_IFMT);
464 return node->
mode & ~S_IFMT;
562 node->
hidden = hide_attrs;
596 if (dir == NULL || child == NULL) {
636 if (dir == NULL || name == NULL) {
655 const char *name,
IsoNode **node)
660 if ((
int) strlen(name) <= truncate_length) {
664 trunc = strdup(name);
680 const char *name,
IsoNode **node,
int flag)
711 if (iter == NULL || node == NULL) {
720 if (data->
pos == NULL) {
723 if (data->
pos == NULL) {
773 if (data->
pos == NULL) {
776 return data->
pos->
next == NULL ? 0 : 1;
785 if (data->
pos != NULL) {
795 while (*
pos != NULL && *
pos != node) {
796 pos = &((*pos)->next);
882 if (node->parent == NULL) {
888 if (boss_iter != NULL)
924 if (!(data->
flag & 0x01)) {
928 if (data->
pos == NULL) {
965 if (data->
pos == node) {
968 while (
pos != NULL &&
pos != data->
pos) {
1006 if (dir == NULL || iter == NULL) {
1037 if (iter == NULL || node == NULL) {
1125 child = child->
next;
1128 ((
IsoFile*)node)->sort_weight = w;
1129 ((
IsoFile*)node)->explicit_weight = 1;
1176 return special->
dev;
1200 if (file == NULL || lba == NULL) {
1206 if (section_count != 1) {
1207 if (sections != NULL)
1211 *lba = sections[0].
block;
1253 if (name[0] ==
'\0')
1259 if (!strcmp(name,
".") || !strcmp(name,
".."))
1263 if (strchr(name,
'/') != NULL)
1270 #ifdef Libisofs_debug_rr_reserveD
1271 fprintf(stderr,
"libisofs_DEBUG: ISO_RR_NAME_RESERVED with '%s'\n", name);
1286 char *ptr, *brk_info, *component;
1294 if (dest[0] ==
'\0') {
1295 #ifdef Libisofs_debug_rr_reserveD
1296 fprintf(stderr,
"libisofs_DEBUG: ISO_RR_NAME_RESERVED by empty link target\n");
1304 if (!strcmp(dest,
"/")) {
1315 component = strtok_r(ptr,
"/", &brk_info);
1317 if (strcmp(component,
".") && strcmp(component,
"..")) {
1323 component = strtok_r(NULL,
"/", &brk_info);
1333 while (**pos != NULL && strcmp((**pos)->name, name) < 0) {
1334 *pos = &((**pos)->next);
1346 return (*node != NULL && !strcmp((*node)->name, name)) ? 1 : 0;
1352 if (*pos != NULL && !strcmp((*pos)->name, node->
name)) {
1358 if ((*pos)->mtime >= node->
mtime) {
1364 if ((*pos)->mtime >= node->
mtime) {
1368 if ((node->
mode & S_IFMT) != ((*pos)->mode & S_IFMT)) {
1374 if ((node->
mode & S_IFMT) != ((*pos)->mode & S_IFMT)) {
1389 (*pos)->next = NULL;
1438 while (*pos != NULL && (*pos)->
iter !=
iter) {
1439 pos = &(*pos)->
next;
1451 while (pos != NULL) {
1465 dir = calloc(1,
sizeof(
IsoDir));
1486 if (dir == NULL || name == NULL) {
1495 new = calloc(1,
sizeof(
IsoDir));
1499 new->node.refcount = 1;
1501 new->node.name = name;
1502 new->node.mode = S_IFDIR;
1512 if (file == NULL || name == NULL || stream == NULL) {
1521 new = calloc(1,
sizeof(
IsoFile));
1525 new->node.refcount = 1;
1527 new->node.name = name;
1528 new->node.mode = S_IFREG;
1529 new->from_old_session = 0;
1530 new->explicit_weight = 0;
1531 new->sort_weight = 0;
1532 new->stream = stream;
1543 if (link == NULL || name == NULL || dest == NULL) {
1561 new->node.refcount = 1;
1563 new->node.name = name;
1565 new->node.mode = S_IFLNK;
1579 if (special == NULL || name == NULL) {
1582 if (S_ISLNK(mode) || S_ISREG(mode) || S_ISDIR(mode)) {
1595 new->node.refcount = 1;
1597 new->node.name = name;
1599 new->node.mode = mode;
1613 size_t *value_lengths,
char **values,
int flag)
1617 for (w = i = 0; i < *num_attrs; i++) {
1618 if ((strcmp(names[i], del_name) == 0) ^ (flag & 1)) {
1619 if (names[i] != NULL)
1621 if (values[i] != NULL)
1623 names[i] = values[i] = NULL;
1630 names[w] = names[i];
1631 value_lengths[w] = value_lengths[i];
1632 values[w] = values[i];
1633 names[i] = values[i] = NULL;
1634 value_lengths[i] = 0;
1648 char ***names,
size_t **value_lengths,
char ***values,
int flag)
1652 size_t len, todo, consumed;
1653 int is_done = 0, first_round= 1, ret;
1655 if (flag & (1 << 15))
1657 value_lengths, values, 1 << 15);
1660 *value_lengths = NULL;
1662 if (flag & (1 << 15))
1668 todo = len - (rpt - aa_string);
1678 rpt, todo, &consumed, first_round);
1691 if ((
size_t) (rpt - aa_string) != len) {
1698 value_lengths, values, 0);
1713 rpt, todo, &consumed, 1 << 15);
1725 size_t *value_length,
char **value,
int flag)
1727 size_t num_attrs = 0, *value_lengths = NULL;
1728 char **names = NULL, **values = NULL;
1729 int i, ret = 0, found = 0;
1732 &value_lengths, &values, 0);
1735 for (i = 0; i < (int) num_attrs; i++) {
1736 if (strcmp(names[i], name))
1738 *value_length = value_lengths[i];
1739 *value = calloc(*value_length + 1, 1);
1740 if (*value == NULL) {
1744 if (*value_length > 0)
1745 memcpy(*value, values[i], *value_length);
1746 (*value)[*value_length] = 0;
1751 &value_lengths, &values, 1 << 15);
1758 size_t *value_length,
char **value,
int flag)
1761 unsigned char *aa_string = NULL;
1769 aa_string = (
unsigned char *) xipt;
1777 char ***names,
size_t **value_lengths,
char ***values,
int flag)
1780 unsigned char *aa_string = NULL;
1783 if (flag & (1 << 15)) {
1790 *value_lengths = NULL;
1795 aa_string = (
unsigned char *) xipt;
1805 size_t new_num,
int flag)
1809 newpt = realloc(*names, new_num *
sizeof(
char *));
1812 *names = (
char **) newpt;
1813 newpt = realloc(*values, new_num *
sizeof(
char *));
1816 *values = (
char **) newpt;
1817 newpt = realloc(*value_lengths, new_num *
sizeof(
size_t));
1820 *value_lengths = (
size_t *) newpt;
1840 size_t *value_lengths,
char **values,
1841 size_t *m_num_attrs,
char ***m_names,
1842 size_t **m_value_lengths,
char ***m_values,
int flag)
1845 size_t new_names = 0, deleted = 0, i, j, w;
1847 if (flag & (1 << 15)) {
1858 if ((flag & 1) && (!(flag & 4))) {
1860 for (j = 0; j < *m_num_attrs; j++) {
1861 if (strncmp((*m_names)[j],
"isofs.", 6) == 0)
1863 if (strncmp((*m_names)[j],
"user.", 5) != 0 && !(flag & 8))
1865 for (i = 0; i < num_attrs; i++) {
1866 if (names[i] == NULL || (*m_names)[j] == NULL)
1868 if (strcmp(names[i], (*m_names)[j]) == 0)
1871 if (i >= num_attrs) {
1873 free((*m_names)[j]);
1874 (*m_names)[j] = NULL;
1881 for (i = 0; i < num_attrs; i++) {
1882 if (names[i] == NULL)
1884 if (names[i][0] == 0 && (flag & 16))
1886 if ((flag & 32) && strncmp(names[i],
"isofs.", 6) == 0)
1888 for (j = 0; j < *m_num_attrs; j++) {
1889 if ((*m_names)[j] == NULL)
1891 if (strcmp(names[i], (*m_names)[j]) == 0) {
1892 if ((*m_values)[j] != NULL)
1893 free((*m_values)[j]);
1894 (*m_values)[j] = NULL;
1895 (*m_value_lengths)[j] = 0;
1898 free((*m_names)[j]);
1899 (*m_names)[j] = NULL;
1902 (*m_values)[j] = calloc(value_lengths[i] + 1, 1);
1903 if ((*m_values)[j] == NULL)
1905 memcpy((*m_values)[j], values[i], value_lengths[i]);
1906 (*m_values)[j][value_lengths[i]] = 0;
1907 (*m_value_lengths)[j] = value_lengths[i];
1912 if (j >= *m_num_attrs)
1916 if (new_names > 0 && (flag & 4)) {
1920 }
else if (new_names > 0) {
1922 *m_num_attrs + new_names, 0);
1928 for (i = 0; i < num_attrs; i++) {
1929 if (names[i] == NULL)
1931 if (names[i][0] == 0 && (flag & 16))
1933 if ((flag & 32) && strncmp(names[i],
"isofs.", 6) == 0)
1935 for (j = 0; j < *m_num_attrs; j++) {
1936 if ((*m_names)[j] == NULL)
1938 if (strcmp(names[i], (*m_names)[j]) == 0)
1941 if (j < *m_num_attrs)
1943 (*m_names)[w] = strdup(names[i]);
1944 if ((*m_names)[w] == NULL)
1946 (*m_values)[w] = calloc(value_lengths[i] + 1, 1);
1947 if ((*m_values)[w] == NULL)
1949 memcpy((*m_values)[w], values[i], value_lengths[i]);
1950 (*m_values)[w][value_lengths[i]] = 0;
1951 (*m_value_lengths)[w] = value_lengths[i];
1959 for (j = 0; j < *m_num_attrs; j++) {
1960 if ((*m_names)[j] == NULL)
1962 (*m_names)[w] = (*m_names)[j];
1963 (*m_values)[w] = (*m_values)[j];
1964 (*m_value_lengths)[w] = (*m_value_lengths)[j];
1974 size_t *value_lengths,
char **values,
int flag)
1976 int ret, acl_saved = 0;
1978 size_t result_len, m_num = 0, *m_value_lengths = NULL, i;
1979 unsigned char *result = NULL;
1980 char *a_acl = NULL, *d_acl = NULL, **m_names = NULL, **m_values = NULL;
1983 for (i = 0; i < num_attrs; i++)
1984 if (strncmp(names[i],
"user.", 5) != 0 && names[i][0] != 0)
1986 if ((flag & (2 | 4 | 16)) || !(flag & 8)) {
1989 node, num_attrs, names, value_lengths, values,
1990 &m_num, &m_names, &m_value_lengths, &m_values,
1991 (flag & 4) | (!(flag & 2)) | ((!(flag & 1)) << 4) |
1992 ((flag & 16) << 1) | (flag & 8));
1997 value_lengths = m_value_lengths;
1999 }
else if (!(flag & 1)) {
2004 if (num_attrs == 0) {
2008 if (acl_saved && (a_acl != NULL || d_acl != NULL)) {
2016 sret =
aaip_encode(num_attrs, names, value_lengths, values,
2017 &result_len, &result, 0);
2051 &m_num, &m_names, &m_value_lengths, &m_values, 1 << 15);
2058 char **text,
size_t *text_fill,
int flag)
2064 consumed, NULL, (
size_t) 0, text_fill, 1);
2067 if (*text_fill == 0)
2069 *text = calloc(*text_fill + 42, 1);
2073 consumed, *text, *text_fill, text_fill, 0);
2090 size_t *value_lengths,
char **values, mode_t st_mode,
2091 char **access_text,
char **default_text,
int flag)
2093 size_t i, consumed, text_fill = 0;
2095 unsigned char *v_data;
2096 int ret, from_posix= 0;
2098 if (flag & (1 << 15)) {
2099 if (*access_text != NULL)
2101 *access_text = NULL;
2102 if (*default_text != NULL)
2103 free(*default_text);
2104 *default_text = NULL;
2108 *access_text = *default_text = NULL;
2109 for(i = 0; i < num_attrs; i++) {
2113 v_data = (
unsigned char *) values[i];
2114 v_len = value_lengths[i];
2118 &consumed, access_text, &text_fill, 0);
2125 &consumed, default_text, &text_fill, 0);
2132 if (*access_text == NULL && !(flag & 16)) {
2134 *access_text = calloc(42, 1);
2136 if (*access_text != NULL) {
2138 text_fill = strlen(*access_text);
2141 if (*access_text == NULL && *default_text == NULL)
2144 ret = 1 + from_posix;
2155 char **access_text,
char **default_text,
int flag)
2157 size_t num_attrs = 0, *value_lengths = NULL;
2158 char **names = NULL, **values = NULL;
2162 if (flag & (1 << 15)) {
2164 access_text, default_text, 1 << 15);
2168 &value_lengths, &values, 1);
2173 st_mode, access_text, default_text, flag);
2175 &value_lengths, &values, 1 << 15);
2181 char **access_text,
char **default_text,
int flag)
2184 size_t num_attrs = 0, *value_lengths = NULL;
2185 char **names = NULL, **values = NULL;
2187 if (flag & (1 << 15)) {
2189 access_text, default_text, 1 << 15);
2193 &value_lengths, &values, 1);
2197 st_mode, access_text, default_text, flag);
2208 size_t num_attrs = 0, *value_lengths = NULL, i, j, consumed;
2209 size_t a_text_fill = 0, d_text_fill = 0;
2210 size_t v_len, acl_len= 0;
2211 char **names = NULL, **values = NULL, *a_text = NULL, *d_text = NULL;
2213 unsigned char *v_data, *acl= NULL;
2225 &value_lengths, &values, 1);
2229 for(i = 0; i < num_attrs; i++) {
2232 v_data = (
unsigned char *) values[i];
2233 v_len = value_lengths[i];
2237 &a_text, &a_text_fill, 0);
2254 if (a_text == NULL) {
2265 2 | 8 | ((flag & 4) << 2));
2268 if (access_text != NULL || default_text != NULL)
2271 2 | 8 | ((flag & 4) << 2));
2275 else if (ret <= 0 && ret >= -3)
2287 &a_text, &a_text_fill, 0);
2298 if (values[i] != NULL)
2300 for (j = i + 1; j < num_attrs; j++) {
2301 names[j - 1] = names[j];
2302 value_lengths[j - 1] = value_lengths[j];
2303 values[j - 1] = values[j];
2308 if (values[i] != NULL)
2310 values[i] = (
char *) acl;
2312 value_lengths[i] = acl_len;
2324 if ((flag & 2) || (access_text == NULL && default_text == NULL)) {
2330 st_mode, &acl_len, &acl,
2331 2 | 8 | ((flag & 4) << 2));
2344 names[num_attrs] = strdup(
"");
2345 if (names[num_attrs] == NULL) {
2349 values[num_attrs] = (
char *) acl;
2351 value_lengths[num_attrs] = acl_len;
2361 if(access_text != NULL && !(flag & (1 | 2))) {
2375 &value_lengths, &values, 1 << 15);
2394 char *a_text = NULL, *d_text = NULL;
2428 if (old_data == NULL)
2431 if (*new_data == NULL)
2474 if (input_stream == NULL)
2476 stream = input_stream;
2478 version = ((flag >> 8) & 0xff);
2479 algo[0] = algo[1] = 0;
2484 if (version < 2 && ret > 0 && (algo[0] !=
'p' || algo[1] !=
'z'))
2486 if (ret != 1 || stream_type != 2) {
2489 algo[0] = algo[1] = 0;
2510 int ret = 1, total_ret = 0, hflag;
2537 hflag = flag & 0xff06;
2550 }
else if (total_ret >= 0) {
2576 *new_data = calloc(1,
sizeof(ino_t));
2577 if (*new_data == NULL)
2579 memcpy(*new_data, old_data,
sizeof(ino_t));
2580 return (
int)
sizeof(ino_t);
2593 ino_t *ino_id,
int flag)
2607 *ino_id = *((ino_t *) xipt);
2626 *fs_id = symlink->
fs_id;
2627 *dev_id = symlink->
st_dev;
2628 *ino_id = symlink->
st_ino;
2637 *fs_id = special->
fs_id;
2638 *dev_id = special->
st_dev;
2639 *ino_id = special->
st_ino;
2664 xipt = calloc(1,
sizeof(ino_t));
2667 memcpy(xipt, &ino,
sizeof(ino_t));
2692 if (ret < 0 || ret == 1)
2746 unsigned int fs_id1, fs_id2;
2747 dev_t dev_id1, dev_id2;
2748 ino_t ino_id1, ino_id2;
2749 IsoFile *f1 = NULL, *f2 = NULL;
2757 return (n1->
type < n2->
type ? -1 : 1);
2763 return (ret1 < ret2 ? -1 : 1);
2768 if (ino_id1 != ino_id2)
2769 return (ino_id1 < ino_id2 ? -1 : 1);
2771 return (n1 < n2 ? -1 : 1);
2772 goto image_inode_match;
2792 dev_id2 = l2->st_dev;
2793 ino_id2 = l2->st_ino;
2803 dev_id2 = s2->st_dev;
2804 ino_id2 = s2->st_ino;
2807 return (n1 < n2 ? -1 : 1);
2809 if (fs_id1 != fs_id2)
2810 return (fs_id1 < fs_id2 ? -1 : 1);
2811 if (dev_id1 != dev_id2)
2812 return (dev_id1 < dev_id2 ? -1 : 1);
2813 if (ino_id1 != ino_id2)
2814 return (ino_id1 < ino_id2 ? -1 : 1);
2815 if (fs_id1 == 0 && dev_id1 == 0 && ino_id1 == 0)
2816 return (n1 < n2 ? -1 : 1);
2824 return (n1 < n2 ? -1 : 1);
2834 ret1 = strcmp(l1->
dest, l2->dest);
2840 if (s1->
dev != s2->dev)
2841 return (s1->
dev < s2->dev ? -1 : 1);
2845 return (n1->
mode < n2->
mode ? -1 : 1);
2847 return (n1->
uid < n2->
uid ? -1 : 1);
2849 return (n1->
gid < n2->
gid ? -1 : 1);
2864 return (ret1 < ret2 ? -1 : 1);
2869 return (ret1 < ret2 ? -1 : 1);
2870 ret1 = memcmp(x1, x2, ret1);
2890 static char *names =
"isofs.cx";
2891 static size_t value_lengths[1] = {4};
2892 unsigned char value[4];
2896 valuept= (
char *) value;
2899 &names, value_lengths, &valuept, 4 | 8);
2902 for(i = 0; i < 4; i++)
2903 value[3 - i] = (checksum_index >> (8 * i)) & 0xff;
2905 &names, value_lengths, &valuept, 2 | 8);
2911 uint32_t count, uint32_t size,
char *typetext,
2915 int result_len, ret;
2916 static char *names =
"isofs.ca";
2917 static size_t value_lengths[1];
2929 strncpy(wpt, typetext, 80);
2930 if (strlen(typetext) > 80)
2933 wpt += strlen(typetext);
2934 value_lengths[0] = wpt -
buffer;
2936 &names, value_lengths, &valuept, 2 | 8);
2942 uint32_t *count, uint32_t *size,
char typetext[81],
2947 char *value = NULL, *rpt;
2957 value_len - (rpt - value), 0);
2960 value_len - (rpt - value), 0);
2963 value_len - (rpt - value), 0);
2966 value_len - (rpt - value), 0);
2968 len = value_len - (rpt - value);
2971 memcpy(typetext, rpt, len);
2983 uint32_t truncate_length,
int flag)
2986 int result_len, ret;
2987 static char *names =
"isofs.nt";
2988 static size_t value_lengths[1];
2994 value_lengths[0] = wpt -
buffer;
2996 &names, value_lengths, &valuept, 2 | 8);
3002 uint32_t *truncate_length,
int flag)
3006 char *value = NULL, *rpt;
3014 value_len - (rpt - value), 0);
3017 value_len - (rpt - value), 0);
3038 memcpy(md5, (
char *) xipt, 16);
3045 &value_len, &value, 0);
3048 if (value_len > 4) {
3052 for (i = 0; i < (int) value_len; i++)
3053 idx = (idx << 8) | ((
unsigned char *) value)[i];
3060 memcpy(md5, image->
checksum_array + ((
size_t) 16) * ((
size_t) idx),
3079 md5 = calloc(16, 1);
ssize_t aaip_encode(size_t num_attrs, char **names, size_t *value_lengths, char **values, size_t *result_len, unsigned char **result, int flag)
int aaip_add_acl_st_mode(char *acl_text, mode_t st_mode, int flag)
size_t aaip_count_bytes(unsigned char *data, int flag)
int aaip_get_decoded_attrs(struct aaip_state **handle, size_t *num_attrs, char ***names, size_t **value_lengths, char ***values, int flag)
int aaip_cleanout_st_mode(char *acl_text, mode_t *in_st_mode, int flag)
int aaip_decode_acl(unsigned char *data, size_t num_data, size_t *consumed, char *acl_text, size_t acl_text_size, size_t *acl_text_fill, int flag)
int aaip_decode_attrs(struct aaip_state **handle, size_t memory_limit, size_t num_attr_limit, unsigned char *data, size_t num_data, size_t *consumed, int flag)
int aaip_encode_both_acl(char *a_acl_text, char *d_acl_text, mode_t st_mode, size_t *result_len, unsigned char **result, int flag)
int iso_file_get_old_image_sections(IsoFile *file, int *section_count, struct iso_file_section **sections, int flag)
uint32_t img_give_ino_number(IsoImage *image, int flag)
int checksum_md5_xinfo_func(void *data, int flag)
int iso_util_decode_len_bytes(uint32_t *data, char *buffer, int *data_len, int buffer_len, int flag)
int iso_util_encode_len_bytes(uint32_t data, char *buffer, int data_len, int *result_len, int flag)
int iso_truncate_rr_name(int truncate_mode, int truncate_length, char *name, int flag)
#define LIBISO_FREE_MEM(pt)
#define ISO_AAIP_NON_USER_NAME
IsoStream * iso_stream_get_input_stream(IsoStream *stream, int flag)
int iso_nowtime(time_t *now, int flag)
int(* iso_node_xinfo_func)(void *data, int flag)
off_t iso_stream_get_size(IsoStream *stream)
#define ISO_XINFO_NO_CLONE
#define ISO_RR_PATH_TOO_LONG
@ ISO_REPLACE_IF_SAME_TYPE_AND_NEWER
@ ISO_REPLACE_IF_SAME_TYPE
#define ISO_WRONG_ARG_VALUE
void iso_stream_get_id(IsoStream *stream, unsigned int *fs_id, dev_t *dev_id, ino_t *ino_id)
#define ISO_AAIP_BAD_AASTRING
int aaip_xinfo_func(void *data, int flag)
#define ISO_AAIP_BAD_ACL_TEXT
int(* iso_node_xinfo_cloner)(void *old_data, void **new_data, int flag)
#define ISO_NODE_IS_FILE(n)
int iso_stream_cmp_ino(IsoStream *s1, IsoStream *s2, int flag)
#define ISO_RR_NAME_RESERVED
#define ISO_NODE_NOT_ADDED_TO_DIR
void iso_stream_unref(IsoStream *stream)
int iso_node_xinfo_get_cloner(iso_node_xinfo_func proc, iso_node_xinfo_cloner *cloner, int flag)
#define ISO_RR_NAME_TOO_LONG
#define ISO_NODE_ALREADY_ADDED
#define ISO_NODE_NAME_NOT_UNIQUE
#define ISO_ASSERT_FAILURE
int iso_msg_submit(int imgid, int errcode, int causedby, const char *fmt,...)
void iso_node_set_permissions(IsoNode *node, mode_t mode)
int iso_file_get_md5(IsoImage *image, IsoFile *file, char md5[16], int flag)
IsoStream * iso_file_get_stream(IsoFile *file)
int iso_file_get_old_image_lba(IsoFile *file, uint32_t *lba, int flag)
int iso_px_ino_xinfo_cloner(void *old_data, void **new_data, int flag)
int iso_dir_get_node_trunc(IsoDir *dir, int truncate_length, const char *name, IsoNode **node)
int iso_root_get_isofsnt(IsoNode *node, uint32_t *truncate_mode, uint32_t *truncate_length, int flag)
int iso_node_get_id(IsoNode *node, unsigned int *fs_id, dev_t *dev_id, ino_t *ino_id, int flag)
int iso_root_set_isofsca(IsoNode *node, uint32_t start_lba, uint32_t end_lba, uint32_t count, uint32_t size, char *typetext, int flag)
static int attr_enlarge_list(char ***names, size_t **value_lengths, char ***values, size_t new_num, int flag)
int iso_px_ino_xinfo_func(void *data, int flag)
static int iter_has_next(IsoDirIter *iter)
int iso_node_is_valid_link_dest(const char *dest)
int iso_file_set_isofscx(IsoFile *file, unsigned int checksum_index, int flag)
int iso_node_lookup_attr(IsoNode *node, char *name, size_t *value_length, char **value, int flag)
static IsoNode ** iso_dir_find_node(IsoDir *dir, IsoNode *node)
int iso_node_zf_by_magic(IsoNode *node, int flag)
int iso_node_new_dir(char *name, IsoDir **dir)
int iso_node_get_attrs(IsoNode *node, size_t *num_attrs, char ***names, size_t **value_lengths, char ***values, int flag)
void iso_node_unref(IsoNode *node)
int iso_aa_get_attrs(unsigned char *aa_string, size_t *num_attrs, char ***names, size_t **value_lengths, char ***values, int flag)
int iso_node_new_file(char *name, IsoStream *stream, IsoFile **file)
int iso_node_set_attrs(IsoNode *node, size_t num_attrs, char **names, size_t *value_lengths, char **values, int flag)
int iso_dir_get_node(IsoDir *dir, const char *name, IsoNode **node)
int iso_dir_get_children(const IsoDir *dir, IsoDirIter **iter)
off_t iso_file_get_size(IsoFile *file)
int iso_node_remove_xinfo(IsoNode *node, iso_node_xinfo_func proc)
int iso_dir_insert(IsoDir *dir, IsoNode *node, IsoNode **pos, enum iso_replace_mode replace)
mode_t iso_node_get_mode(const IsoNode *node)
int zisofs_zf_xinfo_cloner(void *old_data, void **new_data, int flag)
int iso_node_get_xinfo(IsoNode *node, iso_node_xinfo_func proc, void **data)
int iso_node_set_acl_text(IsoNode *node, char *access_text, char *default_text, int flag)
static int iso_attr_get_acl_text(size_t num_attrs, char **names, size_t *value_lengths, char **values, mode_t st_mode, char **access_text, char **default_text, int flag)
int iso_node_take(IsoNode *node)
void iso_node_set_gid(IsoNode *node, gid_t gid)
const char * iso_node_get_name(const IsoNode *node)
int iso_node_remove_tree(IsoNode *node, IsoDirIter *boss_iter)
int iso_dir_add_node(IsoDir *dir, IsoNode *child, enum iso_replace_mode replace)
static int iter_remove(IsoDirIter *iter)
int iso_dir_iter_remove(IsoDirIter *iter)
int iso_node_is_valid_name(const char *name)
int iso_root_set_isofsnt(IsoNode *node, uint32_t truncate_mode, uint32_t truncate_length, int flag)
IsoDir * iso_node_get_parent(IsoNode *node)
void iso_node_set_ctime(IsoNode *node, time_t time)
int iso_dir_iter_take(IsoDirIter *iter)
int iso_node_set_name_trunc(IsoNode *node, const char *in_name, int truncate_length, int flag)
static int iter_next(IsoDirIter *iter, IsoNode **node)
void iso_node_set_hidden(IsoNode *node, int hide_attrs)
int iso_node_new_special(char *name, mode_t mode, dev_t dev, IsoSpecial **special)
time_t iso_node_get_atime(const IsoNode *node)
int iso_node_set_name(IsoNode *node, const char *name)
void iso_node_set_mtime(IsoNode *node, time_t time)
static int iso_node_merge_xattr(IsoNode *node, size_t num_attrs, char **names, size_t *value_lengths, char **values, size_t *m_num_attrs, char ***m_names, size_t **m_value_lengths, char ***m_values, int flag)
int iso_dir_exists(IsoDir *dir, const char *name, IsoNode ***pos)
int iso_node_get_next_xinfo(IsoNode *node, void **handle, iso_node_xinfo_func *proc, void **data)
static int iso_decode_acl(unsigned char *v_data, size_t v_len, size_t *consumed, char **text, size_t *text_fill, int flag)
int iso_node_clone_xinfo(IsoNode *from_node, IsoNode *to_node, int flag)
int iso_node_new_symlink(char *name, char *dest, IsoSymlink **link)
int iso_aa_lookup_attr(unsigned char *aa_string, char *name, size_t *value_length, char **value, int flag)
time_t iso_node_get_ctime(const IsoNode *node)
static int attrs_cleanout_name(char *del_name, size_t *num_attrs, char **names, size_t *value_lengths, char **values, int flag)
void iso_node_ref(IsoNode *node)
int iso_file_get_sort_weight(IsoFile *file)
int iso_node_cmp_flag(IsoNode *n1, IsoNode *n2, int flag)
int iso_node_add_xinfo(IsoNode *node, iso_node_xinfo_func proc, void *data)
int iso_dir_iter_next(IsoDirIter *iter, IsoNode **node)
static struct iso_dir_iter_iface iter_class
int iso_root_get_isofsca(IsoNode *node, uint32_t *start_lba, uint32_t *end_lba, uint32_t *count, uint32_t *size, char typetext[81], int flag)
mode_t iso_node_get_permissions(const IsoNode *node)
int iso_image_dir_get_node(IsoImage *image, IsoDir *dir, const char *name, IsoNode **node, int flag)
int iso_node_remove_all_xinfo(IsoNode *node, int flag)
mode_t iso_node_get_perms_wo_acl(const IsoNode *node)
gid_t iso_node_get_gid(const IsoNode *node)
int iso_node_set_perms_internal(IsoNode *node, mode_t mode, int flag)
void iso_node_set_atime(IsoNode *node, time_t time)
void iso_dir_iter_unregister(IsoDirIter *iter)
void iso_dir_iter_free(IsoDirIter *iter)
int iso_dir_iter_register(IsoDirIter *iter)
enum IsoNodeType iso_node_get_type(IsoNode *node)
static int iter_take(IsoDirIter *iter)
int iso_dir_iter_has_next(IsoDirIter *iter)
int iso_file_zf_by_magic(IsoFile *file, int flag)
int iso_node_get_hidden(IsoNode *node)
int iso_node_get_old_image_lba(IsoNode *node, uint32_t *lba, int flag)
int iso_symlink_set_dest(IsoSymlink *link, const char *dest)
void iso_node_set_uid(IsoNode *node, uid_t uid)
void iter_notify_child_taken(IsoDirIter *iter, IsoNode *node)
int iso_node_new_root(IsoDir **root)
int iso_dir_get_children_count(IsoDir *dir)
int iso_node_remove(IsoNode *node)
int zisofs_zf_xinfo_func(void *data, int flag)
const char * iso_symlink_get_dest(const IsoSymlink *link)
static int iso_node_revert_xinfo_list(IsoNode *node, int flag)
void iso_notify_dir_iters(IsoNode *node, int flag)
void iso_dir_find(IsoDir *dir, const char *name, IsoNode ***pos)
time_t iso_node_get_mtime(const IsoNode *node)
int iso_image_set_node_name(IsoImage *image, IsoNode *node, const char *name, int flag)
int iso_node_set_unique_id(IsoNode *node, IsoImage *image, int flag)
dev_t iso_special_get_dev(IsoSpecial *special)
static int iso_node_set_ino_xinfo(IsoNode *node, ino_t ino, int flag)
static struct iter_reg_node * iter_reg
int iso_node_set_ino(IsoNode *node, ino_t ino, int flag)
int iso_aa_get_acl_text(unsigned char *aa_string, mode_t st_mode, char **access_text, char **default_text, int flag)
int iso_node_get_acl_text(IsoNode *node, char **access_text, char **default_text, int flag)
int iso_file_make_md5(IsoFile *file, int flag)
int iso_node_cmp_ino(IsoNode *n1, IsoNode *n2, int flag)
void iso_node_set_sort_weight(IsoNode *node, int w)
uid_t iso_node_get_uid(const IsoNode *node)
static void iter_free(IsoDirIter *iter)
#define LIBISOFS_NODE_PATH_MAX
#define LIBISOFS_NODE_NAME_MAX
int iso_stream_make_md5(IsoStream *stream, char md5[16], int flag)
int iso_stream_set_image_ino(IsoStream *stream, ino_t ino, int flag)
struct iso_dir_iter_iface * class
unsigned int from_old_session
uint32_t checksum_idx_count
void(* free)(IsoDirIter *iter)
int(* remove)(IsoDirIter *iter)
void(* notify_child_taken)(IsoDirIter *iter, IsoNode *node)
int(* take)(IsoDirIter *iter)
int(* next)(IsoDirIter *iter, IsoNode **node)
int(* has_next)(IsoDirIter *iter)
iso_node_xinfo_func process
struct iter_reg_node * next
uint64_t uncompressed_size
int ziso_is_zisofs_stream(IsoStream *stream, int *stream_type, uint8_t zisofs_algo[2], int *header_size_div4, int *block_size_log2, uint64_t *uncompressed_size, int flag)