]> pd.if.org Git - zpackage/blob - zpm-init.c
fix compile process for elf programs
[zpackage] / zpm-init.c
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include "zpm.h"
4
5 int main(int ac, char **av){
6         struct zpm pkg;
7         int rv;
8         char *path;
9
10         path = getenv("ZPMDB");
11
12         if (ac > 1) {
13                 path = av[1];
14         }
15
16         if (!path) {
17                 fprintf(stderr, "usage: zpm-init [path]\n");
18                 return 1;
19         }
20         rv = zpm_init(&pkg, path);
21         if (rv) {
22                 zpm_close(&pkg);
23         }
24
25         return rv ? 0 : 1;
26 }