new: add support for previous lists for the resolve function

This commit is contained in:
ngn 2024-07-16 20:08:59 +03:00
parent 1e9b494c68
commit d261d99422
3 changed files with 7 additions and 6 deletions

View File

@ -68,8 +68,7 @@ void lm_ctx_free(lm_ctx_t *ctx);
/* ####################
## main fucntions ##
#################### */
lm_ctx_resolve_list_t *lm_ctx_resolve(
lm_ctx_t *ctx, lm_pkg_t *pkg); // resolves a package and returns a list of packages to install
lm_ctx_resolve_list_t *lm_ctx_resolve(lm_ctx_t *ctx, lm_pkg_t *pkg, lm_ctx_resolve_list_t *list); // resolves a package and returns a list of packages
lm_pkg_t *lm_ctx_resolve_next(lm_ctx_resolve_list_t *list); // returns the next package in the list
void lm_ctx_resolve_free(lm_ctx_resolve_list_t *list); // frees the resolved list returned by lm_ctx_resolve

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-16 19:57+0300\n"
"POT-Creation-Date: 2024-07-16 20:08+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -45,14 +45,16 @@ end:
return true;
}
lm_ctx_resolve_list_t *lm_ctx_resolve(lm_ctx_t *ctx, lm_pkg_t *pkg){
lm_ctx_resolve_list_t *lm_ctx_resolve(lm_ctx_t *ctx, lm_pkg_t *pkg, lm_ctx_resolve_list_t *list){
if(NULL == ctx || NULL == pkg){
lm_error_set(LM_ERR_ArgNULL);
return NULL;
}
lm_ctx_resolve_list_t *list = malloc(sizeof(lm_ctx_resolve_list_t));
bzero(list, sizeof(lm_ctx_resolve_list_t));
if(NULL == list){
list = malloc(sizeof(lm_ctx_resolve_list_t));
bzero(list, sizeof(lm_ctx_resolve_list_t));
}
if(!__lm_ctx_resolve(ctx, list, pkg)){
pkglist_free(list->resolving);