]> pd.if.org Git - zpackage/blob - zpm-addfile.c
large commit of C work
[zpackage] / zpm-addfile.c
1 #include <stdio.h>
2 #include "zpm.h"
3
4 int main(int ac, char **av){
5         struct zpm pkg;
6         char hash[65];
7
8         if (ac < 3) {
9                 fprintf(stderr, "usage: db path\n");
10                 return 1;
11         }
12         zpm_open(&pkg, av[1]);
13         zpm_begin(&pkg);
14         zpm_import(&pkg, av[2], 0, hash);
15         zpm_commit(&pkg);
16         zpm_close(&pkg);
17         //fprintf(stdout, "%s %s\n", hash, av[2]);
18         fprintf(stdout, "%s\n", hash);
19         return 0;
20 }