On Sun, May 11, 2014 at 02:20:34PM +0600, Shakur Shams Mullick wrote: > +int scols_cmpstr_cells(struct libscols_cell *a, struct libscols_cell *b, void *data) > +{ > + int n, m; > + const char *adata, *bdata; > + > + adata = scols_cell_get_data(a); > + bdata = scols_cell_get_data(b); > + > + n = strlen(adata); > + m = strlen(bdata); > + > + return strncmp(adata, bdata, (n>=m ? n : m)); > +} This looks good. > +int scols_cmpnum_cells(struct libscols_cell *a, struct libscols_cell *b, void *data) > +{ > + uint64_t n, m; > + const char *adata, *bdata; > + > + adata = scols_cell_get_data(a); > + bdata = scols_cell_get_data(b); > + > + strtosize(adata, &n); > + strtosize(bdata, &m); I have doubts that we can scols_cmpnum_cells() to the library API. (Sorry for the suggestion.) The size strings are composed by applications and no by the library, the size_to_human_string() is private util-linux function, so rely on strtosize() seems strange. The cmpnum_cells() have to be within lsblk.c. It would be better to provide scols_cmpstr_cells() only. Note that you don't have to send v3, I'm going to fix/improve it before merge. Thanks! Karel > + if (n >= m) > + return 1; > + return -1; > +} > -- > 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 > -- 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