update: example programs

This commit is contained in:
ngn 2024-08-04 16:00:18 +03:00
parent 61ab7f66ac
commit bb1f5a61b2
7 changed files with 7 additions and 7 deletions

View File

@ -1,5 +1,5 @@
# libmp | MatterLinux package management library # libmp | MatterLinux package management library
The core library for [`mp`](https://git.matterlinux.xyz/Matter/mp), it has The core library for [`matt`](https://git.matterlinux.xyz/Matter/matt), it has
components for transferring, installing, updating and removing packages. components for transferring, installing, updating and removing packages.
### Installation ### Installation

View File

@ -17,7 +17,7 @@ int main(int argc, char *argv[]) {
lm_entry_init(&entry); lm_entry_init(&entry);
if (!lm_ctx_init(&ctx, ROOT_DIR, NULL, DATA_DIR)) { if (!lm_ctx_new(&ctx, ROOT_DIR, NULL, DATA_DIR)) {
printf("failed to init the ctx: %s (%d)\n", lm_strerror(), lm_error()); printf("failed to init the ctx: %s (%d)\n", lm_strerror(), lm_error());
goto end; goto end;
} }

View File

@ -19,7 +19,7 @@ int main(int argc, char *argv[]) {
return ret; return ret;
} }
if (!lm_ctx_init(&ctx, ROOT_DIR, TEMP_DIR, DATA_DIR)) { if (!lm_ctx_new(&ctx, ROOT_DIR, TEMP_DIR, DATA_DIR)) {
printf("failed to init the ctx: %s (%d)\n", lm_strerror(), lm_error()); printf("failed to init the ctx: %s (%d)\n", lm_strerror(), lm_error());
goto end; goto end;
} }

View File

@ -12,7 +12,7 @@ int main(int argc, char *argv[]) {
lm_entry_init(&entry); lm_entry_init(&entry);
if (!lm_ctx_init(&ctx, NULL, NULL, DATA_DIR)) { if (!lm_ctx_new(&ctx, NULL, NULL, DATA_DIR)) {
printf("failed to set data dir: %s (%d)\n", lm_strerror(), lm_error()); printf("failed to set data dir: %s (%d)\n", lm_strerror(), lm_error());
goto end; goto end;
} }

View File

@ -17,7 +17,7 @@ int main(int argc, char *argv[]) {
return ret; return ret;
} }
if (!lm_ctx_init(&ctx, ROOT_DIR, TEMP_DIR, DATA_DIR)) { if (!lm_ctx_new(&ctx, ROOT_DIR, TEMP_DIR, DATA_DIR)) {
printf("failed to init the ctx: %s (%d)\n", lm_strerror(), lm_error()); printf("failed to init the ctx: %s (%d)\n", lm_strerror(), lm_error());
goto end; goto end;
} }

View File

@ -20,7 +20,7 @@ int main(int argc, char *argv[]) {
char pooldir[strlen(TEMP_DIR) + 10]; char pooldir[strlen(TEMP_DIR) + 10];
sprintf(pooldir, "%s/%s", DATA_DIR, "pool"); sprintf(pooldir, "%s/%s", DATA_DIR, "pool");
if (!lm_ctx_init(&ctx, ROOT_DIR, TEMP_DIR, DATA_DIR)) { if (!lm_ctx_new(&ctx, ROOT_DIR, TEMP_DIR, DATA_DIR)) {
printf("failed to init the ctx: %s (%d)\n", lm_strerror(), lm_error()); printf("failed to init the ctx: %s (%d)\n", lm_strerror(), lm_error());
goto end; goto end;
} }

View File

@ -14,7 +14,7 @@ int main(int argc, char *argv[]) {
return ret; return ret;
} }
if (!lm_ctx_init(&ctx, NULL, TEMP_DIR, NULL)) { if (!lm_ctx_new(&ctx, NULL, TEMP_DIR, NULL)) {
printf("failed to init the ctx: %s (%d)\n", lm_strerror(), lm_error()); printf("failed to init the ctx: %s (%d)\n", lm_strerror(), lm_error());
goto end; goto end;
} }