The following commit has been merged in the master branch:
commit 6ada98fe522ddfb197292e8d5fe8249eab320594
Author: Guillem Jover <[email protected]>
Date:   Sat Feb 20 04:29:15 2010 +0100

    libdpkg: Move package formatting support to a new pkg-format module
    
    Move declarations from dpkg-db.h to a new pkg-format.h, and rename
    showpkg.c to pkg-format.c.

diff --git a/dpkg-deb/info.c b/dpkg-deb/info.c
index 6aaa55f..c0480aa 100644
--- a/dpkg-deb/info.c
+++ b/dpkg-deb/info.c
@@ -39,6 +39,7 @@
 #include <dpkg/i18n.h>
 #include <dpkg/dpkg.h>
 #include <dpkg/dpkg-db.h>
+#include <dpkg/pkg-format.h>
 #include <dpkg/buffer.h>
 #include <dpkg/subproc.h>
 #include <dpkg/myopt.h>
diff --git a/lib/dpkg/Makefile.am b/lib/dpkg/Makefile.am
index 48991a8..2c2009f 100644
--- a/lib/dpkg/Makefile.am
+++ b/lib/dpkg/Makefile.am
@@ -45,9 +45,9 @@ libdpkg_a_SOURCES = \
        path.c path.h \
        pkg.c pkg.h \
        pkg-array.c pkg-array.h \
+       pkg-format.c pkg-format.h \
        pkg-list.c pkg-list.h \
        progress.c progress.h \
-       showpkg.c \
        string.c string.h \
        subproc.c subproc.h \
        tarfn.c tarfn.h \
diff --git a/lib/dpkg/dpkg-db.h b/lib/dpkg/dpkg-db.h
index ebb979e..4591186 100644
--- a/lib/dpkg/dpkg-db.h
+++ b/lib/dpkg/dpkg-db.h
@@ -401,15 +401,6 @@ char *nfstrsave(const char*);
 char *nfstrnsave(const char*, size_t);
 void nffreeall(void);
 
-/*** from showpkg.c ***/
-
-struct lstitem;
-
-struct lstitem* parseformat(const char* fmt);
-void freeformat(struct lstitem* head);
-void show1package(const struct lstitem* head,
-                  struct pkginfo *pkg, struct pkginfoperfile *pif);
-
 DPKG_END_DECLS
 
 #endif /* LIBDPKG_DPKG_DB_H */
diff --git a/lib/dpkg/showpkg.c b/lib/dpkg/pkg-format.c
similarity index 98%
rename from lib/dpkg/showpkg.c
rename to lib/dpkg/pkg-format.c
index bc5c17c..49dc5cd 100644
--- a/lib/dpkg/showpkg.c
+++ b/lib/dpkg/pkg-format.c
@@ -1,6 +1,6 @@
 /*
  * libdpkg - Debian packaging suite library routines
- * showpkg.c - customizable package listing
+ * pkg-format.c - customizable package formatting
  *
  * Copyright © 2001 Wichert Akkerman <[email protected]>
  *
@@ -29,6 +29,7 @@
 #include <dpkg/dpkg.h>
 #include <dpkg/dpkg-db.h>
 #include <dpkg/parsedump.h>
+#include <dpkg/pkg-format.h>
 
 typedef enum {
        invalid,
diff --git a/lib/dpkg/path.h b/lib/dpkg/pkg-format.h
similarity index 63%
copy from lib/dpkg/path.h
copy to lib/dpkg/pkg-format.h
index b8e0523..d71cbd0 100644
--- a/lib/dpkg/path.h
+++ b/lib/dpkg/pkg-format.h
@@ -1,8 +1,8 @@
 /*
  * libdpkg - Debian packaging suite library routines
- * path.h - path handling routines
+ * pkg-format.c - customizable package formatting
  *
- * Copyright © 2008 Guillem Jover <[email protected]>
+ * Copyright © 2001 Wichert Akkerman <[email protected]>
  *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,22 +18,21 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBDPKG_PATH_H
-#define LIBDPKG_PATH_H
-
-#ifdef HAVE_STDDEF_H
-#include <stddef.h>
-#endif
+#ifndef LIBDPKG_PKG_FORMAT_H
+#define LIBDPKG_PKG_FORMAT_H
 
 #include <dpkg/macros.h>
+#include <dpkg/dpkg-db.h>
 
 DPKG_BEGIN_DECLS
 
-size_t path_rtrim_slash_slashdot(char *path);
-const char *path_skip_slash_dotslash(const char *path);
-char *path_quote_filename(char *dst, const char *src, size_t size);
+struct lstitem;
 
-DPKG_END_DECLS
+struct lstitem *parseformat(const char *fmt);
+void freeformat(struct lstitem *head);
+void show1package(const struct lstitem *head,
+                  struct pkginfo *pkg, struct pkginfoperfile *pif);
 
-#endif /* LIBDPKG_PATH_H */
+DPKG_END_DECLS
 
+#endif /* LIBDPKG_PKG_FORMAT_H */
diff --git a/po/POTFILES.in b/po/POTFILES.in
index fc706c0..c322be5 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -23,9 +23,9 @@ lib/dpkg/parsehelp.c
 lib/dpkg/path.c
 lib/dpkg/pkg.c
 lib/dpkg/pkg-array.c
+lib/dpkg/pkg-format.c
 lib/dpkg/pkg-list.c
 lib/dpkg/progress.c
-lib/dpkg/showpkg.c
 lib/dpkg/string.c
 lib/dpkg/subproc.c
 lib/dpkg/tarfn.c
diff --git a/src/query.c b/src/query.c
index 64cd189..50ac642 100644
--- a/src/query.c
+++ b/src/query.c
@@ -43,6 +43,7 @@
 #include <dpkg/dpkg.h>
 #include <dpkg/dpkg-db.h>
 #include <dpkg/pkg-array.h>
+#include <dpkg/pkg-format.h>
 #include <dpkg/path.h>
 #include <dpkg/myopt.h>
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to