MPORT(3) | MidnightBSD Library Functions Manual | MPORT(3) |
mport_clean_database
,
mport_clean_oldpackages
,
mport_create_primative
,
mport_delete_primative
,
mport_download
,
mport_err_code
,
mport_err_string
,
mport_index_load
,
mport_index_lookup_pkgname
,
mport_index_search
,
mport_index_entry_free_vec
,
mport_index_entry_free
,
mport_install
,
mport_install_primative
,
mport_instance_free
,
mport_instance_init
,
mport_instance_new
,
mport_set_msg_cb
,
mport_set_progress_init_cb
,
mport_set_progress_step_cb
,
mport_set_progress_free_cb
,
mport_set_confirm_cb
,
mport_stats
,
mport_stats_free
,
mport_stats_new
,
mport_merge_primative
,
mport_pkgmeta_new
,
mport_pkgmeta_free
,
mport_pkgmeta_vec_free
,
mport_pkgmeta_search_master
,
mport_pkgmeta_list
,
mport_pkgmeta_get_downdepends
,
mport_pkgmeta_get_updepends
,
mport_assetlist_new
,
mport_assetlist_free
,
mport_parse_plistfile
,
mport_settings_get
,
mport_settings_set
,
mport_update_primative
,
mport_createextras_new
,
mport_createextras_free
,
mport_verify_hash
,
mport_file_exists
,
mport_verify_package
,
mport_version_cmp
,
mport_lock_lock
,
mport_lock_unlock
,
mport_lock_islocked
, — mport
package functions
library “libmport”
#include <mport.h>
#include <mport_private.h>
int
mport_clean_database
(mportInstance
*mport);
int
mport_clean_oldpackages
(mportInstance
*mport);
int
mport_create_primative
(mportAssetList
*assetlist,
mportPackageMeta *pack,
mportCreateExtras
*extra);
int
mport_delete_primative
(mportInstance
*mport, mportPackageMeta
*pack, int
force);
int
mport_download
(mportInstance
*mport, const char
*pkgname, bool
includeDependencies, char
**path);
int
mport_err_code
();
const char *
mport_err_string
();
int
mport_index_load
(mportInstance
*mport);
int
mport_index_lookup_pkgname
(mportInstance
*mport, const char
*pkgname, mportIndexEntry
***entry_vec);
int
mport_index_search
(mportInstance
*mport, mportIndexEntry
***entry_vec, const char
*fmt, ...);
void
mport_index_entry_free_vec
(mportIndexEntry
**e);
void
mport_index_entry_free
(mportIndexEntry
*e);
int
mport_install
(mportInstance
*mport, const char
*pkgname, const char
*version, const char
*prefix);
int
mport_install_primative
(mportInstance
*mport, const char
*filename, const char
*prefix);
int
mport_instance_free
(mportInstance
*mport);
int
mport_instance_init
(mportInstance
*mport, const char
*root, const char
*outputPath, bool
noIndex);
mportInstance *
mport_instance_new
();
void
mport_set_msg_cb
(mportInstance
*, mport_msg_cb
cb);
void
mport_set_progress_init_cb
(mportInstance
*mport,
mport_progress_init_cb
cb);
void
mport_set_progress_step_cb
(mportInstance
*mport,
mport_progress_step_cb
cb);
void
mport_set_progress_free_cb
(mportInstance
*mport,
mport_progress_free_cb
cb);
void
mport_set_confirm_cb
(mportInstance
*mport, mport_confirm_cb
cb);
int
mport_stats
(mportInstance
*mport, mportStats
**stats);
int
mport_stats_free
(mportStats
*stats);
mportStats *
mport_stats_new
();
int
mport_merge_primative
(const
char **filenames, const
char *outfile);
mportPackageMeta *
mport_pkgmeta_new
();
void
mport_pkgmeta_free
(mportPackageMeta
*pack);
void
mport_pkgmeta_vec_free
(mportPackageMeta
**vec);
int
mport_pkgmeta_search_master
(mportInstance
*mport, mportPackageMeta
***ref, const char
*fmt, ...);
int
mport_pkgmeta_list
(mportInstance
*mport, mportPackageMeta
***ref);
int
mport_pkgmeta_get_downdepends
(mportInstance
*mport, mportPackageMeta
*pkg, mportPackageMeta
***pkg_vec_p);
int
mport_pkgmeta_get_updepends
(mportInstance
*mport, mportPackageMeta
*pkg, mportPackageMeta
***pkg_vec_p);
mportAssetList *
mport_assetlist_new
();
void
mport_assetlist_free
(mportAssetList
*list);
int
mport_parse_plistfile
(FILE
*fp, mportAssetList
*list);
char *
mport_settings_get
(mportInstance
*mport, const char
*name);
int
mport_settings_set
(mportInstance
*mport, const char
*name, const char
*val);
int
mport_update_primative
(mportInstance
*mport, const char
*filename);
mportCreateExtras *
mport_createextras_new
();
void
mport_createextras_free
(mportCreateExtras
*extra);
int
mport_verify_hash
(const
char *filename, const
char *hash);
int
mport_file_exists
(const
char *file);
int
mport_verify_package
(mportInstance
*mport, mportPackageMeta
*pack);
int
mport_version_cmp
(const
char *astr, const char
*bstr);
int
mport_lock_lock
(mportInstance
*mport, mportPackageMeta
*pkg);
int
mport_lock_unlock
(mportInstance
*mport, mportPackageMeta
*pkg);
int
mport_lock_islocked
(mportPackageMeta
*pkg);
These functions implement a package management library for creating, removing, and installing packages.
At a minimum, one must call
mport_instance_new
()
and
mport_instance_init
()
to initialize the library. This will create a master.db file if one does not
exist.
At the end of the program, one must call
mport_instance_free
()
to close the master.db and cleanup any other resources.
The following error codes are defined in
<mport.h>
:
MPORT_OK
]MPORT_ERR_FATAL
]MPORT_ERR_WARN
]FETCH_BIND_ADDRESS
FTP_LOGIN
FTP_PASSIVE_MODE
no
’, forces the FTP code
to use active mode. If set to any other value, forces passive mode even if
the application requested active mode.FTP_PASSWORD
FTP_PROXY
ASSUME_ALWAYS_YES
The mport
library first appeared in
The mport
library was mostly written by
Chris Reinhardt
⟨ctriv@MidnightBSD.org⟩ with numerous suggestions and
contributions from Lucas Holt
⟨luke@MidnightBSD.org⟩,
This manual page was written by Lucas Holt ⟨luke@MidnightBSD.org⟩.
Some parts of the library are not yet implemented.
October 24, 2022 | midnightbsd-3.1 |