diff options
author | Frediano Ziglio <freddy77@gmail.com> | 2021-06-04 12:24:54 +0100 |
---|---|---|
committer | Frediano Ziglio <freddy77@gmail.com> | 2021-06-07 13:20:21 +0100 |
commit | 8edc63e91edddd79f76ae18e1ff903fe2325e71a (patch) | |
tree | 06700d32bef6c84db1df7d2d6e525ffcb7828528 /usbredirparser/usbredirfilter.h | |
parent | d8fd31872184a045bce02f694d7f44ad38d4a8af (diff) |
Use strtok style separator for usbredirfilter_string_to_rules
Follow strtok way to handle tokens using all set of separators
and collapsing them.
The function was already using strtok but had a bug preventing
to use it correctly.
Update documentation to explain the change.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Diffstat (limited to 'usbredirparser/usbredirfilter.h')
-rw-r--r-- | usbredirparser/usbredirfilter.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usbredirparser/usbredirfilter.h b/usbredirparser/usbredirfilter.h index 85dfcca..62d4386 100644 --- a/usbredirparser/usbredirfilter.h +++ b/usbredirparser/usbredirfilter.h @@ -40,16 +40,16 @@ struct usbredirfilter_rule { Where each rule has the form of: <class>,<vendor>,<product>,<version>,<allow> - Assuming "," as the specified token_sep character. + Assuming "," as the specified token_sep character set. - And the rules are themselves are separated by the rule_sep character, ie: + And the rules are themselves are separated by any rule_sep characters, ie: <rule1>|<rule2>|<rule3> - Assuming "|" as the rule_sep character. Note that with the separator used - in this example the format matches the format as written by the RHEV-M USB - filter editor tool. + Assuming "|" as the rule_sep character set. Note that with the separator + used in this example the format matches the format as written by the RHEV-M + USB filter editor tool. - Note that the separators must be single character strings! + The separators are used as strtok use separators. On success the rules get returned in rules_ret and rules_count_ret, the returned rules array should be freed with free() when the caller is done |