Some more filter rules for Xorriso_sieve_big

This commit is contained in:
Thomas Schmitt 2012-12-07 19:37:45 +00:00
parent 641de03c01
commit db6e65dde8
3 changed files with 60 additions and 21 deletions

View File

@ -1625,7 +1625,7 @@ int Xorriso_sieve_get_result(struct XorrisO *xorriso, char *name,
continue;
*available= f->num_results - f->num_delivered;
if(*available <= 0)
break;
return(0);
if(flag & 2)
return(1);
@ -1672,7 +1672,7 @@ int Xorriso_sieve_get_result(struct XorrisO *xorriso, char *name,
(*available)--;
return(1);
}
return(0);
return(-2);
no_mem:
if(*argv != NULL)
Xorriso__dispose_words(argc, argv);
@ -1790,27 +1790,33 @@ int Xorriso_sieve_big(struct XorrisO *xorriso, int flag)
{ 0, -1, -1, -1, -1, -1}, 1, 1},
{"libisoburn in use :", 3, "libisoburn in use :", ", ", 2,
{ 0, 1, -1, -1, -1, -1}, 1, 1},
{"File damaged :", 3, "File damaged :", "", 4, { 0, 2, 4, 6, -1, -1},
10000, 0},
{"File data lba:", 3, "File data lba:", "", 5, { 0, 2, 4, 6, 8, -1},
10000, 0},
{"MD5 MISMATCH:", 3, "MD5 MISMATCH:", "", 1, { 0, -1, -1, -1, -1, -1},
10000, 0},
{"Size lower :", 3, "Size lower :", "", 1, { 0, -1, -1, -1, -1, -1},
1, 0},
{"Size upper :", 3, "Size upper :", "", 1, { 0, -1, -1, -1, -1, -1},
1, 0},
{"@", 0, "@", "", 0, {-1, -1, -1, -1, -1, -1}, 0, 0}
};
/* Problem cases:
<<<
/* >>> Problem cases:
-devices -device_links
have no well recognizable prefix
-pwd -pwdx
have a headline and a value line
-> outlist stack
-ls* , -getfacl* , -getfattr* , -du* , -compare* , -show_stream*
have no well recognizable prefix
Todo:
-find -exec
report_damage report_lba getfacl getfattr get_any_xattr list_extattr
get_md5 check_md5 get_hfs_crtp get_hfs_bless show_stream estimate_size
-> outlist stack
*/
struct Xorriso_sieve_big_filteR *f;
int ret, i, num_filters= 1000;

View File

@ -583,15 +583,16 @@ int Xorriso_process_errfile(struct XorrisO *xorriso,
int flag);
/* -------------------- Message output evaluation API -------------------- */
/*
Message output evaluation
/* xorriso is basically a dialog software which reacts on commands by
xorriso is basically a dialog software which reacts on commands by
side effects and by messages. The side effects manipulate the state of
the ISO image model and of drives. This state can be inquired by commands
which emit messages.
There are several API approaches how a program can receive and use the
message output of xorriso.
There are several approaches how a program that uses xorriso via this API
can receive and use the message output of xorriso.
- The message sieve may be programmed to pick certain information snippets
out of the visible message stream. This covers all messages on the
@ -611,17 +612,27 @@ int Xorriso_process_errfile(struct XorrisO *xorriso,
All interpretation of the messages has to be done by the user of the
xorriso API. Function Xorriso_parse_line() is intended to help with
splitting up messages into words.
The outlist stack is handy for catching the result channel of information
commands with large uniform output like -lsl, -getfacl, -status.
The outlist stack is handy for catching the results of information
commands with large uniform output or no well recognizable message
prefix. Like -lsl, -getfacl, -status, -find ... -exec get_md5.
One should push the stack before the command, pull it afterwards, examine
the text list by Xorriso_lst_get_*(), and finally dispose the list.
- The message watcher is a separate program thread which uses the outlist
stack to catch the messages and to call user provided handler functions.
These functions can use Xorriso_parse_line() too, if they submit the
xorriso parameter as NULL.
xorriso parameter as NULL. They may not use the struct XorrisO object
in any way.
Synchronization between watcher and emitters of commands can be achived
by Xorriso_peek_outlists().
The main motivation for the message watcher is to inspect and display
messages of long lasting xorriso commands like -commit, -blank, -format.
messages of long lasting xorriso commands while they are still executing.
E.g. of -commit, -blank, -format.
One would normally start it before such a command and stop it afterwards.
But of course, the watcher can stay activated all the time and process
all message output via its handler calls.i
The sieve does not interfere with outlists and message watcher.
The message sieve does not interfere with outlists and message watcher.
The message watcher will only see messages which are not caught by outlists
which were enabled after the watcher thread was started.
@ -691,6 +702,10 @@ int Xorriso_sieve_add_filter(struct XorrisO *xorriso, char *name,
Do not allocate memory.
bit2= If *argv is not NULL, then free it before attaching
new memory.
@return <0 error: -1 = memor shortage
-2 = no filter rule found
0 no more data available for the given name
>0 argc and argv are valid
*/
int Xorriso_sieve_get_result(struct XorrisO *xorriso, char *name,
int *argc, char ***argv, int *available,
@ -763,6 +778,18 @@ int Xorriso_sieve_dispose(struct XorrisO *xorriso, int flag);
"Ext. filters :" up to 1 result from -list_extras
argv[0]= "yes" or "no" , possibly more info
(Note: prefix is "Ext. filters : ")
"File damaged :" up to 10000 results from -find ... -exec report_damage
argv[0]= damage start byte in file
argv[1]= damage range size in file
argv[2]= file size
argv[3]= path in ISO image
"File data lba:" up to 10000 results from -find ... -exec report_lba
argv[0]= extent number (all extents of same path together
are the content of one file)
argv[1]= start block number of extent
argv[2]= number of blocks of extent
argv[3]= overall file content size in all extents
argv[4]= path in ISO image
"Format idx :" up to 100 results from -list_formats
argv[0]= index
argv[1]= MMC code
@ -785,6 +812,8 @@ int Xorriso_sieve_dispose(struct XorrisO *xorriso, int flag);
argv[0]= "yes" or "no"
"Local xattr :" up to 1 result from -list_extras
argv[0]= "yes" or "no"
"MD5 MISMATCH:" up to 10000 results from -check_md5*
argv[0]= path of mismatching file
"MD5 tag range:" up to 10000 results from -check_media
argv[0]= lba
argv[1]= size in blocks
@ -826,6 +855,10 @@ int Xorriso_sieve_dispose(struct XorrisO *xorriso, int flag);
(Note: prefix is "Publisher Id : ")
"Readline :" up to 1 result from -list_extras
argv[0]= "yes" or "no"
"Size lower :" up to 1 result from -findx ... -exec estimate_size
argv[0]= size with appended "s"
"Size upper :" up to 1 result from -findx ... -exec estimate_size
argv[0]= size with appended "s"
"System Id :" up to 1 result from -pvd_info
argv[0]= id
(Note: prefix is "System Id : ")

View File

@ -1 +1 @@
#define Xorriso_timestamP "2012.12.06.132118"
#define Xorriso_timestamP "2012.12.07.193658"