[PATCH 5/8] libsmartcols/src/column.c: add function to set comparison function scols_column_set_sortcmp() sets the cell comparison function to use

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

 



---
 libsmartcols/src/column.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libsmartcols/src/column.c b/libsmartcols/src/column.c
index 4ee782f..f2ff0a7 100644
--- a/libsmartcols/src/column.c
+++ b/libsmartcols/src/column.c
@@ -313,3 +313,15 @@ int scols_column_is_noextremes(struct libscols_column *cl)
 		return -EINVAL;
 	return cl->flags & SCOLS_FL_NOEXTREMES;
 }
+
+int scols_column_set_sortcmp(struct libscols_column *cl, 
+                             int (*compar)(struct libscols_cell *a, struct libscols_cell *b, void *data), 
+                             void *data)
+{
+	assert(cl);
+	if (!cl)
+		return -EINVAL;
+	cl->compar = compar;
+	
+	return 0;
+}
-- 
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