Просмотр исходного кода

libdpkg: Move version module declarations to a new version.h

Guillem Jover лет назад: 15
Родитель
Сommit
d14c72ffee
4 измененных файлов с 42 добавлено и 9 удалено
  1. 2 1
      lib/dpkg/Makefile.am
  2. 1 7
      lib/dpkg/dpkg-db.h
  3. 1 1
      lib/dpkg/version.c
  4. 38 0
      lib/dpkg/version.h

+ 2 - 1
lib/dpkg/Makefile.am

@@ -98,4 +98,5 @@ pkginclude_HEADERS = \
 	tarfn.h \
 	trigdeferred.h \
 	triglib.h \
-	varbuf.h
+	varbuf.h \
+	version.h

+ 1 - 7
lib/dpkg/dpkg-db.h

@@ -29,15 +29,10 @@
 
 #include <dpkg/macros.h>
 #include <dpkg/varbuf.h>
+#include <dpkg/version.h>
 
 DPKG_BEGIN_DECLS
 
-struct versionrevision {
-  unsigned long epoch;
-  const char *version;
-  const char *revision;
-};
-
 enum deptype {
   dep_suggests,
   dep_recommends,
@@ -244,7 +239,6 @@ void modstatdb_shutdown(void);
 
 void pkg_blank(struct pkginfo *pp);
 void pkgbin_blank(struct pkgbin *pifp);
-void blankversion(struct versionrevision*);
 bool pkg_is_informative(struct pkginfo *pkg, struct pkgbin *info);
 
 struct pkginfo *pkg_db_find(const char *name);

+ 1 - 1
lib/dpkg/version.c

@@ -21,7 +21,7 @@
 #include <config.h>
 #include <compat.h>
 
-#include <dpkg/dpkg-db.h>
+#include <dpkg/version.h>
 
 void
 blankversion(struct versionrevision *version)

+ 38 - 0
lib/dpkg/version.h

@@ -0,0 +1,38 @@
+/*
+ * libdpkg - Debian packaging suite library routines
+ * version.h - version handling routines
+ *
+ * Copyright © 1994,1995 Ian Jackson <ian@chiark.greenend.org.uk>
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LIBDPKG_VERSION_H
+#define LIBDPKG_VERSION_H
+
+#include <dpkg/macros.h>
+
+DPKG_BEGIN_DECLS
+
+struct versionrevision {
+	unsigned long epoch;
+	const char *version;
+	const char *revision;
+};
+
+void blankversion(struct versionrevision *version);
+
+DPKG_END_DECLS
+
+#endif /* LIBDPKG_VERSION_H */