[pacman-dev] Thoughts on database initialization and loading process

Rémy Oudompheng remyoudompheng at gmail.com
Sun Apr 17 12:37:12 EDT 2011


On Sun 17 April 2011 at 17:48 +0200, Xavier Chantry wrote:
> On Sun, Apr 17, 2011 at 9:32 AM, Rémy Oudompheng
> <remyoudompheng at gmail.com> wrote:
> >
> > We are looking at a broader problem: it is actually impossible to do any
> > sane return value checking for all functions returning an alpm_list_t*
> > since NULL is used both as the error value and as the empty list.
> >
> > [adding to this the fact that I am really not a fan of linked lists
> > especially when there doesn't seem to be any reason to use them.
> > NULL-terminated arrays of pointers work in almost all cases]
> >
> > I suggest adding a special value to return when an error occurs.
> > Something like this: callers would check the value of pm_errno
> > whenever return value == pm_listerror.
> >
> 
> IMO it looks better to return an int and give an alpm_list ** as argument.

I agree with that.

-- 
Rémy


More information about the pacman-dev mailing list