The following commit has been merged in the master branch:
commit c5ab80941dc42cdaae0f89aab5e182c3eb2154b4
Author: Guillem Jover <[email protected]>
Date:   Tue Dec 30 18:24:49 2008 +0100

    libdpkg: Move basusage from ehandle to myopt
    
    To reduce inter-dependencies due to usage of printforhelp.

diff --git a/ChangeLog b/ChangeLog
index b3d2902..63ed1e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-12-30  Guillem Jover  <[email protected]>
+
+       * lib/ehandle.c (badusage): Move function to ...
+       * lib/myopt.c: ... here. Include <stdarg.h>.
+       * lib/dpkg.h (badusage): Move declaration to ...
+       * lib/myopt.h: ... here.
+       * dpkg-split/split.c: Include <myopt.h>.
+
 2008-12-30  Colin Watson  <[email protected]>
 
        * src/help.c (preexecscript): Call chdir after chroot.
diff --git a/dpkg-split/split.c b/dpkg-split/split.c
index 98d3cc1..15a44fa 100644
--- a/dpkg-split/split.c
+++ b/dpkg-split/split.c
@@ -22,6 +22,7 @@
 #include <compat.h>
 
 #include <dpkg-i18n.h>
+#include <myopt.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/lib/dpkg.h b/lib/dpkg.h
index 05cc588..77dc666 100644
--- a/lib/dpkg.h
+++ b/lib/dpkg.h
@@ -195,7 +195,6 @@ void ohshit(const char *fmt, ...) NONRETURNING 
PRINTFFORMAT(1, 2);
 void ohshitv(const char *fmt, va_list al) NONRETURNING;
 void ohshite(const char *fmt, ...) NONRETURNING PRINTFFORMAT(1, 2);
 void ohshitvb(struct varbuf*) NONRETURNING;
-void badusage(const char *fmt, ...) NONRETURNING PRINTFFORMAT(1, 2);
 void werr(const char *what) NONRETURNING;
 void warning(const char *fmt, ...) PRINTFFORMAT(1, 2);
 
diff --git a/lib/ehandle.c b/lib/ehandle.c
index 2fd3600..5167d6e 100644
--- a/lib/ehandle.c
+++ b/lib/ehandle.c
@@ -302,16 +302,6 @@ warning(const char *fmt, ...)
   fprintf(stderr, _("%s: warning: %s\n"), thisname, buf);
 }
 
-void badusage(const char *fmt, ...) {
-  char buf[1024];
-  va_list al;
-  va_start(al,fmt);
-  vsnprintf(buf,sizeof(buf), fmt,al);
-  va_end(al);
-
-  ohshit("%s\n\n%s", buf, gettext(printforhelp));
-}
-
 void werr(const char *fn) {
   ohshite(_("error writing `%s'"),fn);
 }
diff --git a/lib/myopt.c b/lib/myopt.c
index d119ad5..717094a 100644
--- a/lib/myopt.c
+++ b/lib/myopt.c
@@ -27,11 +27,25 @@
 #include <string.h>
 #include <errno.h>
 #include <ctype.h>
+#include <stdarg.h>
 #include <stdlib.h>
 
 #include <myopt.h>
 #include <dpkg.h>
 
+void
+badusage(const char *fmt, ...)
+{
+  char buf[1024];
+  va_list al;
+
+  va_start(al, fmt);
+  vsnprintf(buf, sizeof(buf), fmt, al);
+  va_end(al);
+
+  ohshit("%s\n\n%s", buf, gettext(printforhelp));
+}
+
 void myfileopt(const char* fn, const struct cmdinfo* cmdinfos) {
   FILE* file;
   char linebuf[MAXDIVERTFILENAME];
diff --git a/lib/myopt.h b/lib/myopt.h
index 8aae74a..29f300e 100644
--- a/lib/myopt.h
+++ b/lib/myopt.h
@@ -40,6 +40,8 @@ struct cmdinfo {
   voidfnp farg;
 };
 
+void badusage(const char *fmt, ...) NONRETURNING PRINTFFORMAT(1, 2);
+
 void myfileopt(const char* fn, const struct cmdinfo* cmdinfos);
 void myopt(const char *const **argvp, const struct cmdinfo *cmdinfos);
 void loadcfgfile(const char *prog, const struct cmdinfo *cmdinfos);

-- 
dpkg's main repository


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

Reply via email to