Prechádzať zdrojové kódy

libdpkg: Add new info() reporting function

Guillem Jover 10 rokov pred
rodič
commit
79990a172a
3 zmenil súbory, kde vykonal 16 pridanie a 0 odobranie
  1. 1 0
      lib/dpkg/libdpkg.map
  2. 13 0
      lib/dpkg/report.c
  3. 2 0
      lib/dpkg/report.h

+ 1 - 0
lib/dpkg/libdpkg.map

@@ -48,6 +48,7 @@ LIBDPKG_PRIVATE {
 	warningv;
 	warning;
 	notice;
+	info;
 
 	debug_set_output;
 	debug_set_mask;

+ 13 - 0
lib/dpkg/report.c

@@ -88,3 +88,16 @@ notice(const char *fmt, ...)
 
 	fprintf(stderr, "%s: %s\n", dpkg_get_progname(), buf);
 }
+
+void
+info(const char *fmt, ...)
+{
+	char buf[1024];
+	va_list args;
+
+	va_start(args, fmt);
+	vsnprintf(buf, sizeof(buf), fmt, args);
+	va_end(args);
+
+	printf("%s: %s\n", dpkg_get_progname(), buf);
+}

+ 2 - 0
lib/dpkg/report.h

@@ -44,6 +44,8 @@ void warning(const char *fmt, ...) DPKG_ATTR_PRINTF(1);
 
 void notice(const char *fmt, ...) DPKG_ATTR_PRINTF(1);
 
+void info(const char *fmt, ...) DPKG_ATTR_PRINTF(1);
+
 /** @} */
 
 DPKG_END_DECLS