[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH]: gnokii_strsplit as in glib (was Re: [PATCH] gnokii gtk2 port)
From: |
Bastien Nocera |
Subject: |
[PATCH]: gnokii_strsplit as in glib (was Re: [PATCH] gnokii gtk2 port) |
Date: |
Thu, 04 Aug 2005 18:19:43 +0100 |
On Thu, 2005-08-04 at 17:52 +0100, Bastien Nocera wrote:
> On Tue, 2005-08-02 at 21:41 +0200, Pawel Kot wrote:
> <snip>
> > > configure detects wheter C99 compatible snprintf() and vsnprintf()
> > > implementation are available. gnokii will use a replacement function
> > > if these functions aren't available or they aren't C99 compatible.
> > > If there's no asprintf() or vasprintf() implementation, the snprintf
> > > code provides them (look into common/snprintf.c). I think asprintf()
> > > is the function you are looking for... :-)
> >
> > Bastien, is it enough for you?
>
> I misunderstood the paragraph above. asprintf would be good enough
> indeed for what I use it for. I'll modify gnokii_strsplit() to allow an
> undefined amount of tokens, and it should be good without glib.
And here's a testcase and a patch to implement an undefined number of
tokens. Pass "-1" as the number of tokens, and you shall receive the
smallest possible array, with the maximum number of tokens it could
create out of it. Should also be greedier than the current
gnokii_strsplit when it comes to allocating memory.
Cheers
---
Bastien Nocera <address@hidden>
gnokii-strplit-undefined-tokens.patch
Description: Text Data
test-strsplit.c
Description: Text Data
- Re: [PATCH] gnokii gtk2 port, (continued)
- Re: [PATCH] gnokii gtk2 port, Bastien Nocera, 2005/08/01
- Re: [PATCH] gnokii gtk2 port, Pawel Kot, 2005/08/01
- Re: [PATCH] gnokii gtk2 port, Bastien Nocera, 2005/08/01
- Re: [PATCH] gnokii gtk2 port, Pawel Kot, 2005/08/01
- Re: [PATCH] gnokii gtk2 port, BORBELY Zoltan, 2005/08/02
- Re: [PATCH] gnokii gtk2 port, Pawel Kot, 2005/08/02
- Re: [PATCH] gnokii gtk2 port, Bastien Nocera, 2005/08/03
- Re: [PATCH] gnokii gtk2 port, Pawel Kot, 2005/08/03
- Re: [PATCH] gnokii gtk2 port, BORBELY Zoltan, 2005/08/03
- Re: [PATCH] gnokii gtk2 port, Bastien Nocera, 2005/08/04
- [PATCH]: gnokii_strsplit as in glib (was Re: [PATCH] gnokii gtk2 port),
Bastien Nocera <=
- Re: [PATCH]: gnokii_strsplit as in glib (was Re: [PATCH] gnokii gtk2 port), Pawel Kot, 2005/08/09
- Re: [PATCH]: gnokii_strsplit as in glib (was Re: [PATCH] gnokii gtk2 port), Bastien Nocera, 2005/08/10
Re: [PATCH] gnokii gtk2 port, Jan Derfinak, 2005/08/02
Re: [PATCH] gnokii gtk2 port, Jan Derfinak, 2005/08/03