Begin of porting to next generation libisofs

This commit is contained in:
Thomas Schmitt 2008-01-10 11:45:53 +00:00
parent d2ea771b3b
commit a1cd5596fc
4 changed files with 3335 additions and 20 deletions

View File

@ -16,6 +16,7 @@ largefile_opts="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1"
do_strip=0 do_strip=0
static_opts= static_opts=
warn_opts="-Wall" warn_opts="-Wall"
nglibisofs=0
for i in "$@" for i in "$@"
do do
@ -38,13 +39,69 @@ do
echo " -do_strip apply program strip to compiled programs." echo " -do_strip apply program strip to compiled programs."
echo " -g produce debuggable programm." echo " -g produce debuggable programm."
echo " -static compile with cc option -static." echo " -static compile with cc option -static."
echo " -nglibisofs ... will fail at compile time."
echo " -oglibisofs ... might fail at run time."
exit 0 exit 0
elif test "$i" = "-nglibisofs"
then
nglibisofs=1
isofs=./nglibisofs-develop/src
elif test "$i" = "-oglibisofs"
then
nglibisofs=0
isofs=./libisofs-develop/libisofs
elif test "$i" = "-static" elif test "$i" = "-static"
then then
static_opts="-static" static_opts="-static"
fi fi
done done
libisofs=
if test "$nglibisofs" = 1
then
libisofs="$libisofs $isofs"/buffer.o
libisofs="$libisofs $isofs"/builder.o
libisofs="$libisofs $isofs"/data_source.o
libisofs="$libisofs $isofs"/ecma119.o
libisofs="$libisofs $isofs"/ecma119_tree.o
libisofs="$libisofs $isofs"/filesrc.o
libisofs="$libisofs $isofs"/fs_image.o
libisofs="$libisofs $isofs"/fs_local.o
libisofs="$libisofs $isofs"/fsource.o
libisofs="$libisofs $isofs"/image.o
libisofs="$libisofs $isofs"/joliet.o
libisofs="$libisofs $isofs"/libiso_msgs.o
libisofs="$libisofs $isofs"/messages.o
libisofs="$libisofs $isofs"/node.o
libisofs="$libisofs $isofs"/rockridge.o
libisofs="$libisofs $isofs"/rockridge_read.o
libisofs="$libisofs $isofs"/stream.o
libisofs="$libisofs $isofs"/tree.o
libisofs="$libisofs $isofs"/util.o
libisofs="$libisofs $isofs"/util_rbtree.o
xorrisoburn_c="ng_xorrisoburn.c"
else
libisofs="$libisofs $isofs"/data_source.o
libisofs="$libisofs $isofs"/ecma119.o
libisofs="$libisofs $isofs"/ecma119_read.o
libisofs="$libisofs $isofs"/ecma119_read_rr.o
libisofs="$libisofs $isofs"/ecma119_tree.o
libisofs="$libisofs $isofs"/eltorito.o
libisofs="$libisofs $isofs"/exclude.o
libisofs="$libisofs $isofs"/file.o
libisofs="$libisofs $isofs"/file_src.o
libisofs="$libisofs $isofs"/hash.o
libisofs="$libisofs $isofs"/joliet.o
libisofs="$libisofs $isofs"/libiso_msgs.o
libisofs="$libisofs $isofs"/messages.o
libisofs="$libisofs $isofs"/rockridge.o
libisofs="$libisofs $isofs"/susp.o
libisofs="$libisofs $isofs"/tree.o
libisofs="$libisofs $isofs"/util.o
libisofs="$libisofs $isofs"/volume.o
xorrisoburn_c="xorrisoburn.c"
fi
echo "+ $libisofs"
timestamp="$(date -u '+%Y.%m.%d.%H%M%S')" timestamp="$(date -u '+%Y.%m.%d.%H%M%S')"
echo "Version timestamp : $(sed -e 's/#define Xorriso_timestamP "//' -e 's/"$//' "$xorr"/xorriso_timestamp.h)" echo "Version timestamp : $(sed -e 's/#define Xorriso_timestamP "//' -e 's/"$//' "$xorr"/xorriso_timestamp.h)"
@ -64,7 +121,7 @@ cc -I. -DXorriso_with_maiN -DXorriso_with_regeX -DXorriso_with_readlinE \
\ \
"$xorr"/xorriso.c \ "$xorr"/xorriso.c \
\ \
"$xorr"/xorrisoburn.c \ "$xorr"/"$xorrisoburn_c" \
\ \
"$burn"/async.o \ "$burn"/async.o \
"$burn"/debug.o \ "$burn"/debug.o \
@ -98,24 +155,7 @@ cc -I. -DXorriso_with_maiN -DXorriso_with_regeX -DXorriso_with_readlinE \
"$isoburn"/data_source.o \ "$isoburn"/data_source.o \
"$isoburn"/isofs_wrap.o \ "$isoburn"/isofs_wrap.o \
\ \
"$isofs"/data_source.o \ $libisofs \
"$isofs"/ecma119.o \
"$isofs"/ecma119_read.o \
"$isofs"/ecma119_read_rr.o \
"$isofs"/ecma119_tree.o \
"$isofs"/eltorito.o \
"$isofs"/exclude.o \
"$isofs"/file.o \
"$isofs"/file_src.o \
"$isofs"/hash.o \
"$isofs"/joliet.o \
"$isofs"/libiso_msgs.o \
"$isofs"/messages.o \
"$isofs"/rockridge.o \
"$isofs"/susp.o \
"$isofs"/tree.o \
"$isofs"/util.o \
"$isofs"/volume.o \
\ \
-lreadline \ -lreadline \
\ \

