return ret_path;
}
-int btrfs_list_parse_sort_string(char *optarg,
+int btrfs_list_parse_sort_string(char *opt_arg,
struct btrfs_list_comparer_set **comps)
{
int order;
char **ptr_argv;
int what_to_sort;
- while ((p = strtok(optarg, ",")) != NULL) {
+ while ((p = strtok(opt_arg, ",")) != NULL) {
flag = 0;
ptr_argv = all_sort_items;
what_to_sort = btrfs_list_get_sort_item(p);
btrfs_list_setup_comparer(comps, what_to_sort, order);
}
- optarg = NULL;
+ opt_arg = NULL;
}
return 0;
*
* type is the filter object.
*/
-int btrfs_list_parse_filter_string(char *optarg,
+int btrfs_list_parse_filter_string(char *opt_arg,
struct btrfs_list_filter_set **filters,
enum btrfs_list_filter_enum type)
{
u64 arg;
char *ptr_parse_end = NULL;
- char *ptr_optarg_end = optarg + strlen(optarg);
+ char *ptr_opt_arg_end = opt_arg + strlen(opt_arg);
- switch (*(optarg++)) {
+ switch (*(opt_arg++)) {
case '+':
- arg = (u64)strtol(optarg, &ptr_parse_end, 10);
+ arg = (u64)strtol(opt_arg, &ptr_parse_end, 10);
type += 2;
- if (ptr_parse_end != ptr_optarg_end)
+ if (ptr_parse_end != ptr_opt_arg_end)
return -1;
btrfs_list_setup_filter(filters, type, arg);
break;
case '-':
- arg = (u64)strtoll(optarg, &ptr_parse_end, 10);
+ arg = (u64)strtoll(opt_arg, &ptr_parse_end, 10);
type += 1;
- if (ptr_parse_end != ptr_optarg_end)
+ if (ptr_parse_end != ptr_opt_arg_end)
return -1;
btrfs_list_setup_filter(filters, type, arg);
break;
default:
- optarg--;
- arg = (u64)strtoll(optarg, &ptr_parse_end, 10);
+ opt_arg--;
+ arg = (u64)strtoll(opt_arg, &ptr_parse_end, 10);
- if (ptr_parse_end != ptr_optarg_end)
+ if (ptr_parse_end != ptr_opt_arg_end)
return -1;
btrfs_list_setup_filter(filters, type, arg);
break;