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

Xavier Chantry chantry.xavier at gmail.com
Sun Apr 17 11:48:12 EDT 2011

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.

More information about the pacman-dev mailing list