Imported Upstream version 0.6.27
[platform/upstream/libsolv.git] / tools / helix2solv.c
1 /*
2  * Copyright (c) 2007, Novell Inc.
3  *
4  * This program is licensed under the BSD license, read LICENSE.BSD
5  * for further information
6  */
7
8 /*
9  * helix2solv.c
10  * 
11  * parse 'helix' type xml and write out .solv file
12  *
13  * reads from stdin
14  * writes to stdout
15  */
16
17 #include <sys/types.h>
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <string.h>
21
22 #include "pool.h"
23 #include "repo_helix.h"
24 #include "common_write.h"
25
26 int
27 main(int argc, char **argv)
28 {
29   Pool *pool = pool_create();
30   Repo *repo = repo_create(pool, "<stdin>");
31   if (repo_add_helix(repo, stdin, 0))
32     {
33       fprintf(stderr, "helix2solv: %s\n", pool_errstr(pool));
34       exit(1);
35     }
36   tool_write(repo, 0, 0);
37   pool_free(pool);
38   exit(0);
39 }