annotate src/neon/neon.h @ 2286:4f84615468b7

Add .vfs_extensions to the timidity plugin. (Bugzilla #79)
author Jack Kelly <weldingmaskman@hotmail.com>
date Wed, 09 Jan 2008 09:24:30 -0600
parents fa9f85cebade
children 503ea4219e17
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1751
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
1 /*
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
2 * A neon HTTP input plugin for Audacious
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
3 * Copyright (C) 2007 Ralf Ertzinger
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
4 *
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
5 * This program is free software; you can redistribute it and/or modify
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
6 * it under the terms of the GNU General Public License as published by
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
8 * (at your option) any later version.
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
9 *
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
10 * This program is distributed in the hope that it will be useful,
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
13 * GNU General Public License for more details.
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
14 *
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
15 * You should have received a copy of the GNU General Public License
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
16 * along with this program; if not, write to the Free Software
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
18 */
dc83901850df - Add license texts to the neon source
Ralf Ertzinger <ralf@skytale.net>
parents: 1742
diff changeset
19
1719
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
20 #ifndef _NEON_PLUGIN_H
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
21 #define _NEON_PLUGIN_H
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
22
1961
e8ea3a76a84e Various #include cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1751
diff changeset
23 #include "config.h"
e8ea3a76a84e Various #include cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1751
diff changeset
24
1719
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
25 #include <glib.h>
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
26 #include <audacious/vfs.h>
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
27 #include <ne_session.h>
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
28 #include <ne_request.h>
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
29 #include <ne_uri.h>
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
30 #include "rb.h"
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
31
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
32
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
33 static void init(void);
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
34 static void fini(void);
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
35
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1961
diff changeset
36 VFSFile *neon_aud_vfs_fopen_impl(const gchar* path, const gchar* mode);
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1961
diff changeset
37 gint neon_aud_vfs_fclose_impl(VFSFile* file);
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1961
diff changeset
38 size_t neon_aud_vfs_fread_impl(gpointer ptr_, size_t size, size_t nmemb, VFSFile* file);
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1961
diff changeset
39 size_t neon_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile* file);
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1961
diff changeset
40 gint neon_aud_vfs_getc_impl(VFSFile* file);
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1961
diff changeset
41 gint neon_aud_vfs_ungetc_impl(gint c, VFSFile* file);
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1961
diff changeset
42 void neon_aud_vfs_rewind_impl(VFSFile* file);
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1961
diff changeset
43 glong neon_aud_vfs_ftell_impl(VFSFile* file);
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1961
diff changeset
44 gboolean neon_aud_vfs_feof_impl(VFSFile* file);
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1961
diff changeset
45 gint neon_aud_vfs_truncate_impl(VFSFile* file, glong size);
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1961
diff changeset
46 gint neon_aud_vfs_fseek_impl(VFSFile* file, glong offset, gint whence);
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1961
diff changeset
47 gchar *neon_aud_vfs_metadata_impl(VFSFile* file, const gchar * field);
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1961
diff changeset
48 off_t neon_aud_vfs_fsize_impl(VFSFile* file);
1719
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
49
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
50 ne_uri purl;
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
51
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
52 typedef enum {
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
53 NEON_READER_INIT=0,
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
54 NEON_READER_RUN=1,
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
55 NEON_READER_ERROR,
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
56 NEON_READER_EOF,
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
57 NEON_READER_TERM
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
58 } neon_reader_t;
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
59
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
60 struct reader_status {
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
61 GMutex* mutex;
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
62 GCond* cond;
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
63 gboolean reading;
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
64 neon_reader_t status;
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
65 };
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
66
1730
50d151b259bb - Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents: 1719
diff changeset
67 struct icy_metadata {
50d151b259bb - Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents: 1719
diff changeset
68 gchar* stream_name;
50d151b259bb - Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents: 1719
diff changeset
69 gchar* stream_title;
50d151b259bb - Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents: 1719
diff changeset
70 gchar* stream_url;
1742
4f4634573e41 - Free memory for ICY tags
Ralf Ertzinger <ralf@skytale.net>
parents: 1730
diff changeset
71 gchar* stream_contenttype;
1730
50d151b259bb - Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents: 1719
diff changeset
72 };
50d151b259bb - Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents: 1719
diff changeset
73
1719
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
74 struct neon_handle {
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
75 gchar* url; /* The URL, as passed to us */
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
76 ne_uri* purl; /* The URL, parsed into a structure */
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
77 struct ringbuf rb; /* Ringbuffer for our data */
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
78 unsigned char redircount; /* Redirect count for the opened URL */
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
79 long pos; /* Current position in the stream (number of last byte delivered to the player) */
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
80 unsigned long content_start; /* Start position in the stream */
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
81 long content_length; /* Total content length, counting from content_start, if known. -1 if unknown */
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
82 gboolean can_ranges; /* TRUE if the webserver advertised accept-range: bytes */
1730
50d151b259bb - Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents: 1719
diff changeset
83 unsigned long icy_metaint; /* Interval in which the server will send metadata announcements. 0 if no announcments */
50d151b259bb - Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents: 1719
diff changeset
84 unsigned long icy_metaleft; /* Bytes left until the next metadata block */
50d151b259bb - Add lots of code to support the completely braindead concept that is StreamCast
Ralf Ertzinger <ralf@skytale.net>
parents: 1719
diff changeset
85 struct icy_metadata icy_metadata; /* Current ICY metadata */
1719
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
86 ne_session* session;
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
87 ne_request* request;
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
88 GThread* reader;
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
89 struct reader_status reader_status;
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
90 gboolean eof;
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
91 };
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
92
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
93
29c35cb8873e - Add neon HTTP transport plugin sources (for real)
Ralf Ertzinger <ralf@skytale.net>
parents:
diff changeset
94 #endif