All of lore.kernel.org
 help / color / mirror / Atom feed
From: agk@sourceware.org
To: dm-cvs@sourceware.org, dm-devel@redhat.com
Subject: device-mapper ./WHATS_NEW lib/libdevmapper.h l ...
Date: 23 Jan 2007 19:18:53 -0000	[thread overview]
Message-ID: <20070123191853.18979.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/dm
Module name:	device-mapper
Changes by:	agk@sourceware.org	2007-01-23 19:18:52

Modified files:
	.              : WHATS_NEW 
	lib            : libdevmapper.h libdm-report.c 

Log message:
	Add descriptions to reporting field definitions.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.157&r2=1.158
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdevmapper.h.diff?cvsroot=dm&r1=1.66&r2=1.67
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdm-report.c.diff?cvsroot=dm&r1=1.7&r2=1.8

--- device-mapper/WHATS_NEW	2007/01/23 17:38:38	1.157
+++ device-mapper/WHATS_NEW	2007/01/23 19:18:52	1.158
@@ -1,5 +1,6 @@
 Version 1.02.16 -
 ===================================
+  Add descriptions to reporting field definitions.
   Add a dso-private variable to dmeventd dso interface.
   Add dm_event_handler_[gs]et_timeout functions.
   Streamline dm_report_field_* interface.
--- device-mapper/lib/libdevmapper.h	2007/01/22 15:03:57	1.66
+++ device-mapper/lib/libdevmapper.h	2007/01/23 19:18:52	1.67
@@ -665,6 +665,7 @@
 	int (*report_fn)(struct dm_report *rh, struct dm_pool *mem,
 			 struct dm_report_field *field, const void *data,
 			 void *private);
+	const char *desc;	/* description of the field */
 };
 
 /*
--- device-mapper/lib/libdm-report.c	2007/01/23 17:38:39	1.7
+++ device-mapper/lib/libdm-report.c	2007/01/23 19:18:52	1.8
@@ -248,6 +248,11 @@
 	uint32_t f;
 	const struct dm_report_object_type *type;
 	const char *desc, *last_desc = "";
+	size_t id_len = 0;
+
+	for (f = 0; rh->fields[f].report_fn; f++)
+		if (strlen(rh->fields[f].id) > id_len)
+			id_len = strlen(rh->fields[f].id);
 
 	for (f = 0; rh->fields[f].report_fn; f++) {
 		if ((type = _find_type(rh, rh->fields[f].type)) && type->desc)
@@ -260,7 +265,7 @@
 			log_print("%s Fields", desc);
 		}
 
-		log_print("- %s", rh->fields[f].id);
+		log_print("- %-*s: %s", (int) id_len, rh->fields[f].id, rh->fields[f].desc);
 		last_desc = desc;
 	}
 }

             reply	other threads:[~2007-01-23 19:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-23 19:18 agk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-01-29 17:23 device-mapper ./WHATS_NEW lib/libdevmapper.h l agk
2008-09-02 12:16 agk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070123191853.18979.qmail@sourceware.org \
    --to=agk@sourceware.org \
    --cc=dm-cvs@sourceware.org \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.