浏览代码

libdpkg: Add new info() reporting function

Guillem Jover 10 年之前
父节点
当前提交
79990a172a
共有 3 个文件被更改,包括 16 次插入0 次删除
  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;
 	warningv;
 	warning;
 	warning;
 	notice;
 	notice;
+	info;
 
 
 	debug_set_output;
 	debug_set_output;
 	debug_set_mask;
 	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);
 	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 notice(const char *fmt, ...) DPKG_ATTR_PRINTF(1);
 
 
+void info(const char *fmt, ...) DPKG_ATTR_PRINTF(1);
+
 /** @} */
 /** @} */
 
 
 DPKG_END_DECLS
 DPKG_END_DECLS