[PATCH 3/8] libsmartcols/src/smartcolsP.h: add sort flag and related enum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Shakur Shams Mullick <shakursmullick@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux