From d6990c3ab1095e0637a5113fe062b9eb6e1a2238 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 23 Nov 2007 08:11:42 +0200 Subject: [PATCH] Move stringbuf into librpmio, rename header - rename header to more generic rpmstring.h for collecting misc string helper functions --- Makefile.am | 2 +- build/rpmbuild.h | 2 +- build/rpmfc.h | 2 +- build/rpmspec.h | 2 +- lib/Makefile.am | 2 +- lib/manifest.c | 2 +- preinstall.am | 8 ++++---- rpmio/Makefile.am | 4 +++- lib/stringbuf.c => rpmio/rpmstring.c | 4 ++-- lib/stringbuf.h => rpmio/rpmstring.h | 8 ++++---- 10 files changed, 19 insertions(+), 17 deletions(-) rename lib/stringbuf.c => rpmio/rpmstring.c (97%) rename lib/stringbuf.h => rpmio/rpmstring.h (85%) diff --git a/Makefile.am b/Makefile.am index 69529376f..55de0c779 100644 --- a/Makefile.am +++ b/Makefile.am @@ -46,6 +46,7 @@ pkginclude_HEADERS += rpmio/rpmlog.h pkginclude_HEADERS += rpmio/rpmmessages.h pkginclude_HEADERS += rpmio/rpmpgp.h pkginclude_HEADERS += rpmio/rpmsq.h +pkginclude_HEADERS += rpmio/rpmstring.h pkginclude_HEADERS += rpmio/rpmsw.h pkginclude_HEADERS += rpmdb/header.h @@ -62,7 +63,6 @@ pkginclude_HEADERS += lib/rpmgi.h pkginclude_HEADERS += lib/rpmps.h pkginclude_HEADERS += lib/rpmte.h pkginclude_HEADERS += lib/rpmts.h -pkginclude_HEADERS += lib/stringbuf.h pkginclude_HEADERS += build/rpmbuild.h pkginclude_HEADERS += build/rpmfc.h diff --git a/build/rpmbuild.h b/build/rpmbuild.h index e7aeaf97c..55bd5534d 100644 --- a/build/rpmbuild.h +++ b/build/rpmbuild.h @@ -9,7 +9,7 @@ #include /* and it shouldn't need these :-( */ -#include +#include /* but this will be needed */ #include diff --git a/build/rpmfc.h b/build/rpmfc.h index bb096aa8b..92ecbb43f 100644 --- a/build/rpmfc.h +++ b/build/rpmfc.h @@ -5,7 +5,7 @@ #include /* for rpmds, rpmSpec */ #include /* for ARGV_t */ -#include /* for StringBuf */ +#include /* for StringBuf */ #include /* for Package */ #ifdef __cplusplus diff --git a/build/rpmspec.h b/build/rpmspec.h index 33a49f24a..4409ea36d 100644 --- a/build/rpmspec.h +++ b/build/rpmspec.h @@ -6,7 +6,7 @@ * The rpmSpec and Package data structures used during build. */ -#include /* StringBuf */ +#include /* StringBuf */ #include /* for QVA_t */ #ifdef __cplusplus diff --git a/lib/Makefile.am b/lib/Makefile.am index b1bbca785..8baabfd7a 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -26,7 +26,7 @@ librpm_la_SOURCES = \ rpmal.c rpmchecksig.c rpmds.c rpmfi.c rpmgi.c rpmgi_internal.h \ rpminstall.c rpmtsscore.h rpmts_internal.h \ rpmlead.c rpmlead.h rpmlibprov.c rpmps.c rpmrc.c rpmte.c rpmts.c \ - rpmvercmp.c signature.c signature.h stringbuf.c transaction.c \ + rpmvercmp.c signature.c signature.h transaction.c \ verify.c rpmlock.c rpmlock.h misc.h librpm_la_LDFLAGS = -release 4.4 diff --git a/lib/manifest.c b/lib/manifest.c index 8009e1744..593fdbddd 100644 --- a/lib/manifest.c +++ b/lib/manifest.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include "manifest.h" #include "debug.h" diff --git a/preinstall.am b/preinstall.am index 1b90c7974..a3f996e9d 100644 --- a/preinstall.am +++ b/preinstall.am @@ -34,6 +34,10 @@ include/rpm/rpmsq.h: rpmio/rpmsq.h include/rpm/.dirstamp $(INSTALL_DATA) $(top_srcdir)/rpmio/rpmsq.h include/rpm/rpmsq.h BUILT_SOURCES += include/rpm/rpmsq.h CLEANFILES += include/rpm/rpmsq.h +include/rpm/rpmstring.h: rpmio/rpmstring.h include/rpm/.dirstamp + $(INSTALL_DATA) $(top_srcdir)/rpmio/rpmstring.h include/rpm/rpmstring.h +BUILT_SOURCES += include/rpm/rpmstring.h +CLEANFILES += include/rpm/rpmstring.h include/rpm/rpmsw.h: rpmio/rpmsw.h include/rpm/.dirstamp $(INSTALL_DATA) $(top_srcdir)/rpmio/rpmsw.h include/rpm/rpmsw.h BUILT_SOURCES += include/rpm/rpmsw.h @@ -86,10 +90,6 @@ include/rpm/rpmts.h: lib/rpmts.h include/rpm/.dirstamp $(INSTALL_DATA) $(top_srcdir)/lib/rpmts.h include/rpm/rpmts.h BUILT_SOURCES += include/rpm/rpmts.h CLEANFILES += include/rpm/rpmts.h -include/rpm/stringbuf.h: lib/stringbuf.h include/rpm/.dirstamp - $(INSTALL_DATA) $(top_srcdir)/lib/stringbuf.h include/rpm/stringbuf.h -BUILT_SOURCES += include/rpm/stringbuf.h -CLEANFILES += include/rpm/stringbuf.h include/rpm/rpmbuild.h: build/rpmbuild.h include/rpm/.dirstamp $(INSTALL_DATA) $(top_srcdir)/build/rpmbuild.h include/rpm/rpmbuild.h BUILT_SOURCES += include/rpm/rpmbuild.h diff --git a/rpmio/Makefile.am b/rpmio/Makefile.am index cc82302f3..0149100cd 100644 --- a/rpmio/Makefile.am +++ b/rpmio/Makefile.am @@ -14,7 +14,9 @@ librpmio_la_SOURCES = \ argv.c base64.c digest.h digest.c fts.c macro.c \ rpmhook.c rpmio.c rpmlog.c rpmlua.c rpmmalloc.c \ rpmpgp.c rpmrpc.c rpmsq.c rpmsw.c strcasecmp.c url.c ugid.c \ - rpmio_internal.h rpmlua.h rpmhook.h ugid.h fts.h + rpmio_internal.h rpmlua.h rpmhook.h ugid.h fts.h \ + rpmstring.c + librpmio_la_LDFLAGS = -release 4.4 librpmio_la_LIBADD = \ ../misc/libmisc.la \ diff --git a/lib/stringbuf.c b/rpmio/rpmstring.c similarity index 97% rename from lib/stringbuf.c rename to rpmio/rpmstring.c index a85ad34e4..a14f9ad92 100644 --- a/lib/stringbuf.c +++ b/rpmio/rpmstring.c @@ -1,10 +1,10 @@ /** - * \file lib/stringbuf.c + * \file rpmio/rpmstring.c */ #include "system.h" -#include +#include #include "debug.h" #define BUF_CHUNK 1024 diff --git a/lib/stringbuf.h b/rpmio/rpmstring.h similarity index 85% rename from lib/stringbuf.h rename to rpmio/rpmstring.h index e4336ecb8..ff0bdebbd 100644 --- a/lib/stringbuf.h +++ b/rpmio/rpmstring.h @@ -1,7 +1,7 @@ -#ifndef _STRINGBUF_H_ -#define _STRINGBUF_H_ +#ifndef _RPMSTRING_H_ +#define _RPMSTRING_H_ -/** \file lib/stringbuf.h +/** \file rpmio/rpmstring.h * */ @@ -49,4 +49,4 @@ void appendStringBufAux(StringBuf sb, const char * s, int nl); } #endif -#endif /* _STRINGBUF_H_ */ +#endif /* _RPMSTRING_H_ */