2 * Copyright (C) 2011 Toni Gundogdu <legatvs@gmail.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library 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 GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 /* common.c -- Common functions etc. used by the examples */
24 #include <quvi/quvi.h>
28 void spew_e(const char *fmt
, ...)
32 vfprintf(stderr
, fmt
, ap
);
36 void check_error(quvi_t q
, QUVIcode rc
)
41 fprintf(stderr
, "error: %s\n", quvi_strerror(q
, rc
));
49 void handle_resolve_status(quvi_word type
)
51 if (type
== QUVISTATUSTYPE_DONE
)
54 spew_e(":: Check for URL redirection ...");
57 void handle_fetch_status(quvi_word type
, void *p
)
62 spew_e(":: Fetch %s ...", (char *)p
);
64 case QUVISTATUSTYPE_CONFIG
:
65 spew_e(":: Fetch config ...");
67 case QUVISTATUSTYPE_PLAYLIST
:
68 spew_e(":: Fetch playlist ...");
70 case QUVISTATUSTYPE_DONE
:
76 void handle_verify_status(quvi_word type
)
81 spew_e(":: Verify media URL ...");
83 case QUVISTATUSTYPE_DONE
:
89 /* vim: set ts=2 sw=2 tw=72 expandtab: */