ソースを参照

libdpkg: Move C language definition macros to macros.h

Guillem Jover 17 年 前
コミット
105ba53cc1
共有18 個のファイルを変更した37 個の追加35 個の削除を含む
  1. 1 1
      dpkg-deb/main.c
  2. 1 1
      dpkg-split/main.c
  3. 1 1
      lib/dpkg/Makefile.am
  4. 1 1
      lib/dpkg/dpkg-db.h
  5. 1 1
      lib/dpkg/dpkg-i18n.h
  6. 1 15
      lib/dpkg/dpkg-priv.h
  7. 1 1
      lib/dpkg/dpkg.h
  8. 1 1
      lib/dpkg/ehandle.c
  9. 19 4
      lib/dpkg/dpkg-def.h
  10. 1 1
      lib/dpkg/myopt.h
  11. 1 1
      lib/dpkg/parse.c
  12. 1 1
      lib/dpkg/progress.h
  13. 2 1
      lib/dpkg/tarfn.c
  14. 1 1
      lib/dpkg/test/t-macros.c
  15. 1 1
      src/configure.c
  16. 1 1
      src/main.c
  17. 1 1
      src/pkg-show.c
  18. 1 1
      utils/start-stop-daemon.c

+ 1 - 1
dpkg-deb/main.c

@@ -41,9 +41,9 @@
 #include <locale.h>
 #endif
 
+#include <dpkg/macros.h>
 #include <dpkg.h>
 #include <dpkg-db.h>
-#include <dpkg-priv.h>
 #include <myopt.h>
 
 #include "dpkg-deb.h"

+ 1 - 1
dpkg-split/main.c

@@ -35,9 +35,9 @@
 #include <locale.h>
 #endif
 
+#include <dpkg/macros.h>
 #include <dpkg.h>
 #include <dpkg-db.h>
-#include <dpkg-priv.h>
 #include <myopt.h>
 
 #include "dpkg-split.h"

+ 1 - 1
lib/dpkg/Makefile.am

@@ -15,7 +15,6 @@ INCLUDES = \
 noinst_LIBRARIES = libdpkg.a
 
 libdpkg_a_SOURCES = \
-	dpkg-def.h \
 	dpkg.h \
 	dpkg-i18n.h \
 	dpkg-db.h \
@@ -31,6 +30,7 @@ libdpkg_a_SOURCES = \
 	fields.c \
 	lock.c \
 	log.c \
+	macros.h \
 	md5.c md5.h \
 	mlib.c \
 	myopt.c myopt.h \

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

@@ -23,7 +23,7 @@
 #ifndef DPKG_DB_H
 #define DPKG_DB_H
 
-#include <dpkg-def.h>
+#include <dpkg/macros.h>
 
 DPKG_BEGIN_DECLS
 

+ 1 - 1
lib/dpkg/dpkg-i18n.h

@@ -22,7 +22,7 @@
 #ifndef DPKG_I18N_H
 #define DPKG_I18N_H
 
-#include <dpkg-def.h>
+#include <dpkg/macros.h>
 
 DPKG_BEGIN_DECLS
 

+ 1 - 15
lib/dpkg/dpkg-priv.h

@@ -22,7 +22,7 @@
 #ifndef DPKG_PRIV_H
 #define DPKG_PRIV_H
 
-#include <dpkg-def.h>
+#include <dpkg/macros.h>
 
 DPKG_BEGIN_DECLS
 
@@ -30,20 +30,6 @@ DPKG_BEGIN_DECLS
 #include <stddef.h>
 #endif
 
-/* Language definitions. */
-
-#ifndef sizeof_array
-#define sizeof_array(a) (sizeof(a) / sizeof((a)[0]))
-#endif
-
-#ifndef min
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
-#ifndef max
-#define max(a, b) ((a) > (b) ? (a) : (b))
-#endif
-
 /* String handling. */
 
 char *str_escape_fmt(char *dest, const char *src);

+ 1 - 1
lib/dpkg/dpkg.h

@@ -23,7 +23,7 @@
 #ifndef DPKG_H
 #define DPKG_H
 
-#include <dpkg-def.h>
+#include <dpkg/macros.h>
 
 DPKG_BEGIN_DECLS
 

+ 1 - 1
lib/dpkg/ehandle.c

@@ -31,9 +31,9 @@
 #include <stdarg.h>
 #include <assert.h>
 
+#include <dpkg/macros.h>
 #include <dpkg.h>
 #include <dpkg-db.h>
