On Mon, 14 Jan 2008, Jan Pechanec wrote:

> On Mon, 14 Jan 2008, [EMAIL PROTECTED] wrote:
>
>       hi Frank,
>
>       interestingly, the mailing list software added some spaces, the
> original subject was this:
>
>       parsing "xxx=yyy;abc=efg;nnn=1 2 3;..."-like option string
>
>>  strtok()
>>     A sequence of calls to strtok() breaks the string pointed to
>>     by  s1 into a sequence of tokens, each of which is delimited
>>     by a byte from the string pointed to by s2. The  first  call
>>     in  the  sequence  has s1 as its first argument, and is fol-
>>     lowed by calls with a null pointer as their first  argument.
>>     The  separator string pointed to by s2 can be different from
>>     call to call.
>> [ ... ]
>
>       good idea, I used strtok() some time ago but forgot about that.
> However, I would have to reparse the token using strchr(3c) and look for
> possible '=' there. So yes, it would be very helpful but I still hope for a
> solution that is "more complete" for me.

Ah ok, I guess you're for a "pluggable getsubopt()" then, where the field 
separator can be passed in.

No, not aware of that. Given how simple getsubopt() is, it'd be trivial to 
implement that but no, haven't seen it anywhere in the standard libs 
either.

For reference:

http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/getsubopt.c

FrankH.

>
>       many URIs use name=value definitions separated by semicolons, I
> think it's quite a common specification so I still believe it's already
> present somewhere.
>
>       thanks, Jan.
>
> -- 
> Jan Pechanec
> _______________________________________________
> opensolaris-code mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
>

------------------------------------------------------------------------------
No good can come from selling your freedom, not for all the gold in the world,
for the value of this heavenly gift far exceeds that of any fortune on earth.
------------------------------------------------------------------------------
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to