Re: Naive implementation of strverscmp(3)

2006-02-17 Thread Ulrich Spoerlein
Jilles Tjoelker wrote: On Wed, Feb 15, 2006 at 10:05:24AM -0600, Dan Nelson wrote: > Your function is simpler than the C implementation on that site, but > falls over when a run of numbers exceeds 2^31 (raise it to 2^64 if you > use strtoull, but that's as high as you can yet). That problem can

Re: Naive implementation of strverscmp(3)

2006-02-15 Thread Jilles Tjoelker
On Wed, Feb 15, 2006 at 10:05:24AM -0600, Dan Nelson wrote: > Your function is simpler than the C implementation on that site, but > falls over when a run of numbers exceeds 2^31 (raise it to 2^64 if you > use strtoull, but that's as high as you can yet). That problem can be avoided fairly easily.

Re: Naive implementation of strverscmp(3)

2006-02-15 Thread Ulrich Spoerlein
Dan Nelson wrote: This looks a lot like strnatcmp, which is "natural sort" or "do what I mean" sort :) http://sourcefrog.net/projects/natsort/ Heh, I didn't know about that one, but since gqview uses strverscmp I only google for that one. Your function is simpler than the C implementation

Re: Naive implementation of strverscmp(3)

2006-02-15 Thread Dan Nelson
In the last episode (Feb 15), Ulrich Spoerlein said: > Peter Jeremy wrote: > >>Is there a chance this might get included into libc? Or is it > >>considered bloat? > >I don't think it belongs in libc. Maybe libutil. > > This would require patching the gqview configure script, but I can live > wit

Re: Naive implementation of strverscmp(3)

2006-02-15 Thread Ulrich Spoerlein
Peter Jeremy wrote: >Is there a chance this might get included into libc? Or is it considered >bloat? I don't think it belongs in libc. Maybe libutil. This would require patching the gqview configure script, but I can live with that. For the first point, consider strverscmp("jan25", "ja

Re: Naive implementation of strverscmp(3)

2006-02-15 Thread Peter Jeremy
On Tue, 2006-Feb-14 22:25:03 +0100, Ulrich Spoerlein wrote: >this is probably not the right list, but I'd like to collect reviews of >a strverscmp(3) function I wrote. It is used by the graphics/gqview port ... >Is there a chance this might get included into libc? Or is it considered >bloat? I

Naive implementation of strverscmp(3)

2006-02-14 Thread Ulrich Spoerlein
Hello Hackers, this is probably not the right list, but I'd like to collect reviews of a strverscmp(3) function I wrote. It is used by the graphics/gqview port (if present in libc) and since I want/need that functionality I whipped up a somewhat working version. It tries to sort strings like