d893fb122a1fbbdfe150e808b70859b993efb652
[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 <limits.h>
19 #include <fcntl.h>
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include <string.h>
23
24 #include "pool.h"
25 #include "repo_helix.h"
26 #include "common_write.h"
27
28 int
29 main(int argc, char **argv)
30 {
31   Pool *pool = pool_create();
32   Repo *repo = repo_create(pool, "<stdin>");
33   if (repo_add_helix(repo, stdin, 0))
34     {
35       fprintf(stderr, "helix2solv: %s\n", pool_errstr(pool));
36       exit(1);
37     }
38   tool_write(repo, 0, 0);
39   pool_free(pool);
40   exit(0);
41 }