Re: Libification project (SoC)
- From
- Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
- Date
- Mar 16, 2007, 18:38 UTC
- Message-ID
- <20070316153822.5c842e69@localhost>
- In-Reply-To
- <20070316140855.GE4489@pasky.or.cz>
Em Fri, 16 Mar 2007 15:08:55 +0100 Petr Baudis <pasky@suse.cz> escreveu:
| On Fri, Mar 16, 2007 at 02:47:15PM CET, Luiz Fernando N. Capitulino wrote: | > We could start by fixing the got-an-error-die behaivor and | > define a _experimental_ API (just a few functions) just to get | > data out of git. | > | > This would be enough to write the Perl binding I think? | | Actually, well, I've already done this. :-)
Not exactly, at least not the way I think it should be done.
| The trouble begins when you want to access multiple repositories from | the same process, etc. Without that, writing the Perl binding is | trivial; there's already a hook the binding can use to catch dies, I've | added it. | | So, the main point of the work is to define a _good_ API and get rid of | the static state, I guess.
Yes, the set_*_routine()s seems a workaround to me, you're only fixing die()'s final effect.
I think the right solution is to get rid of die() from functions that are supposed to be an interface, set errno if needed and return -1 or NULL.
That looks a lot of work BTW, but I'll be pleased to work on it.
Is there more things like the set_*_routine()s added to fix other problems?
-- Luiz Fernando N. Capitulino