Re: [PATCH 1/8] libsmartcols/src/libsmartcols.h.in: add function name

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

 



On Sat, May 03, 2014 at 11:41:21PM +0600, Shakur Shams Mullick wrote:
>  libsmartcols/src/libsmartcols.h.in | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Thanks Shakur,

> +extern int scols_table_is_namesort(struct libscols_table *tb);
> +extern int scols_table_is_sizesort(struct libscols_table *tb);

unfortunately it seems more like a hack to have sorted output from
lsblk(8) than a real extension to the API.

It's shared library, we should not force developers to use our
hardcoded point of view. It would be better to have API to specify
custom compare function.

 scols_column_set_sortcmp(struct libscols_column *cl,
                          int (*compar)(struct libscols_cell *, struct libscols_cell *, void *),
                          void *data)

it means function to compare two cells. This function should be called
from struct list_head compare function.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
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