btrfs-progs: move prefixcmp helper to utils
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
2db52a6a48
commit
1ffcc9b455
|
@ -65,9 +65,6 @@ struct cmd_group {
|
||||||
const struct cmd_struct commands[];
|
const struct cmd_struct commands[];
|
||||||
};
|
};
|
||||||
|
|
||||||
/* btrfs.c */
|
|
||||||
int prefixcmp(const char *str, const char *prefix);
|
|
||||||
|
|
||||||
int handle_command_group(const struct cmd_group *grp, int argc,
|
int handle_command_group(const struct cmd_group *grp, int argc,
|
||||||
char **argv);
|
char **argv);
|
||||||
|
|
||||||
|
|
9
help.c
9
help.c
|
@ -359,12 +359,3 @@ void help_command_group(const struct cmd_group *grp, int argc, char **argv)
|
||||||
usage_command_group(grp, full, 0);
|
usage_command_group(grp, full, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int prefixcmp(const char *str, const char *prefix)
|
|
||||||
{
|
|
||||||
for (; ; str++, prefix++)
|
|
||||||
if (!*prefix)
|
|
||||||
return 0;
|
|
||||||
else if (*str != *prefix)
|
|
||||||
return (unsigned char)*prefix - (unsigned char)*str;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
9
utils.c
9
utils.c
|
@ -2305,6 +2305,15 @@ int string_is_numerical(const char *str)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int prefixcmp(const char *str, const char *prefix)
|
||||||
|
{
|
||||||
|
for (; ; str++, prefix++)
|
||||||
|
if (!*prefix)
|
||||||
|
return 0;
|
||||||
|
else if (*str != *prefix)
|
||||||
|
return (unsigned char)*prefix - (unsigned char)*str;
|
||||||
|
}
|
||||||
|
|
||||||
/* Subvolume helper functions */
|
/* Subvolume helper functions */
|
||||||
/*
|
/*
|
||||||
* test if name is a correct subvolume name
|
* test if name is a correct subvolume name
|
||||||
|
|
1
utils.h
1
utils.h
|
@ -146,6 +146,7 @@ int btrfs_tree_search2_ioctl_supported(int fd);
|
||||||
|
|
||||||
unsigned int get_unit_mode_from_arg(int *argc, char *argv[], int df_mode);
|
unsigned int get_unit_mode_from_arg(int *argc, char *argv[], int df_mode);
|
||||||
int string_is_numerical(const char *str);
|
int string_is_numerical(const char *str);
|
||||||
|
int prefixcmp(const char *str, const char *prefix);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Global program state, configurable by command line and available to
|
* Global program state, configurable by command line and available to
|
||||||
|
|
Loading…
Reference in New Issue