summaryrefslogtreecommitdiff
path: root/lib/libalpm/alpm.h
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-03 15:24:01 -0500
committerDan McGee <dan@archlinux.org>2011-06-07 11:37:05 -0500
commitfb4b422fc4567238332050b9a6c8c1cac2a8f091 (patch)
tree047457f6cadf5493406b0ca4fa8c60230481d92d /lib/libalpm/alpm.h
parent992fa50dfd4faba93e37364bded015ea04d1fe15 (diff)
New signatures for alpm initialize and release
These new method signatures return and take handle objects to operate on so we can move away from the idea of one global handle in the API. There is also another important change and that deals with the setting of root and dbpaths. These are now done at initialization time instead of using setter methods. This allows the library to operate more safely knowing that paths won't change underneath it. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/alpm.h')
-rw-r--r--lib/libalpm/alpm.h36
1 files changed, 12 insertions, 24 deletions
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index bc06cc09..ee55d0b9 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -86,14 +86,6 @@ typedef struct __pmconflict_t pmconflict_t;
typedef struct __pmfileconflict_t pmfileconflict_t;
/*
- * Library
- */
-
-int alpm_initialize(void);
-int alpm_release(void);
-const char *alpm_version(void);
-
-/*
* Logging facilities
*/
@@ -165,15 +157,14 @@ alpm_cb_totaldl alpm_option_get_totaldlcb(void);
/** Sets the callback used to report total download size. */
int alpm_option_set_totaldlcb(alpm_cb_totaldl cb);
-/** Returns the root of the destination filesystem. */
+/** Returns the root of the destination filesystem. Read-only. */
const char *alpm_option_get_root(void);
-/** Sets the root of the destination filesystem. */
-int alpm_option_set_root(const char *root);
-/** Returns the path to the database directory. */
+/** Returns the path to the database directory. Read-only. */
const char *alpm_option_get_dbpath(void);
-/** Sets the path to the database directory. */
-int alpm_option_set_dbpath(const char *dbpath);
+
+/** Get the name of the database lock file. Read-only. */
+const char *alpm_option_get_lockfile(void);
/** @name Accessors to the list of package cache directories.
* @{
@@ -189,15 +180,6 @@ const char *alpm_option_get_logfile(void);
/** Sets the logfile name. */
int alpm_option_set_logfile(const char *logfile);
-/** Get the name of the database lock file.
- *
- * This properly is read-only, and determined from
- * the database path.
- *
- * @sa alpm_option_set_dbpath(const char*)
- */
-const char *alpm_option_get_lockfile(void);
-
/** Returns the signature directory path. */
const char *alpm_option_get_signaturedir(void);
/** Sets the signature directory path. */
@@ -302,9 +284,10 @@ pmdb_t *alpm_db_register_sync(const char *treename);
int alpm_db_unregister(pmdb_t *db);
/** Unregister all package databases.
+ * @param handle the context handle
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_db_unregister_all(void);
+int alpm_db_unregister_all(pmhandle_t *handle);
/** Get the name of a package database.
* @param db pointer to the package database
@@ -1054,6 +1037,11 @@ const char *alpm_strerrorlast(void);
/* End of alpm_api_errors */
/** @} */
+pmhandle_t *alpm_initialize(const char *root, const char *dbpath,
+ enum _pmerrno_t *err);
+int alpm_release(pmhandle_t *handle);
+const char *alpm_version(void);
+
/* End of alpm_api */
/** @} */