Parent Directory | Revision Log
Rewrite of Sargasso in C.
1 | james | 77 | /* |
2 | * This file is part of Sargasso, http://zamez.org/sargasso | ||
3 | * Licensed under the GNU General Public License, | ||
4 | * http://www.opensource.org/licenses/gpl-license | ||
5 | * Copyright 2006 James Bursa <james@zamez.org> | ||
6 | */ | ||
7 | |||
8 | #include <stdio.h> | ||
9 | #include "feed.h" | ||
10 | |||
11 | |||
12 | void die(const char *error); | ||
13 | void warn(const char *warning); | ||
14 | |||
15 | |||
16 | int main(int argc, char *argv[]) | ||
17 | { | ||
18 | unsigned int i; | ||
19 | |||
20 | if (!feed_init()) | ||
21 | die(feed_error); | ||
22 | |||
23 | if (!feed_add("file:///home/james/Projects/sargasso2/tests/bbc")) | ||
24 | warn(feed_error); | ||
25 | if (!feed_add("file:///home/james/Projects/sargasso2/tests/drobe")) | ||
26 | warn(feed_error); | ||
27 | if (!feed_add("file:///home/james/Projects/sargasso2/tests/ft")) | ||
28 | warn(feed_error); | ||
29 | if (!feed_add("file:///home/james/Projects/sargasso2/tests/iconbar")) | ||
30 | warn(feed_error); | ||
31 | if (!feed_add("file:///home/james/Projects/sargasso2/tests/reuters")) | ||
32 | warn(feed_error); | ||
33 | if (!feed_add("file:///home/james/Projects/sargasso2/tests/snackspot")) | ||
34 | warn(feed_error); | ||
35 | if (!feed_add("file:///home/james/Projects/sargasso2/tests/theregister")) | ||
36 | warn(feed_error); | ||
37 | if (!feed_add("http://zamez/")) | ||
38 | warn(feed_error); | ||
39 | if (!feed_add("http://zamez/temp")) | ||
40 | warn(feed_error); | ||
41 | if (!feed_add("http://zamez/perm")) | ||
42 | warn(feed_error); | ||
43 | |||
44 | while (feed_work_needed) | ||
45 | feed_work(); | ||
46 | |||
47 | for (i = 0; i != feed_count; i++) | ||
48 | feed_print(&feeds[i]); | ||
49 | |||
50 | feed_update(); | ||
51 | |||
52 | while (feed_work_needed) | ||
53 | feed_work(); | ||
54 | |||
55 | for (i = 0; i != feed_count; i++) | ||
56 | feed_print(&feeds[i]); | ||
57 | |||
58 | feed_quit(); | ||
59 | |||
60 | return 0; | ||
61 | } | ||
62 | |||
63 | |||
64 | void die(const char *error) | ||
65 | { | ||
66 | fprintf(stderr, "%s\n", error); | ||
67 | exit(EXIT_FAILURE); | ||
68 | } | ||
69 | |||
70 | |||
71 | void warn(const char *warning) | ||
72 | { | ||
73 | fprintf(stderr, "%s\n", warning); | ||
74 | } |
ViewVC Help | |
Powered by ViewVC 1.1.26 |