X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=src%2Finit.c;fp=src%2Finit.c;h=9a0f839f0ee11c8703e623805d754ff858d71a68;hb=5dd3c3e64a9574112dda77a5afc167f5daa53fd8;hp=0000000000000000000000000000000000000000;hpb=bd21f0a1265b43ad5f05353a39db31c16826f05c;p=zpackage diff --git a/src/init.c b/src/init.c new file mode 100644 index 0000000..9a0f839 --- /dev/null +++ b/src/init.c @@ -0,0 +1,26 @@ +#include +#include +#include "zpm.h" + +int main(int ac, char **av){ + struct zpm pkg; + int rv; + char *path; + + path = getenv("ZPMDB"); + + if (ac > 1) { + path = av[1]; + } + + if (!path) { + fprintf(stderr, "usage: zpm-init [path]\n"); + return 1; + } + rv = zpm_init(&pkg, path); + if (rv) { + zpm_close(&pkg); + } + + return rv ? 0 : 1; +}