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
27 #include "undertow-main.h"
28 #include "undertow-episode.h"
29 #include "undertow-error.h"
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 */
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 *),
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 *),
63 lut_errno
lut_delete_channel (const char *url
);
64 lut_errno
lut_foreach_channel (lut_foreach_channel_funct f
, void *data
);