"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "xorriso/iso_tree.c" between
libisoburn-1.5.0.tar.gz and libisoburn-1.5.2.tar.gz

About: libisoburn is a frontend for the libraries libburn and libisofs which enables creation and expansion of ISO-9660 filesystems on all media and file types supported by libburn. It implements the API and command interpreter of program xorriso, and installs this program as small dynamically linked binary. xorriso is suitable for incremental data backup and for production of bootable ISO 9660 images. A statically linked version is available as GNU xorriso.

iso_tree.c  (libisoburn-1.5.0):iso_tree.c  (libisoburn-1.5.2)
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2016 Thomas Schmitt, <scdbackup@gmx.net> Copyright 2007-2019 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later. Provided under GPL version 2 or later.
This file contains functions which access nodes of the This file contains functions which access nodes of the
libisofs tree model. libisofs tree model.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "../config.h" #include "../config.h"
#endif #endif
skipping to change at line 488 skipping to change at line 488
ret= 0; ret= 0;
else if(Sfile_str(path, found_path, 0) <= 0) else if(Sfile_str(path, found_path, 0) <= 0)
ret= -1; ret= -1;
} }
Findjob_destroy(&job, 0); Findjob_destroy(&job, 0);
return(ret); return(ret);
} }
/* @param flag bit0= in_node is valid, do not resolve iso_adr /* @param flag bit0= in_node is valid, do not resolve iso_adr
bit2= recognize and parse split parts despite bit2= recognize and parse split parts despite
xorrio->split_size <= 0 xorriso->split_size <= 0
*/ */
int Xorriso_identify_split(struct XorrisO *xorriso, char *iso_adr, int Xorriso_identify_split(struct XorrisO *xorriso, char *iso_adr,
void *in_node, void *in_node,
struct SplitparT **parts, int *count, struct SplitparT **parts, int *count,
struct stat *total_stbuf, int flag) struct stat *total_stbuf, int flag)
{ {
int ret, i, incomplete= 0, overlapping= 0; int ret, i, incomplete= 0, overlapping= 0;
int partno, total_parts, first_total_parts= -1; int partno, total_parts, first_total_parts= -1;
off_t offset, bytes, total_bytes, first_total_bytes= -1, first_bytes= -1; off_t offset, bytes, total_bytes, first_total_bytes= -1, first_bytes= -1;
off_t size, covered; off_t size, covered;
skipping to change at line 619 skipping to change at line 619
total_stbuf->st_size= total_bytes; total_stbuf->st_size= total_bytes;
ret= !(overlapping || incomplete); ret= !(overlapping || incomplete);
ex:; ex:;
if(iter!=NULL) if(iter!=NULL)
iso_dir_iter_free(iter); iso_dir_iter_free(iter);
return(ret); return(ret);
} }
/* @param flag bit0= node is valid, do not resolve path /* @param flag bit0= node is valid, do not resolve path
bit1= insist in complete collection of part files bit1= insist in complete collection of part files
bit2= recognize and parse split parts despite
xorriso->split_size <= 0
*/ */
int Xorriso_is_split(struct XorrisO *xorriso, char *path, void *node, int Xorriso_is_split(struct XorrisO *xorriso, char *path, void *node,
int flag) int flag)
{ {
struct SplitparT *split_parts= NULL; struct SplitparT *split_parts= NULL;
int split_count= 0, ret; int split_count= 0, ret;
struct stat stbuf; struct stat stbuf;
ret= Xorriso_identify_split(xorriso, path, node, &split_parts, ret= Xorriso_identify_split(xorriso, path, node, &split_parts,
&split_count, &stbuf, flag & 3); &split_count, &stbuf, flag & 7);
if(split_parts!=NULL) if(split_parts!=NULL)
Splitparts_destroy(&split_parts, split_count, 0); Splitparts_destroy(&split_parts, split_count, 0);
return(ret>0); return(ret>0);
} }
/* @param node Opaque handle to IsoNode which is to be inquired instead of path if it is not NULL. /* @param node Opaque handle to IsoNode which is to be inquired instead of path if it is not NULL.
@param path is used as address if node is NULL. @param path is used as address if node is NULL.
@param acl_text if acl_text is not NULL, then *acl_text will be set to the @param acl_text if acl_text is not NULL, then *acl_text will be set to the
ACL text (without comments) of the file object. In this ACL text (without comments) of the file object. In this
case it finally has to be freed by the caller. case it finally has to be freed by the caller.
skipping to change at line 1381 skipping to change at line 1383
if(ret < 0) { if(ret < 0) {
Xorriso_report_iso_error(xorriso, "", ret, Xorriso_report_iso_error(xorriso, "", ret,
"Error when computing MD5", 0, "FAILURE", 1); "Error when computing MD5", 0, "FAILURE", 1);
return(0); return(0);
} }
Xorriso_set_change_pending(xorriso, 1); Xorriso_set_change_pending(xorriso, 1);
return(1); return(1);
} }
/* @param flag bit0= do not only sum up sizes but also print subdirs /* @param flag bit0= do not only sum up sizes but also print subdirs
bit2= do not report result by Xorriso_result()
*/ */
int Xorriso_show_du_subs(struct XorrisO *xorriso, IsoDir *dir_node, int Xorriso_show_du_subs(struct XorrisO *xorriso, IsoDir *dir_node,
char *abs_path, char *rel_path, off_t *size, char *abs_path, char *rel_path, off_t *size,
off_t boss_mem, int flag) off_t boss_mem, int flag)
{ {
int i, ret, no_sort= 0, filec= 0, l; int i, ret, no_sort= 0, filec= 0, l;
IsoDirIter *iter= NULL; IsoDirIter *iter= NULL;
IsoNode *node, **node_array= NULL; IsoNode *node, **node_array= NULL;
char *name; char *name;
off_t sub_size, report_size, mem= 0; off_t sub_size, report_size, mem= 0;
skipping to change at line 1497 skipping to change at line 1501
sub_size+= iso_file_get_size((IsoFile *) node)+2048; sub_size+= iso_file_get_size((IsoFile *) node)+2048;
/* /*
sub_size+= iso_tree_node_get_size((IsoFile *) node)+strlen(name)+1; sub_size+= iso_tree_node_get_size((IsoFile *) node)+strlen(name)+1;
*/ */
} }
if(sub_size>0) if(sub_size>0)
(*size)+= sub_size; (*size)+= sub_size;
report_size= sub_size/1024; report_size= sub_size/1024;
if(report_size*1024<sub_size) if(report_size*1024<sub_size)
report_size++; report_size++;
if(xorriso->sh_style_result) if(!(flag & 4)) {
sprintf(xorriso->result_line, "%-7.f ",(double) (report_size)); if(xorriso->sh_style_result)
else sprintf(xorriso->result_line, "%-7.f ",(double) (report_size));
sprintf(xorriso->result_line, "%7.f ",(double) (report_size)); else
sprintf(xorriso->result_line+strlen(xorriso->result_line), "%s\n", sprintf(xorriso->result_line, "%7.f ",(double) (report_size));
Xorriso_esc_filepath(xorriso, show_path, sfe, 0)); sprintf(xorriso->result_line+strlen(xorriso->result_line), "%s\n",
Xorriso_result(xorriso, 0); Xorriso_esc_filepath(xorriso, show_path, sfe, 0));
Xorriso_result(xorriso, 0);
}
} }
ret= 1; ret= 1;
ex:; ex:;
Xorriso_free_meM(sfe); Xorriso_free_meM(sfe);
Xorriso_free_meM(path); Xorriso_free_meM(path);
Xorriso_free_meM(show_path); Xorriso_free_meM(show_path);
if(iter!=NULL) if(iter!=NULL)
iso_dir_iter_free(iter); iso_dir_iter_free(iter);
if(node_array!=NULL) if(node_array!=NULL)
free((char *) node_array); free((char *) node_array);
skipping to change at line 1820 skipping to change at line 1826
strcat(xorriso->result_line, "\n"); strcat(xorriso->result_line, "\n");
Xorriso_result(xorriso, 0); Xorriso_result(xorriso, 0);
} }
ret= !was_error; ret= !was_error;
ex:; ex:;
Xorriso_free_meM(path); Xorriso_free_meM(path);
Xorriso_free_meM(link_target); Xorriso_free_meM(link_target);
return(ret); return(ret);
} }
/*
@return: <=0 = error, 1= directory tree, 2= path leads to non-directory
*/
int Xorriso_get_dus(struct XorrisO *xorriso, char *iso_rr_path, off_t *size,
off_t boss_mem, int flag)
{
int ret;
IsoNode *node;
char *path= NULL;
struct stat stbuf;
Xorriso_alloc_meM(path, char, SfileadrL);
ret= Xorriso_make_abs_adr(xorriso, xorriso->wdi, iso_rr_path, path,
1 | 2 | 4);
if(ret <= 0)
goto ex;
ret= Xorriso_fake_stbuf(xorriso, path, &stbuf, &node, 0);
if(ret <= 0)
goto ex;
if(!S_ISDIR(stbuf.st_mode)) {
*size= stbuf.st_size;
ret= 2; goto ex;
}
ret= Xorriso_show_du_subs(xorriso, (IsoDir *) node, path, iso_rr_path, size,
boss_mem, 4);
if(ret <= 0)
goto ex;
ret= 1;
ex:
Xorriso_free_meM(path);
return(ret);
}
/* This function needs less buffer memory than Xorriso_ls_filev() but cannot /* This function needs less buffer memory than Xorriso_ls_filev() but cannot
perform structured pattern matching as done by Xorriso_expand_pattern() perform structured pattern matching as done by Xorriso_expand_pattern()
for subsequent Xorriso_ls_filev(). for subsequent Xorriso_ls_filev().
@param flag bit0= long format @param flag bit0= long format
bit1= only check for directory existence bit1= only check for directory existence
bit2= do not apply search pattern but accept any file bit2= do not apply search pattern but accept any file
bit3= just count nodes and return number bit3= just count nodes and return number
*/ */
int Xorriso_ls(struct XorrisO *xorriso, int flag) int Xorriso_ls(struct XorrisO *xorriso, int flag)
{ {
 End of changes. 7 change blocks. 
10 lines changed or deleted 50 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)