Subject: Re: strtonum(3) in our libc
To: Mindaugas <unex@linija.org>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-userlevel
Date: 06/05/2006 15:54:55
On Jun 5, 2006, at 2:33 PM, Mindaugas wrote:

> And I think here is the main problem. Main point of this function
> addition is a compability purposes with OpenBSD and their projects
> which uses it. Both the FreeBSD folks and we agree, that API could be
> improved, but OpenBSD folks, as usually, don not.

Well, we should not suffer just because OpenBSD doesn't know how to  
design even a simple API like this one.  If FreeBSD wants to, well,  
that's their problem.


> So at first we must
> take a decision:
> a) Improve this function and somehow stay compatible with original
> implementation

There is no point in staying compatible with the original, because  
the original API stinks.  We should either add it with changes or not  
add it at all.  If we want to have an improved one, we can always  
#ifdef any code brought over from the other projects to use it:

#ifdef __NetBSD__
	error = strtoinum(...);
#else /* use crappy OpenBSD API */
	result = strtonum(...);
#endif

-- thorpej