Just code motion, no functional change.
---
lib/guestfs-internal.h | 4 ++--
lib/inspect-fs.c | 26 --------------------------
lib/inspect.c | 27 +++++++++++++++++++++++++++
3 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h
index ab4eaf7e3..6dbaba9bd 100644
--- a/lib/guestfs-internal.h
+++ b/lib/guestfs-internal.h
@@ -856,6 +856,8 @@ extern int guestfs_int_set_backend (guestfs_h *g, const char
*method);
/* inspect.c */
extern void guestfs_int_free_inspect_info (guestfs_h *g);
extern char *guestfs_int_download_to_tmp (guestfs_h *g, struct inspect_fs *fs, const char
*filename, const char *basename, uint64_t max_size);
+extern int guestfs_int_parse_unsigned_int (guestfs_h *g, const char *str);
+extern int guestfs_int_parse_unsigned_int_ignore_trailing (guestfs_h *g, const char
*str);
extern struct inspect_fs *guestfs_int_search_for_root (guestfs_h *g, const char *root);
extern int guestfs_int_is_partition (guestfs_h *g, const char *partition);
@@ -864,8 +866,6 @@ extern int guestfs_int_is_file_nocase (guestfs_h *g, const char *);
extern int guestfs_int_is_dir_nocase (guestfs_h *g, const char *);
extern int guestfs_int_check_for_filesystem_on (guestfs_h *g,
const char *mountable);
-extern int guestfs_int_parse_unsigned_int (guestfs_h *g, const char *str);
-extern int guestfs_int_parse_unsigned_int_ignore_trailing (guestfs_h *g, const char
*str);
extern int guestfs_int_parse_major_minor (guestfs_h *g, struct inspect_fs *fs);
extern char *guestfs_int_first_line_of_file (guestfs_h *g, const char *filename);
extern int guestfs_int_first_egrep_of_file (guestfs_h *g, const char *filename, const
char *eregex, int iflag, char **ret);
diff --git a/lib/inspect-fs.c b/lib/inspect-fs.c
index e320b3e78..54f9a281a 100644
--- a/lib/inspect-fs.c
+++ b/lib/inspect-fs.c
@@ -370,32 +370,6 @@ guestfs_int_is_dir_nocase (guestfs_h *g, const char *path)
return r > 0;
}
-/* Parse small, unsigned ints, as used in version numbers. */
-int
-guestfs_int_parse_unsigned_int (guestfs_h *g, const char *str)
-{
- long ret;
- const int r = xstrtol (str, NULL, 10, &ret, "");
- if (r != LONGINT_OK) {
- error (g, _("could not parse integer in version number: %s"), str);
- return -1;
- }
- return ret;
-}
-
-/* Like parse_unsigned_int, but ignore trailing stuff. */
-int
-guestfs_int_parse_unsigned_int_ignore_trailing (guestfs_h *g, const char *str)
-{
- long ret;
- const int r = xstrtol (str, NULL, 10, &ret, NULL);
- if (r != LONGINT_OK) {
- error (g, _("could not parse integer in version number: %s"), str);
- return -1;
- }
- return ret;
-}
-
/* Parse generic MAJOR.MINOR from the fs->product_name string. */
int
guestfs_int_parse_major_minor (guestfs_h *g, struct inspect_fs *fs)
diff --git a/lib/inspect.c b/lib/inspect.c
index 1cc0942f1..37d175873 100644
--- a/lib/inspect.c
+++ b/lib/inspect.c
@@ -38,6 +38,7 @@
#endif
#include "ignore-value.h"
+#include "xstrtol.h"
#include "guestfs.h"
#include "guestfs-internal.h"
@@ -799,6 +800,32 @@ guestfs_int_download_to_tmp (guestfs_h *g, struct inspect_fs *fs,
return NULL;
}
+/* Parse small, unsigned ints, as used in version numbers. */
+int
+guestfs_int_parse_unsigned_int (guestfs_h *g, const char *str)
+{
+ long ret;
+ const int r = xstrtol (str, NULL, 10, &ret, "");
+ if (r != LONGINT_OK) {
+ error (g, _("could not parse integer in version number: %s"), str);
+ return -1;
+ }
+ return ret;
+}
+
+/* Like parse_unsigned_int, but ignore trailing stuff. */
+int
+guestfs_int_parse_unsigned_int_ignore_trailing (guestfs_h *g, const char *str)
+{
+ long ret;
+ const int r = xstrtol (str, NULL, 10, &ret, NULL);
+ if (r != LONGINT_OK) {
+ error (g, _("could not parse integer in version number: %s"), str);
+ return -1;
+ }
+ return ret;
+}
+
struct inspect_fs *
guestfs_int_search_for_root (guestfs_h *g, const char *root)
{
--
2.13.2