libalpm_cb(3)
π libalpm_cb(3) β Callbacks π
Library Functions Manual Β· libalpm callback zone, bestie π«Ά
β¨ NAME β¨
libalpm_cb β Callbacks
Functions and structures for libalpm's callbacks. π
π¦ SYNOPSIS π¦
πΈ Data Structures πΈ
struct alpm_event_any_tβ An event that may represent any event. β¨struct alpm_event_package_operation_tβ A package operation event occurred. π₯struct alpm_event_optdep_removal_tβ An optional dependency was removed. π«Άstruct alpm_event_scriptlet_info_tβ A scriptlet was ran. πstruct alpm_event_database_missing_tβ A database is missing. π«struct alpm_event_pkgdownload_tβ A package was downloaded. π₯struct alpm_event_pacnew_created_tβ A pacnew file was created. πstruct alpm_event_pacsave_created_tβ A pacsave file was created. πstruct alpm_event_hook_tβ pre/post transaction hooks are to be ran. πͺstruct alpm_event_hook_run_tβ A pre/post transaction hook was ran. πstruct alpm_event_pkg_retrieve_tβ Packages downloading about to start. πunion alpm_event_tβ Events. πstruct alpm_question_any_tβ A question that can represent any other question. βstruct alpm_question_install_ignorepkg_tβ Should target in ignorepkg be installed anyway? π€struct alpm_question_replace_tβ Should a package be replaced? πstruct alpm_question_conflict_tβ Should a conflicting package be removed? βοΈstruct alpm_question_corrupted_tβ Should a corrupted package be deleted? ποΈstruct alpm_question_remove_pkgs_tβ Should unresolvable targets be removed from the transaction? π§Ήstruct alpm_question_select_provider_tβ Provider selection. π―struct alpm_question_import_key_tβ Should a key be imported? πunion alpm_question_tβ Questions. βstruct alpm_download_event_init_tβ Context struct for when a download starts. β¬οΈstruct alpm_download_event_progress_tβ Context struct for when a download progresses. πstruct alpm_download_event_retry_tβ Context struct for when a download retries. πstruct alpm_download_event_completed_tβ Context struct for when a download completes. β
π Typedefs π
alpm_cb_eventβ Event callback. π
typedef void(* alpm_cb_event) (void *ctx, alpm_event_t *event)
alpm_cb_questionβ Question callback. β
typedef void(* alpm_cb_question) (void *ctx, alpm_question_t *question)
alpm_cb_progressβ Progress callback. π
typedef void(* alpm_cb_progress) (void *ctx, alpm_progress_t progress,
const char *pkg, int percent, size_t howmany, size_t current)
alpm_cb_downloadβ Type of download progress callbacks. β¬οΈ
typedef void(* alpm_cb_download) (void *ctx, const char *filename,
alpm_download_event_type_t event, void *data)
alpm_cb_fetchβ A callback for downloading files. π₯
typedef int(* alpm_cb_fetch) (void *ctx, const char *url, const char
*localpath, int force)
π Enumerations π
enum alpm_event_type_tβ Type of events. π₯
enum alpm_event_type_t { ALPM_EVENT_CHECKDEPS_START = 1,
ALPM_EVENT_CHECKDEPS_DONE, ALPM_EVENT_FILECONFLICTS_START,
ALPM_EVENT_FILECONFLICTS_DONE, ALPM_EVENT_RESOLVEDEPS_START,
ALPM_EVENT_RESOLVEDEPS_DONE, ALPM_EVENT_INTERCONFLICTS_START,
ALPM_EVENT_INTERCONFLICTS_DONE, ALPM_EVENT_TRANSACTION_START,
ALPM_EVENT_TRANSACTION_DONE, ALPM_EVENT_PACKAGE_OPERATION_START,
ALPM_EVENT_PACKAGE_OPERATION_DONE, ALPM_EVENT_INTEGRITY_START,
ALPM_EVENT_INTEGRITY_DONE, ALPM_EVENT_LOAD_START,
ALPM_EVENT_LOAD_DONE, ALPM_EVENT_SCRIPTLET_INFO,
ALPM_EVENT_DB_RETRIEVE_START, ALPM_EVENT_DB_RETRIEVE_DONE,
ALPM_EVENT_DB_RETRIEVE_FAILED, ALPM_EVENT_PKG_RETRIEVE_START,
ALPM_EVENT_PKG_RETRIEVE_DONE, ALPM_EVENT_PKG_RETRIEVE_FAILED,
ALPM_EVENT_DISKSPACE_START, ALPM_EVENT_DISKSPACE_DONE,
ALPM_EVENT_OPTDEP_REMOVAL, ALPM_EVENT_DATABASE_MISSING,
ALPM_EVENT_KEYRING_START, ALPM_EVENT_KEYRING_DONE,
ALPM_EVENT_KEY_DOWNLOAD_START, ALPM_EVENT_KEY_DOWNLOAD_DONE,
ALPM_EVENT_PACNEW_CREATED, ALPM_EVENT_PACSAVE_CREATED,
ALPM_EVENT_HOOK_START, ALPM_EVENT_HOOK_DONE,
ALPM_EVENT_HOOK_RUN_START, ALPM_EVENT_HOOK_RUN_DONE }
enum alpm_package_operation_tβ An enum over the kind of package operations. βοΈ
enum alpm_package_operation_t { ALPM_PACKAGE_INSTALL = 1,
ALPM_PACKAGE_UPGRADE, ALPM_PACKAGE_REINSTALL,
ALPM_PACKAGE_DOWNGRADE, ALPM_PACKAGE_REMOVE }
enum alpm_hook_when_tβ Kind of hook. πͺ
enum alpm_hook_when_t { ALPM_HOOK_PRE_TRANSACTION = 1,
ALPM_HOOK_POST_TRANSACTION }
enum alpm_question_type_tβ Type of question. β
enum alpm_question_type_t { ALPM_QUESTION_INSTALL_IGNOREPKG = (1 << 0),
ALPM_QUESTION_REPLACE_PKG = (1 << 1), ALPM_QUESTION_CONFLICT_PKG =
(1 << 2), ALPM_QUESTION_CORRUPTED_PKG = (1 << 3),
ALPM_QUESTION_REMOVE_PKGS = (1 << 4), ALPM_QUESTION_SELECT_PROVIDER
= (1 << 5), ALPM_QUESTION_IMPORT_KEY = (1 << 6) }
enum alpm_progress_tβ An enum over different kinds of progress alerts. π
enum alpm_progress_t { ALPM_PROGRESS_ADD_START,
ALPM_PROGRESS_UPGRADE_START, ALPM_PROGRESS_DOWNGRADE_START,
ALPM_PROGRESS_REINSTALL_START, ALPM_PROGRESS_REMOVE_START,
ALPM_PROGRESS_CONFLICTS_START, ALPM_PROGRESS_DISKSPACE_START,
ALPM_PROGRESS_INTEGRITY_START, ALPM_PROGRESS_LOAD_START,
ALPM_PROGRESS_KEYRING_START }
enum alpm_download_event_type_tβ File download events. π₯
enum alpm_download_event_type_t { ALPM_DOWNLOAD_INIT,
ALPM_DOWNLOAD_PROGRESS, ALPM_DOWNLOAD_RETRY, ALPM_DOWNLOAD_COMPLETED
}
π Detailed Description π
Functions and structures for libalpm's callbacks. π
π§ Data Structure Documentation π§
struct alpm_event_any_t
An event that may represent any event. β¨
Data Fields:
alpm_event_type_t typeβ Type of event. π
struct alpm_event_package_operation_t
A package operation event occurred. π₯
Data Fields:
alpm_pkg_t * newpkgβ New package. πalpm_pkg_t * oldpkgβ Old package. ποΈalpm_package_operation_t operationβ Type of operation. βοΈalpm_event_type_t typeβ Type of event. π
struct alpm_event_optdep_removal_t
An optional dependency was removed. π«Ά
Data Fields:
alpm_depend_t * optdepβ Optdep being removed. βοΈalpm_pkg_t * pkgβ Package with the optdep. π¦alpm_event_type_t typeβ Type of event. π
struct alpm_event_scriptlet_info_t
A scriptlet was ran. π
Data Fields:
const char * lineβ Line of scriptlet output. π¨οΈalpm_event_type_t typeβ Type of event. π
struct alpm_event_database_missing_t
A database is missing. π«
The database is registered but has not been downloaded. π
Data Fields:
const char * dbnameβ Name of the database. ποΈalpm_event_type_t typeβ Type of event. π
struct alpm_event_pkgdownload_t
A package was downloaded. π₯
Data Fields:
const char * fileβ Name of the file. πalpm_event_type_t typeβ Type of event. π
struct alpm_event_pacnew_created_t
A pacnew file was created. π
Data Fields:
const char * fileβ Filename of the file without the.pacnewsuffix. π·οΈint from_noupgradeβ Whether the creation was result of a NoUpgrade or not. βalpm_pkg_t * newpkgβ New Package. πalpm_pkg_t * oldpkgβ Old package. ποΈalpm_event_type_t typeβ Type of event. π
struct alpm_event_pacsave_created_t
A pacsave file was created. π
Data Fields:
const char * fileβ Filename of the file without the.pacsavesuffix. π·οΈalpm_pkg_t * oldpkgβ Old package. ποΈalpm_event_type_t typeβ Type of event. π
struct alpm_event_hook_t
pre/post transaction hooks are to be ran. πͺ
Data Fields:
alpm_event_type_t typeβ Type of event. πalpm_hook_when_t whenβ Type of hook. β°
struct alpm_event_hook_run_t
A pre/post transaction hook was ran. π
Data Fields:
const char * descβ Description of hook to be outputted. πconst char * nameβ Name of hook. π·οΈsize_t positionβ position of hook being run. πsize_t totalβ total hooks being run. π’alpm_event_type_t typeβ Type of event. π
struct alpm_event_pkg_retrieve_t
Packages downloading about to start. π
Data Fields:
size_t numβ Number of packages to download. π’off_t total_sizeβ Total size of packages to download. π¦alpm_event_type_t typeβ Type of event. π
union alpm_event_t
Events. π
This is a union passed to the callback that allows the frontend to know which type of event was triggered (via type). It is then possible to typecast the pointer to the right structure, or use the union field, in order to access event-specific data. π§
Data Fields:
alpm_event_any_t anyβ The any event type. It's always safe to access this. π‘οΈalpm_event_database_missing_t database_missingβ A database is missing. π«alpm_event_hook_t hookβ Pre/post transaction hooks are being ran. πͺalpm_event_hook_run_t hook_runβ A hook was ran. πalpm_event_optdep_removal_t optdep_removalβ An optdep was removed. βοΈalpm_event_package_operation_t package_operationβ Package operation. βοΈalpm_event_pacnew_created_t pacnew_createdβ A pacnew file was created. πalpm_event_pacsave_created_t pacsave_createdβ A pacsave file was created. πalpm_event_pkg_retrieve_t pkg_retrieveβ Download packages. π₯alpm_event_pkgdownload_t pkgdownloadβ A package was downloaded. π₯alpm_event_scriptlet_info_t scriptlet_infoβ A scriptlet was ran. πalpm_event_type_t typeβ Type of event it's always safe to access this. π
struct alpm_question_any_t
A question that can represent any other question. β
Data Fields:
int answerβ Answer. βalpm_question_type_t typeβ Type of question. π
struct alpm_question_install_ignorepkg_t
Should target in ignorepkg be installed anyway? π€
Data Fields:
int installβ Answer: whether or not to install pkg anyway. βalpm_pkg_t * pkgβ The ignored package that we are deciding whether to install. π¦alpm_question_type_t typeβ Type of question. π
struct alpm_question_replace_t
Should a package be replaced? π
Data Fields:
alpm_db_t * newdbβ DB of newpkg. ποΈalpm_pkg_t * newpkgβ Package to replace with. πalpm_pkg_t * oldpkgβ Package to be replaced. ποΈint replaceβ Answer: whether or not to replace oldpkg with newpkg. βalpm_question_type_t typeβ Type of question. π
struct alpm_question_conflict_t
Should a conflicting package be removed? βοΈ
Data Fields:
alpm_conflict_t * conflictβ Conflict info. π₯int removeβ Answer: whether or not to removeconflict->package2. βalpm_question_type_t typeβ Type of question. π
struct alpm_question_corrupted_t
Should a corrupted package be deleted? ποΈ
Data Fields:
const char * filepathβ File to remove. πalpm_errno_t reasonβ Error code indicating the reason for package invalidity. β οΈint removeβ Answer: whether or not to remove filepath. βalpm_question_type_t typeβ Type of question. π
struct alpm_question_remove_pkgs_t
Should unresolvable targets be removed from the transaction? π§Ή
Data Fields:
alpm_list_t * packagesβ List ofalpm_pkg_t*with unresolved dependencies. πint skipβ Answer: whether or not to skip packages. βalpm_question_type_t typeβ Type of question. π
π¦ struct alpm_question_select_provider_t π¦
Provider selection.
Data Fields β¨
alpm_depend_t * dependβ what providers provide for.alpm_list_t * providersβ list ofalpm_pkg_t*as possible providers.alpm_question_type_t typeβ type of question.int use_indexβ answer: which provider to use (index fromproviders).
π struct alpm_question_import_key_t π
Should a key be imported?
Data Fields β¨
const char * fingerprintβ fingerprint the key to import.int importβ answer: whether or not to import key.alpm_question_type_t typeβ type of question.const char * uidβ UID of the key to import.
π union alpm_question_t π
Questions.
This is an union passed to the callback that allows the frontend to know which type of question was triggered (via type). It is then possible to typecast the pointer to the right structure, or use the union field, in order to access question-specific data.
Data Fields β¨
alpm_question_any_t anyβ a question that can represent any question. It's always safe to access this.alpm_question_conflict_t conflictβ should a conflicting package be removed?alpm_question_corrupted_t corruptedβ should a corrupted package be deleted?alpm_question_import_key_t import_keyβ should a key be imported?alpm_question_install_ignorepkg_t install_ignorepkgβ should target in ignorepkg be installed anyway?alpm_question_remove_pkgs_t remove_pkgsβ should unresolvable targets be removed from the transaction?alpm_question_replace_t replaceβ should a package be replaced?alpm_question_select_provider_t select_providerβ provider selection.alpm_question_type_t typeβ the type of question. It's always safe to access this.
π struct alpm_download_event_init_t π
Context struct for when a download starts.
Data Fields β¨
int optionalβ whether this file is optional and thus the errors could be ignored.
π struct alpm_download_event_progress_t π
Context struct for when a download progresses.
Data Fields β¨
off_t downloadedβ amount of data downloaded.off_t totalβ total amount need to be downloaded.
π struct alpm_download_event_retry_t π
Context struct for when a download retries.
Data Fields β¨
int resumeβ if the download will resume or start over.
β struct alpm_download_event_completed_t β
Context struct for when a download completes.
Data Fields β¨
int resultβ download result code:0- download completed successfully,1- the file is up-to-date,-1- error.off_t totalβ total bytes in file.
π Typedef Documentation π
typedef void(* alpm_cb_download) (void *ctx, const char *filename, alpm_download_event_type_t event, void *data)
Type of download progress callbacks.
Parameters
ctxβ user-provided contextfilenameβ the name of the file being downloadedeventβ the event typedataβ the event data of typealpm_download_event_*_t
typedef void(* alpm_cb_event) (void *ctx, alpm_event_t *event)
Event callback. Called when an event occurs.
Parameters
ctxβ user-provided contexteventβ the event that occurred
typedef int(* alpm_cb_fetch) (void *ctx, const char *url, const char *localpath, int force)
A callback for downloading files.
Parameters
ctxβ user-provided contexturlβ the URL of the file to be downloadedlocalpathβ the directory to which the file should be downloadedforceβ whether to force an update, even if the file is the same
Returns 0 on success, 1 if the file exists and is identical, -1 on error.
typedef void(* alpm_cb_progress) (void *ctx, alpm_progress_t progress, const char *pkg, int percent, size_t howmany, size_t current)
Progress callback. Alert the front end about the progress of certain events. Allows the implementation of loading bars for events that make take a while to complete.
Parameters
ctxβ user-provided contextprogressβ the kind of event that is progressingpkgβ for package operations, the name of the package being operated onpercentβ the percent completion of the actionhowmanyβ the total amount of items in the actioncurrentβ the current amount of items completed. Progress callback
typedef void(* alpm_cb_question) (void *ctx, alpm_question_t *question)
Question callback. This callback allows user to give input and decide what to do during certain events.
Parameters
ctxβ user-provided contextquestionβ the question being asked.
π Enumeration Type Documentation π
enum alpm_download_event_type_t
File download events. These events are reported by ALPM via download callback.
Enumerator
ALPM_DOWNLOAD_INITβ A download was started.ALPM_DOWNLOAD_PROGRESSβ A download made progress.ALPM_DOWNLOAD_RETRYβ Download will be retried.ALPM_DOWNLOAD_COMPLETEDβ A download completed.
enum alpm_event_type_t
Type of events.
Enumerator
ALPM_EVENT_CHECKDEPS_STARTβ Dependencies will be computed for a package.ALPM_EVENT_CHECKDEPS_DONEβ Dependencies were computed for a package.ALPM_EVENT_FILECONFLICTS_STARTβ File conflicts will be computed for a package.ALPM_EVENT_FILECONFLICTS_DONEβ File conflicts were computed for a package.ALPM_EVENT_RESOLVEDEPS_STARTβ Dependencies will be resolved for target package.ALPM_EVENT_RESOLVEDEPS_DONEβ Dependencies were resolved for target package.ALPM_EVENT_INTERCONFLICTS_STARTβ Inter-conflicts will be checked for target package.ALPM_EVENT_INTERCONFLICTS_DONEβ Inter-conflicts were checked for target package.ALPM_EVENT_TRANSACTION_STARTβ Processing the package transaction is starting.ALPM_EVENT_TRANSACTION_DONEβ Processing the package transaction is finished.ALPM_EVENT_PACKAGE_OPERATION_STARTβ Package will be installed/upgraded/downgraded/re-installed/removed; Seealpm_event_package_operation_tfor arguments.ALPM_EVENT_PACKAGE_OPERATION_DONEβ Package was installed/upgraded/downgraded/re-installed/removed; Seealpm_event_package_operation_tfor arguments.ALPM_EVENT_INTEGRITY_STARTβ Target package's integrity will be checked.ALPM_EVENT_INTEGRITY_DONEβ Target package's integrity was checked.ALPM_EVENT_LOAD_STARTβ Target package will be loaded.ALPM_EVENT_LOAD_DONEβ Target package is finished loading.ALPM_EVENT_SCRIPTLET_INFOβ Scriptlet has printed information; Seealpm_event_scriptlet_info_tfor arguments.ALPM_EVENT_DB_RETRIEVE_STARTβ Database files will be downloaded from a repository.ALPM_EVENT_DB_RETRIEVE_DONEβ Database files were downloaded from a repository.ALPM_EVENT_DB_RETRIEVE_FAILEDβ Not all database files were successfully downloaded from a repository.ALPM_EVENT_PKG_RETRIEVE_STARTβ Package files will be downloaded from a repository.ALPM_EVENT_PKG_RETRIEVE_DONEβ Package files were downloaded from a repository.ALPM_EVENT_PKG_RETRIEVE_FAILEDβ Not all package files were successfully downloaded from a repository.ALPM_EVENT_DISKSPACE_STARTβ Disk space usage will be computed for a package.ALPM_EVENT_DISKSPACE_DONEβ Disk space usage was computed for a package.ALPM_EVENT_OPTDEP_REMOVALβ An optdepend for another package is being removed; Seealpm_event_optdep_removal_tfor arguments.ALPM_EVENT_DATABASE_MISSINGβ A configured repository database is missing; Seealpm_event_database_missing_tfor arguments.ALPM_EVENT_KEYRING_STARTβ Checking keys used to create signatures are in keyring.ALPM_EVENT_KEYRING_DONEβ Keyring checking is finished.ALPM_EVENT_KEY_DOWNLOAD_STARTβ Downloading missing keys into keyring.ALPM_EVENT_KEY_DOWNLOAD_DONEβ Key downloading is finished.ALPM_EVENT_PACNEW_CREATEDβ A.pacnewfile was created; Seealpm_event_pacnew_created_tfor arguments.ALPM_EVENT_PACSAVE_CREATEDβ A.pacsavefile was created; Seealpm_event_pacsave_created_tfor arguments.ALPM_EVENT_HOOK_STARTβ Processing hooks will be started.ALPM_EVENT_HOOK_DONEβ Processing hooks is finished.ALPM_EVENT_HOOK_RUN_STARTβ A hook is starting.ALPM_EVENT_HOOK_RUN_DONEβ A hook has finished running.
enum alpm_hook_when_t
Kind of hook.
enum alpm_package_operation_t
An enum over the kind of package operations.
Enumerator
ALPM_PACKAGE_INSTALLβ Package (to be) installed. (No oldpkg)ALPM_PACKAGE_UPGRADEβ Package (to be) upgraded.ALPM_PACKAGE_REINSTALLβ Package (to be) re-installed.ALPM_PACKAGE_DOWNGRADEβ Package (to be) downgraded.ALPM_PACKAGE_REMOVEβ Package (to be) removed (No newpkg).
enum alpm_progress_t
An enum over different kinds of progress alerts.
Enumerator
ALPM_PROGRESS_ADD_STARTβ Package install.ALPM_PROGRESS_UPGRADE_STARTβ Package upgrade.ALPM_PROGRESS_DOWNGRADE_STARTβ Package downgrade.ALPM_PROGRESS_REINSTALL_STARTβ Package reinstall.ALPM_PROGRESS_REMOVE_STARTβ Package removal.ALPM_PROGRESS_CONFLICTS_STARTβ Conflict checking.ALPM_PROGRESS_DISKSPACE_STARTβ Diskspace checking.ALPM_PROGRESS_INTEGRITY_STARTβ Package Integrity checking.ALPM_PROGRESS_LOAD_STARTβ Loading packages from disk.ALPM_PROGRESS_KEYRING_STARTβ Checking signatures of packages.
enum alpm_question_type_t
Type of question. Unlike the events or progress enumerations, this enum has bitmask values so a frontend can use a bitmask map to supply preselected answers to the different types of questions.
Enumerator
ALPM_QUESTION_INSTALL_IGNOREPKGβ Should target in ignorepkg be installed anyway?ALPM_QUESTION_REPLACE_PKGβ Should a package be replaced?ALPM_QUESTION_CONFLICT_PKGβ Should a conflicting package be removed?ALPM_QUESTION_CORRUPTED_PKGβ Should a corrupted package be deleted?ALPM_QUESTION_REMOVE_PKGSβ Should unresolvable targets be removed from the transaction?ALPM_QUESTION_SELECT_PROVIDERβ Provider selection.ALPM_QUESTION_IMPORT_KEYβ Should a key be imported?
β¨ Author β¨
Generated automatically by Doxygen for libalpm from the source code.
And thatβs a wrap, bestie π The footer says source/version libalpm and page libalpm_cb(3) β no date on this one, so thatβs the whole vibe. Stay iconic, and go read some code. π«Άβ¨
π¦ where this page comes from
- arch rolling: pacman 7.1.0.r9.g54d9411-2
- fedora 44: libalpm-devel 7.0.0-6.fc44 Β· GPL-2.0-or-later
- fedora 44: libalpm-devel 7.0.0-6.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms