tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: libcodecs(3), take 4



On Thu, Oct 21, 2010 at 03:17:27PM +0200, Marc Balmer wrote:
> >> libraries that do things like writing to stderr or even exit the callers
> >> program are a pest.  I really dislike this part of the design.  As an
> >> application programmer, I would like to be in control how to react to an
> >> error and not have the library to make assumptions on what is the right
> >> way to deal with a certain situation.
> > 
> > Forget the exit part - that was my mistake.  (I saw many "if (error)
> > return 1;" in the code, that made me confused, and somehow transformed
> > to "exit(1);" in my head.)
> 
> Oh, sorry then. Well, so stays the stderr thingie, but that is much less of a 
> problem ;)

In the end, I dedicated a buffer in the codecs_t structure to error
messages, and added a "get error" form of codec which would return
them (if an error code was returned for any reason).

FYI,
Alistair

PS.  I think we have strayed from the *design* review part of this,
but I have also learned a number of lessons from all of this - thanks!


Home | Main Index | Thread Index | Old Index