Explorar o código

libdpkg: Move informativeversion() to the version module

Guillem Jover %!s(int64=15) %!d(string=hai) anos
pai
achega
222996f8c6
Modificáronse 4 ficheiros con 11 adicións e 10 borrados
  1. 0 2
      lib/dpkg/dpkg-db.h
  2. 0 8
      lib/dpkg/parsehelp.c
  3. 8 0
      lib/dpkg/version.c
  4. 3 0
      lib/dpkg/version.h

+ 0 - 2
lib/dpkg/dpkg-db.h

@@ -287,8 +287,6 @@ extern const struct namevalue statusinfos[];
 extern const struct namevalue eflaginfos[];
 extern const struct namevalue wantinfos[];
 
-bool informativeversion(const struct versionrevision *version);
-
 enum versiondisplayepochwhen { vdew_never, vdew_nonambig, vdew_always };
 void varbufversion(struct varbuf*, const struct versionrevision*,
                    enum versiondisplayepochwhen);

+ 0 - 8
lib/dpkg/parsehelp.c

@@ -140,14 +140,6 @@ pkg_name_is_illegal(const char *p, const char **ep)
   return buf;
 }
 
-bool
-informativeversion(const struct versionrevision *version)
-{
-  return (version->epoch ||
-          (version->version && *version->version) ||
-          (version->revision && *version->revision));
-}
-
 void varbufversion
 (struct varbuf *vb,
  const struct versionrevision *version,

+ 8 - 0
lib/dpkg/version.c

@@ -30,3 +30,11 @@ blankversion(struct versionrevision *version)
 	version->version = NULL;
 	version->revision = NULL;
 }
+
+bool
+informativeversion(const struct versionrevision *version)
+{
+	return (version->epoch ||
+	        (version->version && *version->version) ||
+	        (version->revision && *version->revision));
+}

+ 3 - 0
lib/dpkg/version.h

@@ -21,6 +21,8 @@
 #ifndef LIBDPKG_VERSION_H
 #define LIBDPKG_VERSION_H
 
+#include <stdbool.h>
+
 #include <dpkg/macros.h>
 
 DPKG_BEGIN_DECLS
@@ -32,6 +34,7 @@ struct versionrevision {
 };
 
 void blankversion(struct versionrevision *version);
+bool informativeversion(const struct versionrevision *version);
 
 DPKG_END_DECLS