3142
test/ng_xorrisoburn.c Normal file

File diff suppressed because it is too large Load Diff

133
test/ng_xorrisoburn.h Normal file
View File

@ -0,0 +1,133 @@
/* Adapter to libisoburn, libisofs and libburn for xorriso,
a command line oriented batch and dialog tool which creates, loads,
manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2008 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2.
This file contains the inner isofs- and burn-library interface of xorriso.
*/
#ifndef Xorrisoburn_includeD
#define Xorrisoburn_includeD yes
struct XorrisO;
struct FindjoB;
int Xorriso_startup_libraries(struct XorrisO *xorriso, int flag);
int Xorriso_create_empty_iso(struct XorrisO *xorriso, int flag);
/* @param flag bit0=aquire as isoburn input drive
bit1=aquire as libburn output drive (as isoburn drive if bit0)
@return <=0 failure , 1=success , 2=neither readable or writeable
*/
int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag);
int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag);
int Xorriso_write_session(struct XorrisO *xorriso, int flag);
/* @param flag bit0=graft in as empty directory, not as copy from disk
@return <=0 = error , 1 = added simple node , 2 = added directory
*/
int Xorriso_graft_in(struct XorrisO *xorriso, char *disk_path, char *img_path,
int flag);
int Xorriso__text_to_sev(char *severity_name, int *severity_number,int flag);
/* @param flag bit0=report about output drive
bit1=short report form
*/
int Xorriso_toc(struct XorrisO *xorriso, int flag);
int Xorriso_show_devices(struct XorrisO *xorriso, int flag);
int Xorriso_tell_media_space(struct XorrisO *xorriso,
int *media_space, int *free_space, int flag);
int Xorriso_blank_media(struct XorrisO *xorriso, int flag);
int Xorriso_format_media(struct XorrisO *xorriso, int flag);
/* @param boss_iter Opaque internal handle. Use NULL outside xorrisoburn.c :
If not NULL then this is an iterator suitable for
iso_dir_iter_remove() which is then to be used instead
of iso_node_remove().
@param flag bit0= remove whole sub tree: rm -r
bit1= remove empty directory: rmdir
bit2= recursion: do not reassure in mode 2 "tree"
bit3= this is for overwriting and not for plain removal
@return <=0 = error
1 = removed simple node
2 = removed directory or tree
3 = did not remove on user revocation
*/
int Xorriso_rmi(struct XorrisO *xorriso, void *boss_iter,
char *path, int flag);
/* @param flag bit0= long format
bit1= do not print count of nodes
bit2= du format
bit3= print directories as themselves (ls -d)
*/
int Xorriso_ls_filev(struct XorrisO *xorriso, char *wd,
int filec, char **filev, off_t boss_mem, int flag);
/* This function needs less buffer memory than Xorriso_ls_filev() but cannot
perform structured pattern matching.
@param flag bit0= long format
bit1= only check for directory existence
bit2= do not apply search pattern but accept any file
*/
int Xorriso_ls(struct XorrisO *xorriso, int flag);
/* @param wd Path to prepend in case img_path is not absolute
@param img_path Absolute or relative path to be normalized
@param eff_path returns resulting effective path.
Must provide at least SfileadrL bytes of storage.
@param flag bit0= do not produce problem events (unless faulty path format)
bit1= work purely literally, do not use libisofs
bit2= (with bit1) this is an address in the disk world
@return -1 = faulty path format, 0 = not found ,
1 = found simple node , 2 = found directory
*/
int Xorriso_normalize_img_path(struct XorrisO *xorriso, char *wd,
char *img_path, char eff_path[], int flag);
int Xorriso_rename(struct XorrisO *xorriso, char *origin, char *dest,int flag);
/* @param flag bit0= do not produce info message on success
@return 1=success, 0=was already directory, -1=was other type, -2=bad path
*/
int Xorriso_mkdir(struct XorrisO *xorriso, char *img_path, int flag);
/* @param flag bit0= a match count !=1 is a SORRY event */
int Xorriso_expand_pattern(struct XorrisO *xorriso,
int num_patterns, char **patterns, int extra_filec,
int *filec, char ***filev, off_t *mem, int flag);
int Xorriso_set_st_mode(struct XorrisO *xorriso, char *path,
mode_t mode_and, mode_t mode_or, int flag);
int Xorriso_set_uid(struct XorrisO *xorriso, char *in_path, uid_t uid,
int flag);
int Xorriso_set_gid(struct XorrisO *xorriso, char *in_path, gid_t gid,
int flag);
/* @parm flag bit0= atime, bit1= ctime, bit2= mtime, bit8=no auto ctime */
int Xorriso_set_time(struct XorrisO *xorriso, char *in_path, time_t t,
int flag);
int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
void *dir_node_generic, char *dir_path,
struct stat *dir_stbuf, int depth, int flag);
int Xorriso_set_volid(struct XorrisO *xorriso, char *volid, int flag);
#endif /* Xorrisoburn_includeD */

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.01.09.175418" #define Xorriso_timestamP "2008.01.10.114451"