
Dear Prafulla Wadaskar,
In message 73173D32E9439E4ABB5151606C3E19E202DDF272E2@SC-VEXCH1.marvell.com you wrote:
lineno++;
if (!(line[0] != '#' && strlen(line) != 1))
continue;
This is a bit simple-minded. This will for example fail on DOS-formatted files, and for lines that contain only white space (which still look "empty" to most users and are thus hard to spot).
To take care of Dos formatted file I should use "strlen(line) <= 1" right
Hm...
Normally the use of lex (and eventually yacc) is recommended if you need a parser - writing parsers in C is a typical "programming" task (see definition in signature below :-)
If you have an extremely simple syntax, you might for example proceed like this:
1) drop all lines starting with '#' as comment lines. 2) use strtok_r() to split your lines of input into white-space separated tokens. 3) drop all lines with zero tokens (= empty lines) 4) process the rest
[See example in the strtok()/strtok_r() man page).
As explained in doc.README.kwimage, any other line apart from above will be considered as valid configuration l> ine. This is bare minimal parsing provided here which is sufficient
...
Hmm... it seems you add only image creation code. But "mkimage -l" should work on such an image, too. And "imls" in U-Boot should be working, too.
Well I will disable other generic mkimage options including -l for kwbimage ;-)
This makes little sense to me. When we have one command to build an image, I definitely want to have a command to check and display the contents of an image, too, and/or to verify it's integrity.
Can we add this in second part which is not required too? For me great thing is that we can support kwimage generation through mkimage.
I understand your position. I guess you agree that _full_ support (i.e. including the ability to check and list and image, both on the host and on the target) would be even better, and more in line with existing U-Boot code?
Best regards,
Wolfgang Denk