-#include <dpkg-priv.h>
 
 static const char *errmsg; /* points to errmsgbuf or malloc'd */
 static char errmsgbuf[4096];

+ 19 - 4
lib/dpkg/dpkg-def.h

@@ -1,8 +1,8 @@
 /*
  * libdpkg - Debian packaging suite library routines
- * dpkg-def.h - C language support definitions
+ * macros.h - C language support macros
  *
- * Copyright © 1994,1995 Ian Jackson <ian@chiark.greenend.org.uk>
+ * Copyright © 2008, 2009 Guillem Jover <guillem@debian.org>
  *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as
@@ -19,8 +19,10 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#ifndef DPKG_DEF_H
-#define DPKG_DEF_H
+#ifndef DPKG_MACROS_H
+#define DPKG_MACROS_H
+
+/* Language definitions. */
 
 #if HAVE_C_ATTRIBUTE
 #define DPKG_ATTR_UNUSED	__attribute__((unused))
@@ -42,4 +44,17 @@
 #define DPKG_END_DECLS
 #endif
 
+#ifndef sizeof_array
+#define sizeof_array(a) (sizeof(a) / sizeof((a)[0]))
+#endif
+
+#ifndef min
+#define min(a, b) ((a) < (b) ? (a) : (b))
 #endif
+
+#ifndef max
+#define max(a, b) ((a) > (b) ? (a) : (b))
+#endif
+
+#endif /* DPKG_MACROS_H */
+

+ 1 - 1
lib/dpkg/myopt.h

@@ -22,7 +22,7 @@
 #ifndef MYOPT_H
 #define MYOPT_H
 
-#include <dpkg-def.h>
+#include <dpkg/macros.h>
 
 DPKG_BEGIN_DECLS
 

+ 1 - 1
lib/dpkg/parse.c

@@ -36,9 +36,9 @@
 #include <fcntl.h>
 #include <assert.h>
 
+#include <dpkg/macros.h>
 #include <dpkg.h>
 #include <dpkg-db.h>
-#include <dpkg-priv.h>
 #include "parsedump.h"
 
 #ifdef HAVE_MMAP

+ 1 - 1
lib/dpkg/progress.h

@@ -22,7 +22,7 @@
 #ifndef DPKG_PROGRESS_H
 #define DPKG_PROGRESS_H
 
-#include <dpkg-def.h>
+#include <dpkg/macros.h>
 
 DPKG_BEGIN_DECLS
 

+ 2 - 1
lib/dpkg/tarfn.c

@@ -15,8 +15,9 @@
 #include <grp.h>
 #include <errno.h>
 #include <tarfn.h>
+
+#include <dpkg/macros.h>
 #include <dpkg.h>
-#include <dpkg-priv.h>
 
 #define TAR_MAGIC_USTAR "ustar\0" "00"
 #define TAR_MAGIC_GNU   "ustar "  " \0"

+ 1 - 1
lib/dpkg/test/t-macros.c

@@ -20,7 +20,7 @@
  */
 
 #include <dpkg-test.h>
-#include <dpkg-priv.h>
+#include <dpkg/macros.h>
 
 static void
 test(void)

+ 1 - 1
src/configure.c

@@ -42,9 +42,9 @@
 #include <time.h>
 #include <sys/termios.h>
 
+#include <dpkg/macros.h>
 #include <dpkg.h>
 #include <dpkg-db.h>
-#include <dpkg-priv.h>
 
 #include "filesdb.h"
 #include "main.h"

+ 1 - 1
src/main.c

@@ -41,9 +41,9 @@
 #include <locale.h>
 #endif
 
+#include <dpkg/macros.h>
 #include <dpkg.h>
 #include <dpkg-db.h>
-#include <dpkg-priv.h>
 #include <myopt.h>
 
 #include "main.h"

+ 1 - 1
src/pkg-show.c

@@ -26,9 +26,9 @@
 
 #include <string.h>
 
+#include <dpkg/macros.h>
 #include <dpkg.h>
 #include <dpkg-db.h>
-#include <dpkg-priv.h>
 
 void
 limiteddescription(struct pkginfo *pkg,

+ 1 - 1
utils/start-stop-daemon.c

@@ -22,7 +22,7 @@
 
 #include <config.h>
 
-#include <dpkg-def.h>
+#include <dpkg/macros.h>
 
 #if defined(linux) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
 #  define OSLinux