public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Shakur Shams Mullick <shakursmullick@gmail.com>
To: util-linux@vger.kernel.org
Cc: Shakur Shams Mullick <shakursmullick@gmail.com>
Subject: [PATCH 3/8] libsmartcols/src/smartcolsP.h: add sort flag and related enum
Date: Sat,  3 May 2014 23:41:23 +0600	[thread overview]
Message-ID: <1399138888-7554-3-git-send-email-shakursmullick@gmail.com> (raw)
In-Reply-To: <1399138888-7554-1-git-send-email-shakursmullick@gmail.com>

Signed-off-by: Shakur Shams Mullick <shakursmullick@gmail.com>
---
 libsmartcols/src/smartcolsP.h | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/libsmartcols/src/smartcolsP.h b/libsmartcols/src/smartcolsP.h
index ebdc929..d7b9982 100644
--- a/libsmartcols/src/smartcolsP.h
+++ b/libsmartcols/src/smartcolsP.h
@@ -44,7 +44,7 @@ UL_DEBUG_DECLARE_MASK(libsmartcols);
 struct libscols_iter {
 	struct list_head        *p;		/* current position */
 	struct list_head        *head;		/* start position */
-	int			direction;	/* SCOLS_ITER_{FOR,BACK}WARD */
+	int						direction;	/* SCOLS_ITER_{FOR,BACK}WARD */
 };
 
 /*
@@ -108,11 +108,16 @@ struct libscols_line {
 };
 
 enum {
-	SCOLS_FMT_HUMAN = 0,		/* default, human readable */
+	SCOLS_FMT_HUMAN = 0,	/* default, human readable */
 	SCOLS_FMT_RAW,			/* space separated */
 	SCOLS_FMT_EXPORT		/* COLNAME="data" ... */
 };
 
+enum{
+	SCOLS_SORT_NAME = 0,	/* sort by name */
+	SCOLS_SORT_SIZE     	/* sort by size */
+};
+
 /*
  * The table
  */
@@ -133,13 +138,15 @@ struct libscols_table {
 	struct libscols_symbols	*symbols;
 
 	int	format;		/* SCOLS_FMT_* */
-
+	
+	int sort;		/* SCOLS_SORT_* */
+	
 	/* flags */
 	unsigned int	ascii		:1,	/* don't use unicode */
-			colors_wanted	:1,	/* enable colors */
-			is_term		:1,	/* isatty() */
-			maxout		:1,	/* maximalize output */
-			no_headings	:1;	/* don't print header */
+		colors_wanted	:1,	/* enable colors */
+		is_term		:1,	/* isatty() */
+		maxout		:1,	/* maximalize output */
+		no_headings	:1;	/* don't print header */
 };
 
 #define IS_ITER_FORWARD(_i)	((_i)->direction == SCOLS_ITER_FORWARD)
-- 
1.8.3.2


  parent reply	other threads:[~2014-05-03 17:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-03 17:41 [PATCH 1/8] libsmartcols/src/libsmartcols.h.in: add function name Shakur Shams Mullick
2014-05-03 17:41 ` [PATCH 2/8] libsmartcols/src/libsmartcols.sym: add function symbol Shakur Shams Mullick
2014-05-03 17:41 ` Shakur Shams Mullick [this message]
2014-05-03 17:41 ` [PATCH 4/8] libsmartcols/src/table.c: implementation of 4 newly added functions Shakur Shams Mullick
2014-05-03 17:41 ` [PATCH 5/8] libsmartcols/src/table_print.c: sort table before printing Shakur Shams Mullick
2014-05-03 17:41 ` [PATCH 6/8] misc-utils/lsblk.c: add sorting support for lsblk command Shakur Shams Mullick
2014-05-06 10:43   ` Karel Zak
2014-05-03 17:41 ` [PATCH 7/8] misc-utils/lslocks.c: add sorting support for lslocks command Shakur Shams Mullick
2014-05-03 17:41 ` [PATCH 8/8] disk-utils/partx.c: add sorting support for partx command Shakur Shams Mullick
2014-05-06 10:33 ` [PATCH 1/8] libsmartcols/src/libsmartcols.h.in: add function name Karel Zak

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=1399138888-7554-3-git-send-email-shakursmullick@gmail.com \
    --to=shakursmullick@gmail.com \
    --cc=util-linux@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox