.gitignore: Add config.aux/compile
[libquvi.git] / examples / supported.c
blob9f199800719f9fb4daca782656e6acef7235f937
1 /* libquvi
2 * Copyright (C) 2011 Toni Gundogdu <legatvs@gmail.com>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
20 #include <stdio.h>
21 #include <quvi/quvi.h>
23 static void print_supported(quvi_t q)
25 char *d,*f;
26 while (quvi_next_supported_website(q, &d, &f) == QUVI_OK)
28 puts(d);
29 /* Ignore returned "formats" string as it has no longer use in
30 * libquvi 0.4. */
31 quvi_free(d);
32 quvi_free(f);
36 int main(int argc, char **argv)
38 QUVIcode rc;
39 quvi_t q;
41 rc = quvi_init(&q);
42 if (rc != QUVI_OK)
44 puts(quvi_strerror(q, rc));
45 return (rc);
48 #ifdef _1
49 quvi_setopt(q, QUVIOPT_CATEGORY, QUVIPROTO_HTTP); /* Include HTTP only */
50 #endif
51 print_supported(q);
52 quvi_close(&q);
54 return (0);
57 /* vim: set ts=2 sw=2 tw=72 expandtab: */