Based on comments in D10607
Update code responsible for parsing "style=" :
-Update string parsing code
-Make the old and new code more readable
It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/
This is an improvement, thank you :)
After the things in the inline comments, i am happy with this .
This is just a nitpick anyways. Can you write here that this function splits str by the comma, and fills the part before the comma into the buffer part1, and the rest into part2 ?
That makes it easier to understand.
coding convention, its "void <linebreak> _style_string_split"
coding convention, its "void <linebreak> _format_shadow_set"
coding convention, its "void <linebreak> _format_shadow_direction_set"
One more block like this just with no comma, something like "style=foo" (This way we are testing the branches in the parsing function that are related to this)
The string sent to this function might contain multiple commas, the first part is the string before the first comma and the second part is the string after the last comma (this is the current support and we Ignore the rest of the string).
Yeah i know, thats what i wrote. "Split the str by the comma, fill the part before the comma into the buffer part1, and the rest into part2" Which describes pretty much this ?
This was meant differently. Only something like
So we ensure that we test, that there might be no part2 (in the code above).
If we have for example "style=soft_outline,top,bottom" then we will take "soft_outline" as part1 , "bottom" as part2 and "top" will be ignored
Yeah I know, already added it the first test case :)
This is an internal function (not public API) so these docs are not as critical.
Split str using commas as separators. All characters from the beginning of the string up until the first comma (excluded) are copied into part1. All characters after the last comma (excluded) up until the end of str are copied into part2. Any character in between part1 and part2 is ignored. For example, if str="str1,str2,str3,str4", part1 will contain "str1" and part2 will contain "str4". part1 and part2 must be already allocated and contain enough space for any possible outcome of the parsing. The safest bet is that they should be as big as str.
The comment inside the function is then redundant and can be removed.