m_media_new: Store input URL in unescaped form
[libquvi.git] / examples / file_ext.c
blob0a5eca6823977004914734d36e72dd4505c2cf49
1 /* libquvi
2 * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com>
4 * This file is part of libquvi <http://quvi.sourceforge.net/>.
6 * This program is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU Affero General Public
8 * License as published by the Free Software Foundation, either
9 * version 3 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General
17 * Public License along with this program. If not, see
18 * <http://www.gnu.org/licenses/>.
21 #include "config.h"
23 #include <locale.h>
24 #include <stdlib.h>
25 #include <glib.h>
26 #include <quvi.h>
28 #include "examples.h"
30 static gint usage(const gchar *argv0)
32 g_printerr("usage: %s <content-type>\n", argv0);
33 return (EXIT_SUCCESS);
36 gint main(gint argc, gchar **argv)
38 quvi_file_ext_t qfe;
39 gint i;
41 g_assert(q == NULL);
42 setlocale(LC_ALL, "");
44 if (argc < 2)
45 return (usage(argv[0]));
47 q = quvi_new();
48 examples_exit_if_error();
50 for (i=1; i<argc; ++i)
52 qfe = quvi_file_ext_new(q, argv[i]);
53 examples_exit_if_error();
55 g_print("%s -> %s\n", argv[i], quvi_file_ext_get(qfe));
56 quvi_file_ext_free(qfe);
58 examples_cleanup();
60 return (EXIT_SUCCESS);
63 /* vim: set ts=2 sw=2 tw=72 expandtab: */