* updated build system to link to libtorrent if --enable-bittorrent is passed to...
[libundertow.git] / src / undertow-channel.h
blobec69203673a1eb6f43d4471c0f21f9f4793b169a
1 /* libundertow - undertow-channel.h
2 * Copyright (C) 2008 Michael Frank <msfrank@syntaxjockey.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 3 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
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 /**\file undertow-channel.h */
22 #ifndef LIBUNDERTOW_CHANNEL_H
23 #define LIBUNDERTOW_CHANNEL_H
25 #include <time.h>
27 #include "undertow-main.h"
28 #include "undertow-episode.h"
29 #include "undertow-error.h"
31 /** Undertow channel
33 typedef struct {
34 char *url; /**< The URL of the channel */
35 time_t updated_on; /**< Time when the channel was last updated */
36 char *title; /**< The channel title, encoded in UTF-8 */
37 char *link; /**< The channel link */
38 char *description; /**< The channel description, encoded in UTF-8 */
39 char *category; /**< Channel category keywords */
40 char *copyright; /**< Copyright notice for the channel */
41 char *image; /**< Channel image */
42 } lut_channel;
44 /** Function prototype for the callback passed to lut_db_foreach_channel() */
45 typedef void (*lut_foreach_channel_funct)(lut_channel *, void *);
47 lut_channel *lut_channel_copy (lut_channel *channel);
48 void lut_channel_free (lut_channel *channel);
49 lut_errno lut_channel_exists (const char *url);
50 lut_errno lut_get_channel (const char *url, lut_channel **channel);
51 lut_errno lut_add_channel (const char * url,
52 void (*on_channel_updated)(lut_channel *, void *),
53 void (*on_episode_added)(lut_episode *, void *),
54 void (*on_episode_expired)(lut_episode *, void *),
55 void (*on_completion)(lut_errno, void *),
56 void * data);
57 lut_errno lut_refresh_channel (const char * url,
58 void (*on_channel_updated)(lut_channel *, void *),
59 void (*on_episode_added)(lut_episode *, void *),
60 void (*on_episode_expired)(lut_episode *, void *),
61 void (*on_completion)(lut_errno, void *),
62 void * data);
63 lut_errno lut_delete_channel (const char *url);
64 lut_errno lut_foreach_channel (lut_foreach_channel_funct f, void *data);
66 #endif