On 2011/3/28 Dave Reisner <[email protected]> wrote: > @@ -597,4 +598,18 @@ void SYMEXPORT alpm_option_set_checkspace(int checkspace) > handle->checkspace = checkspace; > } > > +void SYMEXPORT alpm_option_set_useragent(char *useragent) > +{ > + if(handle == NULL) { > + pm_errno = PM_ERR_HANDLE_NULL; > + return; > + } > + handle->useragent = useragent; > +} > + > +const char SYMEXPORT *alpm_option_get_useragent() > +{ > + return handle->useragent; > +} > + > /* vim: set ts=2 sw=2 noet: */
I'd rather have alpm_option_set_useragent() return an int, just like alpm_option_set_root(), and make alpm_option_get_useragent() return NULL and set pm_errno if handle is NULL, just like alpm_option_set_root(). As a matter or personal taste (and a bit of consistency obsession). -- Rémy.
