New command -application_use

This commit is contained in:
Thomas Schmitt 2013-08-04 10:21:14 +00:00
parent f8ba453762
commit 32caf54a70
13 changed files with 203 additions and 68 deletions

View File

@ -146,6 +146,7 @@ Xorriso_option_add_plainly;
Xorriso_option_alter_date;
Xorriso_option_append_partition;
Xorriso_option_application_id;
Xorriso_option_application_use;
Xorriso_option_as;
Xorriso_option_assert_volid;
Xorriso_option_auto_charset;

View File

@ -173,6 +173,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->copyright_file[0]= 0;
m->biblio_file[0]= 0;
m->abstract_file[0]= 0;
m->application_use[0]= 0;
m->session_logfile[0]= 0;
m->session_lba= -1;
m->session_blocks= 0;

View File

@ -347,6 +347,21 @@ int Xorriso_option_application_id(struct XorrisO *xorriso, char *name,
}
/* Command -application_use */
int Xorriso_option_application_use(struct XorrisO *xorriso, char *path,
int flag)
{
if(Sfile_str(xorriso->application_use, path, 0) <= 0) {
sprintf(xorriso->info_text,
"-application_use: parameter string is much too long (%d)",
(int) strlen(path));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
return(1);
}
/* Option -as */
/* @param flag bit0=do not report the added item
bit1=do not reset pacifier, no final pacifier message

View File

@ -1607,6 +1607,10 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" Specifies the name of the Bibliographic File. (37 chars)",
" -abstract_file name",
" Specifies the name of the Abstract File. (37 chars)",
" -application_use character|0xXY|disk_path",
" Specifies the content of Application Use field. (512 bytes)",
" A single character or a hex code gets repeated 512 times.",
" Other text gets opened as data file and 512 bytes are read.",
" -joliet \"on\"|\"off\"",
" Generate Joliet info additional to Rock Ridge info.",
" -hfsplus \"on\"|\"off\"",

View File

@ -499,8 +499,8 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
""
};
static char arg1_commands[][40]= {
"abort_on","acl","add_plainly","application_id","auto_charset",
"abstract_file",
"abort_on","acl","add_plainly","application_id","application_use",
"auto_charset","abstract_file",
"backslash_codes","blank","biblio_file",
"calm_drive","cd","cdi","cdx","changes_pending","charset",
"close","close_damaged",
@ -707,8 +707,8 @@ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso,
"rockridge", "joliet", "hfsplus","compliance", "rr_reloc_dir",
"volid", "volset_id", "publisher",
"application_id", "system_id", "volume_date", "copyright_file",
"abstract_file", "biblio_file", "preparer_id", "out_charset",
"read_mkisofsrc",
"abstract_file", "biblio_file", "preparer_id", "application_use",
"out_charset", "read_mkisofsrc",
"uid", "gid", "zisofs", "speed", "stream_recording", "dvd_obs",
"stdio_sync", "dummy", "fs", "close", "padding", "write_type",
"grow_blindly", "pacifier", "scdbackup_tag",
@ -1020,6 +1020,10 @@ next_command:;
(*idx)++;
ret= Xorriso_option_application_id(xorriso, arg1, 0);
} else if(strcmp(cmd,"application_use") == 0) {
(*idx)++;
ret= Xorriso_option_application_use(xorriso, arg1, 0);
} else if(strcmp(cmd,"as")==0) {
ret= Xorriso_option_as(xorriso, argc, argv, idx, 0);

View File

@ -2937,6 +2937,12 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (xorriso->application_use[0] == 0);
sprintf(line,"-application_use %s\n",
Text_shellsafe(xorriso->application_use, sfe, 0));
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (xorriso->do_joliet==0);
sprintf(line,"-joliet %s\n", (xorriso->do_joliet == 1 ? "on" : "off"));
if(!(is_default && no_defaults))

View File

@ -640,6 +640,52 @@ ex:;
}
int Xorriso_write_application_use(struct XorrisO *xorriso,
IsoImage *image, int flag)
{
int l, ret, count= 512;
unsigned int byte= 0;
char *path, data[512];
FILE *fp= NULL;
path= xorriso->application_use;
l= strlen(path);
if(l <= 1) {
memset(data, path[0], 512);
} else if(l == 4 && path[0] == '0' && path[1] == 'x' &&
isxdigit(path[2]) && isxdigit(path[3])) {
sscanf(path + 2, "%x", &byte);
memset(data, (int) byte, 512);
} else {
/* Read up to 512 bytes from file path */
ret= Xorriso_afile_fopen(xorriso, path, "rb", &fp, 0);
if(ret <= 0)
{ret= 0; goto ex;}
ret= fread(data, 1, 512, fp);
if(ret < 512) {
if(ferror(fp)) {
sprintf(xorriso->info_text,
"-application_use: Error while reading file ");
Text_shellsafe(path, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text,
errno, "FAILURE", 0);
ret= 0; goto ex;
}
}
if(ret < 0)
count= 0;
else
count= ret;
}
iso_image_set_app_use(image, data, count);
ret= 1;
ex:
if(fp != NULL && fp != stdin)
fclose(fp);
return(ret);
}
/* @param flag bit0= do not write but only prepare and return size in sectors
*/
int Xorriso_write_session(struct XorrisO *xorriso, int flag)
@ -758,6 +804,8 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
iso_image_set_copyright_file_id(image, xorriso->copyright_file);
iso_image_set_biblio_file_id(image, xorriso->biblio_file);
iso_image_set_abstract_file_id(image, xorriso->abstract_file);
Xorriso_write_application_use(xorriso, image, 0);
Xorriso_process_msg_queues(xorriso,0);
}
if((xorriso->do_aaip & 256) && out_cs != NULL) {

View File

@ -9,7 +9,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH XORRISO 1 "Version 1.3.1, Jul 03, 2013"
.TH XORRISO 1 "Version 1.3.1, Aug 04, 2013"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -2621,6 +2621,21 @@ The special text "@xorriso@" gets converted to the ID string of
.br
Unlike other ID strings, this setting is not influenced by image loading.
.TP
\fB\-application_use\fR character|0xXY|disk_path
Specify the content of the Application Use field which can take at most
512 bytes.
.br
If the parameter of this command is empty, then the field is filled
with 512 0\-bytes. If it is a single character, then it gets repeated 512 times.
If it begins by "0x" followed by two hex digits [0\-9a\-fA\-F], then the digits
are read as byte value which gets repeated 512 times.
.br
Any other parameter text is used as disk_path to open a data file and to
read up to 512 bytes from it. If the file is smaller than 512 bytes, then the
remaining bytes in the field get set to binary 0.
.br
This setting is not influenced by image loading.
.TP
\fB\-out_charset\fR character_set_name
Set the character set to which file names get converted when writing an
image. See paragraph "Character sets" for more explanations.

View File

@ -1253,6 +1253,11 @@ int Xorriso_option_append_partition(struct XorrisO *xorriso, char *partno_text,
int Xorriso_option_application_id(struct XorrisO *xorriso, char *name,
int flag);
/* Command -application_use */
/* @since 1.3.2 */
int Xorriso_option_application_use(struct XorrisO *xorriso, char *path,
int flag);
/* Command -as */
/* @param flag bit0=do not report the added item
bit1=do not reset pacifier, no final pacifier message

View File

@ -2324,6 +2324,20 @@ according to the setting of command -acl.
Unlike other ID strings, this setting is not influenced by image
loading.
-application_use character|0xXY|disk_path
Specify the content of the Application Use field which can take at
most 512 bytes.
If the parameter of this command is empty, then the field is filled
with 512 0-bytes. If it is a single character, then it gets
repeated 512 times. If it begins by "0x" followed by two hex
digits [0-9a-fA-F], then the digits are read as byte value which
gets repeated 512 times.
Any other parameter text is used as disk_path to open a data file
and to read up to 512 bytes from it. If the file is smaller than
512 bytes, then the remaining bytes in the field get set to binary
0.
This setting is not influenced by image loading.
-out_charset character_set_name
Set the character set to which file names get converted when
writing an image. See paragraph "Character sets" for more
@ -4787,6 +4801,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -append_partition adds arbitrary file after image end: Bootable.
(line 249)
* -application_id sets application id: SetWrite. (line 192)
* -application_use sets application use field: SetWrite. (line 258)
* -as emulates mkisofs or cdrecord: Emulation. (line 13)
* -assert_volid rejects undesired images: Loading. (line 84)
* -auto_charset learns character set from image: Loading. (line 98)
@ -4811,7 +4826,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -chown sets ownership in ISO image: Manip. (line 49)
* -chown_r sets ownership in ISO image: Manip. (line 54)
* -clone copies ISO directory tree: Insert. (line 180)
* -close controls media closing: SetWrite. (line 335)
* -close controls media closing: SetWrite. (line 349)
* -close_damaged closes damaged track and session: Writing. (line 163)
* -close_filter_list bans filter registration: Filter. (line 52)
* -commit writes pending ISO image: Writing. (line 29)
@ -4838,11 +4853,11 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
(line 36)
* -drive_class controls drive accessability: Loading. (line 54)
* -du show directory size in ISO image: Navigate. (line 89)
* -dummy controls write simulation: SetWrite. (line 324)
* -dummy controls write simulation: SetWrite. (line 338)
* -dus show directory size in ISO image: Navigate. (line 93)
* -dusx show directory size on disk: Navigate. (line 102)
* -dux show directory size on disk: Navigate. (line 97)
* -dvd_obs set write block size: SetWrite. (line 311)
* -dvd_obs set write block size: SetWrite. (line 325)
* -early_stdio_test classifies stdio drives: Loading. (line 259)
* -eject ejects drive tray: Writing. (line 52)
* -end writes pending session and ends program: Scripting. (line 167)
@ -4860,12 +4875,12 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -follow softlinks and mount points: SetInsert. (line 76)
* -for_backup -acl,-xattr,-hardlinks,-md5: Loading. (line 188)
* -format formats media: Writing. (line 91)
* -fs sets size of fifo: SetWrite. (line 328)
* -fs sets size of fifo: SetWrite. (line 342)
* -getfacl shows ACL in ISO image: Navigate. (line 70)
* -getfacl_r shows ACL in ISO image: Navigate. (line 77)
* -getfattr shows xattr in ISO image: Navigate. (line 81)
* -getfattr_r shows xattr in ISO image: Navigate. (line 85)
* -gid sets global ownership: SetWrite. (line 268)
* -gid sets global ownership: SetWrite. (line 282)
* -grow_blindly overides next writeable address: AqDrive. (line 46)
* -hardlinks controls handling of hard links: Loading. (line 110)
* -help prints help text: Scripting. (line 20)
@ -4918,11 +4933,11 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -not_paths sets absolute exclusion paths: SetInsert. (line 55)
* -options_from_file reads commands from file: Scripting. (line 12)
* -osirrox enables ISO-to-disk copying: Restore. (line 18)
* -out_charset sets output character set: SetWrite. (line 258)
* -out_charset sets output character set: SetWrite. (line 272)
* -outdev acquires a drive for output: AqDrive. (line 31)
* -overwrite enables overwriting in ISO: SetInsert. (line 127)
* -pacifier controls pacifier text form: Emulation. (line 163)
* -padding sets amount or mode of image padding: SetWrite. (line 349)
* -padding sets amount or mode of image padding: SetWrite. (line 363)
* -page set terminal geometry: DialogCtl. (line 19)
* -paste_in copies file into disk file: Restore. (line 124)
* -path_list inserts paths from disk file: Insert. (line 79)
@ -4976,18 +4991,18 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -signal_handling controls handling of system signals: Exception.
(line 69)
* -sleep waits for a given time span: Scripting. (line 125)
* -speed set write speed: SetWrite. (line 284)
* -speed set write speed: SetWrite. (line 298)
* -split_size enables large file splitting: SetInsert. (line 140)
* -status shows current settings: Scripting. (line 47)
* -status_history_max curbs -status history: Scripting. (line 56)
* -stdio_sync controls stdio buffer: SetWrite. (line 318)
* -stream_recording controls defect management: SetWrite. (line 299)
* -stdio_sync controls stdio buffer: SetWrite. (line 332)
* -stream_recording controls defect management: SetWrite. (line 313)
* -system_id sets system id: SetWrite. (line 201)
* -tell_media_space reports free space: Inquiry. (line 104)
* -temp_mem_limit curbs memory consumption: Scripting. (line 103)
* -toc shows list of sessions: Inquiry. (line 28)
* -toc_of shows list of sessions: Inquiry. (line 43)
* -uid sets global ownership: SetWrite. (line 264)
* -uid sets global ownership: SetWrite. (line 278)
* -update inserts path if different: Insert. (line 103)
* -update_l inserts paths if different: Insert. (line 125)
* -update_r inserts paths if different: Insert. (line 114)
@ -4996,11 +5011,11 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -volid sets volume id: SetWrite. (line 160)
* -volset_id sets volume set id: SetWrite. (line 181)
* -volume_date sets volume timestamp: SetWrite. (line 208)
* -write_type chooses TAO or SAO/DAO: SetWrite. (line 341)
* -write_type chooses TAO or SAO/DAO: SetWrite. (line 355)
* -x enables automatic execution order of arguments: ArgSort.
(line 16)
* -xattr controls handling of xattr (EA): Loading. (line 154)
* -zisofs controls zisofs production: SetWrite. (line 272)
* -zisofs controls zisofs production: SetWrite. (line 286)

File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
@ -5035,7 +5050,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Character Set, _definition: Charset. (line 6)
* Character Set, for input, -in_charset: Loading. (line 92)
* Character Set, for input/output, -charset: Charset. (line 43)
* Character Set, for output, -out_charset: SetWrite. (line 258)
* Character Set, for output, -out_charset: SetWrite. (line 272)
* Character set, learn from image, -auto_charset: Loading. (line 98)
* Character Set, of terminal, -local_charset: Charset. (line 47)
* CHRP partition, _definition: Bootable. (line 158)
@ -5093,11 +5108,11 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Filter, show chain, -show_stream: Navigate. (line 169)
* Filter, show chains of tree, -show_stream_r: Navigate. (line 183)
* Filter, unregister, -unregister_filter: Filter. (line 48)
* Filter, zisofs parameters, -zisofs: SetWrite. (line 272)
* Filter, zisofs parameters, -zisofs: SetWrite. (line 286)
* Frontend program, start at pipes, -launch_frontend: Frontend.
(line 146)
* GPT, _definition: Extras. (line 38)
* Group, global in ISO image, -gid: SetWrite. (line 268)
* Group, global in ISO image, -gid: SetWrite. (line 282)
* Group, in ISO image, -chgrp: Manip. (line 57)
* Group, in ISO image, -chgrp_r: Manip. (line 62)
* Growing, _definition: Methods. (line 19)
@ -5112,6 +5127,8 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Image, override change status, -changes_pending: Writing. (line 13)
* Image, set abstract file name, -abstract_file: SetWrite. (line 233)
* Image, set application id, -application_id: SetWrite. (line 192)
* Image, set application iuse field, -application_use: SetWrite.
(line 258)
* Image, set biblio file name, -biblio_file: SetWrite. (line 240)
* Image, set copyright file name, -copyright_file: SetWrite. (line 227)
* Image, set preparer id, -preparer_id: SetWrite. (line 246)
@ -5178,7 +5195,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Navigate, tell ISO working directory, -pwd: Navigate. (line 20)
* Next writeable address, -grow_blindly: AqDrive. (line 46)
* Overwriteable media, _definition: Media. (line 14)
* Ownership, global in ISO image, -uid: SetWrite. (line 264)
* Ownership, global in ISO image, -uid: SetWrite. (line 278)
* Ownership, in ISO image, -chown: Manip. (line 49)
* Ownership, in ISO image, -chown_r: Manip. (line 54)
* Partition offset, _definition: Bootable. (line 177)
@ -5264,25 +5281,25 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Verify, file checksum, -check_md5: Verify. (line 154)
* Verify, file tree checksums, -check_md5_r: Verify. (line 170)
* Verify, preset -check_media, -check_media_defaults: Verify. (line 41)
* Write, block size, -dvd_obs: SetWrite. (line 311)
* Write, block size, -dvd_obs: SetWrite. (line 325)
* Write, bootability, -boot_image: Bootable. (line 26)
* Write, buffer syncing, -stdio_sync: SetWrite. (line 318)
* Write, close media, -close: SetWrite. (line 335)
* Write, buffer syncing, -stdio_sync: SetWrite. (line 332)
* Write, close media, -close: SetWrite. (line 349)
* Write, compliance to specs, -compliance: SetWrite. (line 58)
* Write, defect management, -stream_recording: SetWrite. (line 299)
* Write, defect management, -stream_recording: SetWrite. (line 313)
* Write, disable Rock Ridge, -rockridge: SetWrite. (line 52)
* Write, enable HFS+, -hfsplus: SetWrite. (line 14)
* Write, enable Joliet, -joliet: SetWrite. (line 10)
* Write, fifo size, -fs: SetWrite. (line 328)
* Write, fifo size, -fs: SetWrite. (line 342)
* Write, free space, -tell_media_space: Inquiry. (line 104)
* Write, log problematic disk files, -errfile_log: Scripting. (line 129)
* Write, log written sessions, -session_log: Scripting. (line 149)
* Write, padding image, -padding: SetWrite. (line 349)
* Write, padding image, -padding: SetWrite. (line 363)
* Write, pending ISO image, -commit: Writing. (line 29)
* Write, predict image size, -print_size: Inquiry. (line 91)
* Write, set speed, -speed: SetWrite. (line 284)
* Write, simulation, -dummy: SetWrite. (line 324)
* Write, TAO or SAO/DAO, -write_type: SetWrite. (line 341)
* Write, set speed, -speed: SetWrite. (line 298)
* Write, simulation, -dummy: SetWrite. (line 338)
* Write, TAO or SAO/DAO, -write_type: SetWrite. (line 355)
* xattr, _definition: Extras. (line 65)
* xattr, control handling, -xattr: Loading. (line 154)
* xattr, set in ISO image, -setfattr: Manip. (line 118)
@ -5314,40 +5331,40 @@ Node: CmdFind74790
Node: Filter89786
Node: Writing94342
Node: SetWrite104039
Node: Bootable122790
Node: Jigdo139180
Node: Charset143427
Node: Exception146189
Node: DialogCtl152309
Node: Inquiry154907
Node: Navigate161224
Node: Verify169522
Node: Restore178554
Node: Emulation185641
Node: Scripting195943
Node: Frontend203714
Node: Examples213321
Node: ExDevices214499
Node: ExCreate215158
Node: ExDialog216443
Node: ExGrowing217708
Node: ExModifying218513
Node: ExBootable219017
Node: ExCharset219569
Node: ExPseudo220390
Node: ExCdrecord221288
Node: ExMkisofs221605
Node: ExGrowisofs222945
Node: ExException224080
Node: ExTime224534
Node: ExIncBackup224993
Node: ExRestore228973
Node: ExRecovery229906
Node: Files230476
Node: Seealso231775
Node: Bugreport232498
Node: Legal233079
Node: CommandIdx234090
Node: ConceptIdx250606
Node: Bootable123506
Node: Jigdo139896
Node: Charset144143
Node: Exception146905
Node: DialogCtl153025
Node: Inquiry155623
Node: Navigate161940
Node: Verify170238
Node: Restore179270
Node: Emulation186357
Node: Scripting196659
Node: Frontend204430
Node: Examples214037
Node: ExDevices215215
Node: ExCreate215874
Node: ExDialog217159
Node: ExGrowing218424
Node: ExModifying219229
Node: ExBootable219733
Node: ExCharset220285
Node: ExPseudo221106
Node: ExCdrecord222004
Node: ExMkisofs222321
Node: ExGrowisofs223661
Node: ExException224796
Node: ExTime225250
Node: ExIncBackup225709
Node: ExRestore229689
Node: ExRecovery230622
Node: Files231192
Node: Seealso232491
Node: Bugreport233214
Node: Legal233795
Node: CommandIdx234806
Node: ConceptIdx251395

End Tag Table

View File

@ -50,7 +50,7 @@
@c man .\" First parameter, NAME, should be all caps
@c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
@c man .\" other parameters are allowed: see man(7), man(1)
@c man .TH XORRISO 1 "Version 1.3.1, Jul 03, 2013"
@c man .TH XORRISO 1 "Version 1.3.1, Aug 04, 2013"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -3099,6 +3099,23 @@ The special text "@@xorriso@@" gets converted to the ID string of
@*
Unlike other ID strings, this setting is not influenced by image loading.
@c man .TP
@item -application_use character|0xXY|disk_path
@kindex -application_use sets application use field
@cindex Image, set application iuse field, -application_use
Specify the content of the Application Use field which can take at most
512 bytes.
@*
If the parameter of this command is empty, then the field is filled
with 512 0-bytes. If it is a single character, then it gets repeated 512 times.
If it begins by "0x" followed by two hex digits [0-9a-fA-F], then the digits
are read as byte value which gets repeated 512 times.
@*
Any other parameter text is used as disk_path to open a data file and to
read up to 512 bytes from it. If the file is smaller than 512 bytes, then the
remaining bytes in the field get set to binary 0.
@*
This setting is not influenced by image loading.
@c man .TP
@item -out_charset character_set_name
@kindex -out_charset sets output character set
@cindex Character Set, for output, -out_charset

View File

@ -232,6 +232,8 @@ struct XorrisO { /* the global context of xorriso */
char biblio_file[38];
char abstract_file[38];
char application_use[SfileadrL];
char session_logfile[SfileadrL];
int session_lba;
int session_blocks;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2013.08.04.101212"
#define Xorriso_timestamP "2013.08.04.102038"