On Mon, 14 Jan 2008, Jan Pechanec wrote:

> On Mon, 14 Jan 2008, [EMAIL PROTECTED] wrote:
>
>> 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.
>
>       yeah, it would be nice to have 3rd parameter with delimiters. I can
> imagine " ,;" to be widely used for xxx=yyy schemes. Btw, getsubopt(3c) is
> UNIX03 function. If there is nothing ready the only option would be to
> create a new function, or follow the path of every application to define
> its own function...

UNIX03 or not, one could do:

int getsubopt_ifs(char **optionp, char * const *keylistp, char **valuep,
        char ifs) {
        ...
}

int getsubopt(char **optionp, char * const *keylistp, char **valuep)
{
        return (getsubopt_ifs(optionp, keylistp, valuep, ','));
}

Maintains the UNIX03 interface, and the code.

FrankH.



>
>       J.
>
> -- 
> Jan Pechanec
>

------------------------------------------------------------------------------
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