Revision 17700,
615 bytes
checked in by rbasch, 23 years ago
(diff) |
A simple utility which calls gnome_url_show() to display a URL in an
appropriate viewer.
|
Line | |
---|
1 | /* Display a URL via the user's configured GNOME handler. |
---|
2 | * |
---|
3 | * $Id: gurlview.c,v 1.1 2002-06-24 13:32:31 rbasch Exp $ |
---|
4 | */ |
---|
5 | |
---|
6 | #include <libgnomeui/libgnomeui.h> |
---|
7 | #include <libgnome/gnome-url.h> |
---|
8 | |
---|
9 | static void usage(); |
---|
10 | |
---|
11 | int main(int argc, char **argv) |
---|
12 | { |
---|
13 | if (gnome_init("gurlview", "", argc, argv) != 0) |
---|
14 | { |
---|
15 | fprintf(stderr, "gurlview: could not initialize GNOME library\n"); |
---|
16 | exit(1); |
---|
17 | } |
---|
18 | |
---|
19 | if (argc != 2) |
---|
20 | usage(); |
---|
21 | |
---|
22 | /* Note that gnome_url_show's return is void. */ |
---|
23 | gnome_url_show(argv[1]); |
---|
24 | |
---|
25 | exit(0); |
---|
26 | } |
---|
27 | |
---|
28 | static void usage() |
---|
29 | { |
---|
30 | fprintf(stderr, "gurlview: Usage: gurlview <URL>\n"); |
---|
31 | exit(1); |
---|
32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.