Permalink
Browse files

builtin-extend: Promote 'id_or_name_matches'

Signed-off-by: Jussi Virtanen <jussi.virtanen@reaktor.fi>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
  • Loading branch information...
jvirtanen authored and penberg committed Apr 1, 2011
1 parent 183f641 commit e786581cb0317a19ef471cf1269f6cbd2ea85a69
Showing with 11 additions and 10 deletions.
  1. +0 −10 builtin-extend.c
  2. +10 −0 builtins-common.c
  3. +1 −0 include/pstore/builtins-common.h
View
@@ -28,16 +28,6 @@ static char *table_ref;
static char *column_ref;
static uint64_t extent_len;
-static bool id_or_name_matches(uint64_t id, const char *name, char *ref)
-{
- if (is_int_arg(ref)) {
- if (parse_int_arg(ref) == id)
- return true;
- }
-
- return strncmp(ref, name, strlen(ref)) == 0;
-}
-
static bool pstore_column__matches(struct pstore_column *self, char *ref)
{
if (ref)
View
@@ -71,3 +71,13 @@ bool is_int_arg(char *arg)
return false;
}
+
+bool id_or_name_matches(uint64_t id, const char *name, char *ref)
+{
+ if (is_int_arg(ref)) {
+ if (parse_int_arg(ref) == id)
+ return true;
+ }
+
+ return strncmp(ref, name, strlen(ref)) == 0;
+}
@@ -9,5 +9,6 @@ uint8_t parse_comp_arg(char *arg);
void comp_arg_usage(void);
unsigned long parse_int_arg(char *arg);
bool is_int_arg(char *arg);
+bool id_or_name_matches(uint64_t id, const char *name, char *ref);
#endif /* PSTORE_BUILTINS_COMMON_H */

0 comments on commit e786581

Please sign in to comment.