Lines Matching refs:handle

44 	alpm_handle_t *handle;  in _alpm_handle_new()  local
46 CALLOC(handle, 1, sizeof(alpm_handle_t), return NULL); in _alpm_handle_new()
47 handle->deltaratio = 0.0; in _alpm_handle_new()
48 handle->lockfd = -1; in _alpm_handle_new()
50 return handle; in _alpm_handle_new()
53 void _alpm_handle_free(alpm_handle_t *handle) in _alpm_handle_free() argument
55 if(handle == NULL) { in _alpm_handle_free()
60 if(handle->logstream) { in _alpm_handle_free()
61 fclose(handle->logstream); in _alpm_handle_free()
62 handle->logstream = NULL; in _alpm_handle_free()
64 if(handle->usesyslog) { in _alpm_handle_free()
65 handle->usesyslog = 0; in _alpm_handle_free()
71 curl_easy_cleanup(handle->curl); in _alpm_handle_free()
75 FREELIST(handle->known_keys); in _alpm_handle_free()
78 regfree(&handle->delta_regex); in _alpm_handle_free()
81 _alpm_trans_free(handle->trans); in _alpm_handle_free()
82 FREE(handle->root); in _alpm_handle_free()
83 FREE(handle->dbpath); in _alpm_handle_free()
84 FREE(handle->dbext); in _alpm_handle_free()
85 FREELIST(handle->cachedirs); in _alpm_handle_free()
86 FREELIST(handle->hookdirs); in _alpm_handle_free()
87 FREE(handle->logfile); in _alpm_handle_free()
88 FREE(handle->lockfile); in _alpm_handle_free()
89 FREE(handle->arch); in _alpm_handle_free()
90 FREE(handle->gpgdir); in _alpm_handle_free()
91 FREELIST(handle->noupgrade); in _alpm_handle_free()
92 FREELIST(handle->noextract); in _alpm_handle_free()
93 FREELIST(handle->ignorepkg); in _alpm_handle_free()
94 FREELIST(handle->ignoregroup); in _alpm_handle_free()
95 FREELIST(handle->overwrite_files); in _alpm_handle_free()
97 alpm_list_free_inner(handle->assumeinstalled, (alpm_list_fn_free)alpm_dep_free); in _alpm_handle_free()
98 alpm_list_free(handle->assumeinstalled); in _alpm_handle_free()
100 FREE(handle); in _alpm_handle_free()
104 int _alpm_handle_lock(alpm_handle_t *handle) in _alpm_handle_lock() argument
108 ASSERT(handle->lockfile != NULL, return -1); in _alpm_handle_lock()
109 ASSERT(handle->lockfd < 0, return 0); in _alpm_handle_lock()
112 dir = strdup(handle->lockfile); in _alpm_handle_lock()
124 handle->lockfd = open(handle->lockfile, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, 0000); in _alpm_handle_lock()
125 } while(handle->lockfd == -1 && errno == EINTR); in _alpm_handle_lock()
127 return (handle->lockfd >= 0 ? 0 : -1); in _alpm_handle_lock()
136 int SYMEXPORT alpm_unlock(alpm_handle_t *handle) in alpm_unlock() argument
138 ASSERT(handle != NULL, return -1); in alpm_unlock()
139 ASSERT(handle->lockfile != NULL, return 0); in alpm_unlock()
140 ASSERT(handle->lockfd >= 0, return 0); in alpm_unlock()
142 close(handle->lockfd); in alpm_unlock()
143 handle->lockfd = -1; in alpm_unlock()
145 if(unlink(handle->lockfile) != 0) { in alpm_unlock()
146 RET_ERR_ASYNC_SAFE(handle, ALPM_ERR_SYSTEM, -1); in alpm_unlock()
152 int _alpm_handle_unlock(alpm_handle_t *handle) in _alpm_handle_unlock() argument
154 if(alpm_unlock(handle) != 0) { in _alpm_handle_unlock()
156 _alpm_log(handle, ALPM_LOG_WARNING, in _alpm_handle_unlock()
157 _("lock file missing %s\n"), handle->lockfile); in _alpm_handle_unlock()
158 alpm_logaction(handle, ALPM_CALLER_PREFIX, in _alpm_handle_unlock()
159 "warning: lock file missing %s\n", handle->lockfile); in _alpm_handle_unlock()
162 _alpm_log(handle, ALPM_LOG_WARNING, in _alpm_handle_unlock()
163 _("could not remove lock file %s\n"), handle->lockfile); in _alpm_handle_unlock()
164 alpm_logaction(handle, ALPM_CALLER_PREFIX, in _alpm_handle_unlock()
165 "warning: could not remove lock file %s\n", handle->lockfile); in _alpm_handle_unlock()
174 alpm_cb_log SYMEXPORT alpm_option_get_logcb(alpm_handle_t *handle) in alpm_option_get_logcb() argument
176 CHECK_HANDLE(handle, return NULL); in alpm_option_get_logcb()
177 return handle->logcb; in alpm_option_get_logcb()
180 alpm_cb_download SYMEXPORT alpm_option_get_dlcb(alpm_handle_t *handle) in alpm_option_get_dlcb() argument
182 CHECK_HANDLE(handle, return NULL); in alpm_option_get_dlcb()
183 return handle->dlcb; in alpm_option_get_dlcb()
186 alpm_cb_fetch SYMEXPORT alpm_option_get_fetchcb(alpm_handle_t *handle) in alpm_option_get_fetchcb() argument
188 CHECK_HANDLE(handle, return NULL); in alpm_option_get_fetchcb()
189 return handle->fetchcb; in alpm_option_get_fetchcb()
192 alpm_cb_totaldl SYMEXPORT alpm_option_get_totaldlcb(alpm_handle_t *handle) in alpm_option_get_totaldlcb() argument
194 CHECK_HANDLE(handle, return NULL); in alpm_option_get_totaldlcb()
195 return handle->totaldlcb; in alpm_option_get_totaldlcb()
198 alpm_cb_event SYMEXPORT alpm_option_get_eventcb(alpm_handle_t *handle) in alpm_option_get_eventcb() argument
200 CHECK_HANDLE(handle, return NULL); in alpm_option_get_eventcb()
201 return handle->eventcb; in alpm_option_get_eventcb()
204 alpm_cb_question SYMEXPORT alpm_option_get_questioncb(alpm_handle_t *handle) in alpm_option_get_questioncb() argument
206 CHECK_HANDLE(handle, return NULL); in alpm_option_get_questioncb()
207 return handle->questioncb; in alpm_option_get_questioncb()
210 alpm_cb_progress SYMEXPORT alpm_option_get_progresscb(alpm_handle_t *handle) in alpm_option_get_progresscb() argument
212 CHECK_HANDLE(handle, return NULL); in alpm_option_get_progresscb()
213 return handle->progresscb; in alpm_option_get_progresscb()
216 const char SYMEXPORT *alpm_option_get_root(alpm_handle_t *handle) in alpm_option_get_root() argument
218 CHECK_HANDLE(handle, return NULL); in alpm_option_get_root()
219 return handle->root; in alpm_option_get_root()
222 const char SYMEXPORT *alpm_option_get_dbpath(alpm_handle_t *handle) in alpm_option_get_dbpath() argument
224 CHECK_HANDLE(handle, return NULL); in alpm_option_get_dbpath()
225 return handle->dbpath; in alpm_option_get_dbpath()
228 alpm_list_t SYMEXPORT *alpm_option_get_hookdirs(alpm_handle_t *handle) in alpm_option_get_hookdirs() argument
230 CHECK_HANDLE(handle, return NULL); in alpm_option_get_hookdirs()
231 return handle->hookdirs; in alpm_option_get_hookdirs()
234 alpm_list_t SYMEXPORT *alpm_option_get_cachedirs(alpm_handle_t *handle) in alpm_option_get_cachedirs() argument
236 CHECK_HANDLE(handle, return NULL); in alpm_option_get_cachedirs()
237 return handle->cachedirs; in alpm_option_get_cachedirs()
240 const char SYMEXPORT *alpm_option_get_logfile(alpm_handle_t *handle) in alpm_option_get_logfile() argument
242 CHECK_HANDLE(handle, return NULL); in alpm_option_get_logfile()
243 return handle->logfile; in alpm_option_get_logfile()
246 const char SYMEXPORT *alpm_option_get_lockfile(alpm_handle_t *handle) in alpm_option_get_lockfile() argument
248 CHECK_HANDLE(handle, return NULL); in alpm_option_get_lockfile()
249 return handle->lockfile; in alpm_option_get_lockfile()
252 const char SYMEXPORT *alpm_option_get_gpgdir(alpm_handle_t *handle) in alpm_option_get_gpgdir() argument
254 CHECK_HANDLE(handle, return NULL); in alpm_option_get_gpgdir()
255 return handle->gpgdir; in alpm_option_get_gpgdir()
258 int SYMEXPORT alpm_option_get_usesyslog(alpm_handle_t *handle) in alpm_option_get_usesyslog() argument
260 CHECK_HANDLE(handle, return -1); in alpm_option_get_usesyslog()
261 return handle->usesyslog; in alpm_option_get_usesyslog()
264 alpm_list_t SYMEXPORT *alpm_option_get_noupgrades(alpm_handle_t *handle) in alpm_option_get_noupgrades() argument
266 CHECK_HANDLE(handle, return NULL); in alpm_option_get_noupgrades()
267 return handle->noupgrade; in alpm_option_get_noupgrades()
270 alpm_list_t SYMEXPORT *alpm_option_get_noextracts(alpm_handle_t *handle) in alpm_option_get_noextracts() argument
272 CHECK_HANDLE(handle, return NULL); in alpm_option_get_noextracts()
273 return handle->noextract; in alpm_option_get_noextracts()
276 alpm_list_t SYMEXPORT *alpm_option_get_ignorepkgs(alpm_handle_t *handle) in alpm_option_get_ignorepkgs() argument
278 CHECK_HANDLE(handle, return NULL); in alpm_option_get_ignorepkgs()
279 return handle->ignorepkg; in alpm_option_get_ignorepkgs()
282 alpm_list_t SYMEXPORT *alpm_option_get_ignoregroups(alpm_handle_t *handle) in alpm_option_get_ignoregroups() argument
284 CHECK_HANDLE(handle, return NULL); in alpm_option_get_ignoregroups()
285 return handle->ignoregroup; in alpm_option_get_ignoregroups()
288 alpm_list_t SYMEXPORT *alpm_option_get_overwrite_files(alpm_handle_t *handle) in alpm_option_get_overwrite_files() argument
290 CHECK_HANDLE(handle, return NULL); in alpm_option_get_overwrite_files()
291 return handle->overwrite_files; in alpm_option_get_overwrite_files()
294 alpm_list_t SYMEXPORT *alpm_option_get_assumeinstalled(alpm_handle_t *handle) in alpm_option_get_assumeinstalled() argument
296 CHECK_HANDLE(handle, return NULL); in alpm_option_get_assumeinstalled()
297 return handle->assumeinstalled; in alpm_option_get_assumeinstalled()
300 const char SYMEXPORT *alpm_option_get_arch(alpm_handle_t *handle) in alpm_option_get_arch() argument
302 CHECK_HANDLE(handle, return NULL); in alpm_option_get_arch()
303 return handle->arch; in alpm_option_get_arch()
306 double SYMEXPORT alpm_option_get_deltaratio(alpm_handle_t *handle) in alpm_option_get_deltaratio() argument
308 CHECK_HANDLE(handle, return -1); in alpm_option_get_deltaratio()
309 return handle->deltaratio; in alpm_option_get_deltaratio()
312 int SYMEXPORT alpm_option_get_checkspace(alpm_handle_t *handle) in alpm_option_get_checkspace() argument
314 CHECK_HANDLE(handle, return -1); in alpm_option_get_checkspace()
315 return handle->checkspace; in alpm_option_get_checkspace()
318 const char SYMEXPORT *alpm_option_get_dbext(alpm_handle_t *handle) in alpm_option_get_dbext() argument
320 CHECK_HANDLE(handle, return NULL); in alpm_option_get_dbext()
321 return handle->dbext; in alpm_option_get_dbext()
324 int SYMEXPORT alpm_option_set_logcb(alpm_handle_t *handle, alpm_cb_log cb) in alpm_option_set_logcb() argument
326 CHECK_HANDLE(handle, return -1); in alpm_option_set_logcb()
327 handle->logcb = cb; in alpm_option_set_logcb()
331 int SYMEXPORT alpm_option_set_dlcb(alpm_handle_t *handle, alpm_cb_download cb) in alpm_option_set_dlcb() argument
333 CHECK_HANDLE(handle, return -1); in alpm_option_set_dlcb()
334 handle->dlcb = cb; in alpm_option_set_dlcb()
338 int SYMEXPORT alpm_option_set_fetchcb(alpm_handle_t *handle, alpm_cb_fetch cb) in alpm_option_set_fetchcb() argument
340 CHECK_HANDLE(handle, return -1); in alpm_option_set_fetchcb()
341 handle->fetchcb = cb; in alpm_option_set_fetchcb()
345 int SYMEXPORT alpm_option_set_totaldlcb(alpm_handle_t *handle, alpm_cb_totaldl cb) in alpm_option_set_totaldlcb() argument
347 CHECK_HANDLE(handle, return -1); in alpm_option_set_totaldlcb()
348 handle->totaldlcb = cb; in alpm_option_set_totaldlcb()
352 int SYMEXPORT alpm_option_set_eventcb(alpm_handle_t *handle, alpm_cb_event cb) in alpm_option_set_eventcb() argument
354 CHECK_HANDLE(handle, return -1); in alpm_option_set_eventcb()
355 handle->eventcb = cb; in alpm_option_set_eventcb()
359 int SYMEXPORT alpm_option_set_questioncb(alpm_handle_t *handle, alpm_cb_question cb) in alpm_option_set_questioncb() argument
361 CHECK_HANDLE(handle, return -1); in alpm_option_set_questioncb()
362 handle->questioncb = cb; in alpm_option_set_questioncb()
366 int SYMEXPORT alpm_option_set_progresscb(alpm_handle_t *handle, alpm_cb_progress cb) in alpm_option_set_progresscb() argument
368 CHECK_HANDLE(handle, return -1); in alpm_option_set_progresscb()
369 handle->progresscb = cb; in alpm_option_set_progresscb()
420 int SYMEXPORT alpm_option_add_hookdir(alpm_handle_t *handle, const char *hookdir) in alpm_option_add_hookdir() argument
424 CHECK_HANDLE(handle, return -1); in alpm_option_add_hookdir()
425 ASSERT(hookdir != NULL, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); in alpm_option_add_hookdir()
429 RET_ERR(handle, ALPM_ERR_MEMORY, -1); in alpm_option_add_hookdir()
431 handle->hookdirs = alpm_list_add(handle->hookdirs, newhookdir); in alpm_option_add_hookdir()
432 _alpm_log(handle, ALPM_LOG_DEBUG, "option 'hookdir' = %s\n", newhookdir); in alpm_option_add_hookdir()
436 int SYMEXPORT alpm_option_set_hookdirs(alpm_handle_t *handle, alpm_list_t *hookdirs) in alpm_option_set_hookdirs() argument
439 CHECK_HANDLE(handle, return -1); in alpm_option_set_hookdirs()
440 if(handle->hookdirs) { in alpm_option_set_hookdirs()
441 FREELIST(handle->hookdirs); in alpm_option_set_hookdirs()
444 int ret = alpm_option_add_hookdir(handle, i->data); in alpm_option_set_hookdirs()
452 int SYMEXPORT alpm_option_remove_hookdir(alpm_handle_t *handle, const char *hookdir) in alpm_option_remove_hookdir() argument
456 CHECK_HANDLE(handle, return -1); in alpm_option_remove_hookdir()
457 ASSERT(hookdir != NULL, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); in alpm_option_remove_hookdir()
461 RET_ERR(handle, ALPM_ERR_MEMORY, -1); in alpm_option_remove_hookdir()
463 handle->hookdirs = alpm_list_remove_str(handle->hookdirs, newhookdir, &vdata); in alpm_option_remove_hookdir()
472 int SYMEXPORT alpm_option_add_cachedir(alpm_handle_t *handle, const char *cachedir) in alpm_option_add_cachedir() argument
476 CHECK_HANDLE(handle, return -1); in alpm_option_add_cachedir()
477 ASSERT(cachedir != NULL, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); in alpm_option_add_cachedir()
483 RET_ERR(handle, ALPM_ERR_MEMORY, -1); in alpm_option_add_cachedir()
485 handle->cachedirs = alpm_list_add(handle->cachedirs, newcachedir); in alpm_option_add_cachedir()
486 _alpm_log(handle, ALPM_LOG_DEBUG, "option 'cachedir' = %s\n", newcachedir); in alpm_option_add_cachedir()
490 int SYMEXPORT alpm_option_set_cachedirs(alpm_handle_t *handle, alpm_list_t *cachedirs) in alpm_option_set_cachedirs() argument
493 CHECK_HANDLE(handle, return -1); in alpm_option_set_cachedirs()
494 if(handle->cachedirs) { in alpm_option_set_cachedirs()
495 FREELIST(handle->cachedirs); in alpm_option_set_cachedirs()
498 int ret = alpm_option_add_cachedir(handle, i->data); in alpm_option_set_cachedirs()
506 int SYMEXPORT alpm_option_remove_cachedir(alpm_handle_t *handle, const char *cachedir) in alpm_option_remove_cachedir() argument
510 CHECK_HANDLE(handle, return -1); in alpm_option_remove_cachedir()
511 ASSERT(cachedir != NULL, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); in alpm_option_remove_cachedir()
515 RET_ERR(handle, ALPM_ERR_MEMORY, -1); in alpm_option_remove_cachedir()
517 handle->cachedirs = alpm_list_remove_str(handle->cachedirs, newcachedir, &vdata); in alpm_option_remove_cachedir()
526 int SYMEXPORT alpm_option_set_logfile(alpm_handle_t *handle, const char *logfile) in alpm_option_set_logfile() argument
528 char *oldlogfile = handle->logfile; in alpm_option_set_logfile()
530 CHECK_HANDLE(handle, return -1); in alpm_option_set_logfile()
532 handle->pm_errno = ALPM_ERR_WRONG_ARGS; in alpm_option_set_logfile()
536 STRDUP(handle->logfile, logfile, RET_ERR(handle, ALPM_ERR_MEMORY, -1)); in alpm_option_set_logfile()
543 if(handle->logstream) { in alpm_option_set_logfile()
544 fclose(handle->logstream); in alpm_option_set_logfile()
545 handle->logstream = NULL; in alpm_option_set_logfile()
547 _alpm_log(handle, ALPM_LOG_DEBUG, "option 'logfile' = %s\n", handle->logfile); in alpm_option_set_logfile()
551 int SYMEXPORT alpm_option_set_gpgdir(alpm_handle_t *handle, const char *gpgdir) in alpm_option_set_gpgdir() argument
554 CHECK_HANDLE(handle, return -1); in alpm_option_set_gpgdir()
555 if((err = _alpm_set_directory_option(gpgdir, &(handle->gpgdir), 0))) { in alpm_option_set_gpgdir()
556 RET_ERR(handle, err, -1); in alpm_option_set_gpgdir()
558 _alpm_log(handle, ALPM_LOG_DEBUG, "option 'gpgdir' = %s\n", handle->gpgdir); in alpm_option_set_gpgdir()
562 int SYMEXPORT alpm_option_set_usesyslog(alpm_handle_t *handle, int usesyslog) in alpm_option_set_usesyslog() argument
564 CHECK_HANDLE(handle, return -1); in alpm_option_set_usesyslog()
565 handle->usesyslog = usesyslog; in alpm_option_set_usesyslog()
569 static int _alpm_option_strlist_add(alpm_handle_t *handle, alpm_list_t **list, const char *str) in _alpm_option_strlist_add() argument
572 CHECK_HANDLE(handle, return -1); in _alpm_option_strlist_add()
573 STRDUP(dup, str, RET_ERR(handle, ALPM_ERR_MEMORY, -1)); in _alpm_option_strlist_add()
578 static int _alpm_option_strlist_set(alpm_handle_t *handle, alpm_list_t **list, alpm_list_t *newlist) in _alpm_option_strlist_set() argument
580 CHECK_HANDLE(handle, return -1); in _alpm_option_strlist_set()
586 static int _alpm_option_strlist_rem(alpm_handle_t *handle, alpm_list_t **list, const char *str) in _alpm_option_strlist_rem() argument
589 CHECK_HANDLE(handle, return -1); in _alpm_option_strlist_rem()
598 int SYMEXPORT alpm_option_add_noupgrade(alpm_handle_t *handle, const char *pkg) in alpm_option_add_noupgrade() argument
600 return _alpm_option_strlist_add(handle, &(handle->noupgrade), pkg); in alpm_option_add_noupgrade()
603 int SYMEXPORT alpm_option_set_noupgrades(alpm_handle_t *handle, alpm_list_t *noupgrade) in alpm_option_set_noupgrades() argument
605 return _alpm_option_strlist_set(handle, &(handle->noupgrade), noupgrade); in alpm_option_set_noupgrades()
608 int SYMEXPORT alpm_option_remove_noupgrade(alpm_handle_t *handle, const char *pkg) in alpm_option_remove_noupgrade() argument
610 return _alpm_option_strlist_rem(handle, &(handle->noupgrade), pkg); in alpm_option_remove_noupgrade()
613 int SYMEXPORT alpm_option_match_noupgrade(alpm_handle_t *handle, const char *path) in alpm_option_match_noupgrade() argument
615 return _alpm_fnmatch_patterns(handle->noupgrade, path); in alpm_option_match_noupgrade()
618 int SYMEXPORT alpm_option_add_noextract(alpm_handle_t *handle, const char *path) in alpm_option_add_noextract() argument
620 return _alpm_option_strlist_add(handle, &(handle->noextract), path); in alpm_option_add_noextract()
623 int SYMEXPORT alpm_option_set_noextracts(alpm_handle_t *handle, alpm_list_t *noextract) in alpm_option_set_noextracts() argument
625 return _alpm_option_strlist_set(handle, &(handle->noextract), noextract); in alpm_option_set_noextracts()
628 int SYMEXPORT alpm_option_remove_noextract(alpm_handle_t *handle, const char *path) in alpm_option_remove_noextract() argument
630 return _alpm_option_strlist_rem(handle, &(handle->noextract), path); in alpm_option_remove_noextract()
633 int SYMEXPORT alpm_option_match_noextract(alpm_handle_t *handle, const char *path) in alpm_option_match_noextract() argument
635 return _alpm_fnmatch_patterns(handle->noextract, path); in alpm_option_match_noextract()
638 int SYMEXPORT alpm_option_add_ignorepkg(alpm_handle_t *handle, const char *pkg) in alpm_option_add_ignorepkg() argument
640 return _alpm_option_strlist_add(handle, &(handle->ignorepkg), pkg); in alpm_option_add_ignorepkg()
643 int SYMEXPORT alpm_option_set_ignorepkgs(alpm_handle_t *handle, alpm_list_t *ignorepkgs) in alpm_option_set_ignorepkgs() argument
645 return _alpm_option_strlist_set(handle, &(handle->ignorepkg), ignorepkgs); in alpm_option_set_ignorepkgs()
648 int SYMEXPORT alpm_option_remove_ignorepkg(alpm_handle_t *handle, const char *pkg) in alpm_option_remove_ignorepkg() argument
650 return _alpm_option_strlist_rem(handle, &(handle->ignorepkg), pkg); in alpm_option_remove_ignorepkg()
653 int SYMEXPORT alpm_option_add_ignoregroup(alpm_handle_t *handle, const char *grp) in alpm_option_add_ignoregroup() argument
655 return _alpm_option_strlist_add(handle, &(handle->ignoregroup), grp); in alpm_option_add_ignoregroup()
658 int SYMEXPORT alpm_option_set_ignoregroups(alpm_handle_t *handle, alpm_list_t *ignoregrps) in alpm_option_set_ignoregroups() argument
660 return _alpm_option_strlist_set(handle, &(handle->ignoregroup), ignoregrps); in alpm_option_set_ignoregroups()
663 int SYMEXPORT alpm_option_remove_ignoregroup(alpm_handle_t *handle, const char *grp) in alpm_option_remove_ignoregroup() argument
665 return _alpm_option_strlist_rem(handle, &(handle->ignoregroup), grp); in alpm_option_remove_ignoregroup()
668 int SYMEXPORT alpm_option_add_overwrite_file(alpm_handle_t *handle, const char *glob) in alpm_option_add_overwrite_file() argument
670 return _alpm_option_strlist_add(handle, &(handle->overwrite_files), glob); in alpm_option_add_overwrite_file()
673 int SYMEXPORT alpm_option_set_overwrite_files(alpm_handle_t *handle, alpm_list_t *globs) in alpm_option_set_overwrite_files() argument
675 return _alpm_option_strlist_set(handle, &(handle->overwrite_files), globs); in alpm_option_set_overwrite_files()
678 int SYMEXPORT alpm_option_remove_overwrite_file(alpm_handle_t *handle, const char *glob) in alpm_option_remove_overwrite_file() argument
680 return _alpm_option_strlist_rem(handle, &(handle->overwrite_files), glob); in alpm_option_remove_overwrite_file()
683 int SYMEXPORT alpm_option_add_assumeinstalled(alpm_handle_t *handle, const alpm_depend_t *dep) in alpm_option_add_assumeinstalled() argument
686 CHECK_HANDLE(handle, return -1); in alpm_option_add_assumeinstalled()
688 RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); in alpm_option_add_assumeinstalled()
689 ASSERT((depcpy = _alpm_dep_dup(dep)), RET_ERR(handle, ALPM_ERR_MEMORY, -1)); in alpm_option_add_assumeinstalled()
693 handle->assumeinstalled = alpm_list_add(handle->assumeinstalled, depcpy); in alpm_option_add_assumeinstalled()
697 int SYMEXPORT alpm_option_set_assumeinstalled(alpm_handle_t *handle, alpm_list_t *deps) in alpm_option_set_assumeinstalled() argument
699 CHECK_HANDLE(handle, return -1); in alpm_option_set_assumeinstalled()
700 if(handle->assumeinstalled) { in alpm_option_set_assumeinstalled()
701 alpm_list_free_inner(handle->assumeinstalled, (alpm_list_fn_free)alpm_dep_free); in alpm_option_set_assumeinstalled()
702 alpm_list_free(handle->assumeinstalled); in alpm_option_set_assumeinstalled()
705 if(alpm_option_add_assumeinstalled(handle, deps->data) != 0) { in alpm_option_set_assumeinstalled()
736 int SYMEXPORT alpm_option_remove_assumeinstalled(alpm_handle_t *handle, const alpm_depend_t *dep) in alpm_option_remove_assumeinstalled() argument
739 CHECK_HANDLE(handle, return -1); in alpm_option_remove_assumeinstalled()
741handle->assumeinstalled = alpm_list_remove(handle->assumeinstalled, dep, &assumeinstalled_cmp, (vo… in alpm_option_remove_assumeinstalled()
750 int SYMEXPORT alpm_option_set_arch(alpm_handle_t *handle, const char *arch) in alpm_option_set_arch() argument
752 CHECK_HANDLE(handle, return -1); in alpm_option_set_arch()
753 if(handle->arch) FREE(handle->arch); in alpm_option_set_arch()
754 STRDUP(handle->arch, arch, RET_ERR(handle, ALPM_ERR_MEMORY, -1)); in alpm_option_set_arch()
758 int SYMEXPORT alpm_option_set_deltaratio(alpm_handle_t *handle, double ratio) in alpm_option_set_deltaratio() argument
760 CHECK_HANDLE(handle, return -1); in alpm_option_set_deltaratio()
762 RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1); in alpm_option_set_deltaratio()
764 handle->deltaratio = ratio; in alpm_option_set_deltaratio()
768 alpm_db_t SYMEXPORT *alpm_get_localdb(alpm_handle_t *handle) in alpm_get_localdb() argument
770 CHECK_HANDLE(handle, return NULL); in alpm_get_localdb()
771 return handle->db_local; in alpm_get_localdb()
774 alpm_list_t SYMEXPORT *alpm_get_syncdbs(alpm_handle_t *handle) in alpm_get_syncdbs() argument
776 CHECK_HANDLE(handle, return NULL); in alpm_get_syncdbs()
777 return handle->dbs_sync; in alpm_get_syncdbs()
780 int SYMEXPORT alpm_option_set_checkspace(alpm_handle_t *handle, int checkspace) in alpm_option_set_checkspace() argument
782 CHECK_HANDLE(handle, return -1); in alpm_option_set_checkspace()
783 handle->checkspace = checkspace; in alpm_option_set_checkspace()
787 int SYMEXPORT alpm_option_set_dbext(alpm_handle_t *handle, const char *dbext) in alpm_option_set_dbext() argument
789 CHECK_HANDLE(handle, return -1); in alpm_option_set_dbext()
790 ASSERT(dbext, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); in alpm_option_set_dbext()
792 if(handle->dbext) { in alpm_option_set_dbext()
793 FREE(handle->dbext); in alpm_option_set_dbext()
796 STRDUP(handle->dbext, dbext, RET_ERR(handle, ALPM_ERR_MEMORY, -1)); in alpm_option_set_dbext()
798 _alpm_log(handle, ALPM_LOG_DEBUG, "option 'dbext' = %s\n", handle->dbext); in alpm_option_set_dbext()
802 int SYMEXPORT alpm_option_set_default_siglevel(alpm_handle_t *handle, in alpm_option_set_default_siglevel() argument
805 CHECK_HANDLE(handle, return -1); in alpm_option_set_default_siglevel()
807 handle->siglevel = level; in alpm_option_set_default_siglevel()
810 RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1); in alpm_option_set_default_siglevel()
816 int SYMEXPORT alpm_option_get_default_siglevel(alpm_handle_t *handle) in alpm_option_get_default_siglevel() argument
818 CHECK_HANDLE(handle, return -1); in alpm_option_get_default_siglevel()
819 return handle->siglevel; in alpm_option_get_default_siglevel()
822 int SYMEXPORT alpm_option_set_local_file_siglevel(alpm_handle_t *handle, in alpm_option_set_local_file_siglevel() argument
825 CHECK_HANDLE(handle, return -1); in alpm_option_set_local_file_siglevel()
827 handle->localfilesiglevel = level; in alpm_option_set_local_file_siglevel()
830 RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1); in alpm_option_set_local_file_siglevel()
836 int SYMEXPORT alpm_option_get_local_file_siglevel(alpm_handle_t *handle) in alpm_option_get_local_file_siglevel() argument
838 CHECK_HANDLE(handle, return -1); in alpm_option_get_local_file_siglevel()
839 if(handle->localfilesiglevel & ALPM_SIG_USE_DEFAULT) { in alpm_option_get_local_file_siglevel()
840 return handle->siglevel; in alpm_option_get_local_file_siglevel()
842 return handle->localfilesiglevel; in alpm_option_get_local_file_siglevel()
846 int SYMEXPORT alpm_option_set_remote_file_siglevel(alpm_handle_t *handle, in alpm_option_set_remote_file_siglevel() argument
849 CHECK_HANDLE(handle, return -1); in alpm_option_set_remote_file_siglevel()
851 handle->remotefilesiglevel = level; in alpm_option_set_remote_file_siglevel()
854 RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1); in alpm_option_set_remote_file_siglevel()
860 int SYMEXPORT alpm_option_get_remote_file_siglevel(alpm_handle_t *handle) in alpm_option_get_remote_file_siglevel() argument
862 CHECK_HANDLE(handle, return -1); in alpm_option_get_remote_file_siglevel()
863 if(handle->remotefilesiglevel & ALPM_SIG_USE_DEFAULT) { in alpm_option_get_remote_file_siglevel()
864 return handle->siglevel; in alpm_option_get_remote_file_siglevel()
866 return handle->remotefilesiglevel; in alpm_option_get_remote_file_siglevel()
870 int SYMEXPORT alpm_option_set_disable_dl_timeout(alpm_handle_t *handle, in alpm_option_set_disable_dl_timeout() argument
873 CHECK_HANDLE(handle, return -1); in alpm_option_set_disable_dl_timeout()
875 handle->disable_dl_timeout = disable_dl_timeout; in alpm_option_set_disable_dl_timeout()