Mercurial > audlegacy-plugins
annotate src/sid/xs_support.h @ 2184:f2590691d4b7
- Fix locking issues causing spurious error messages (and possibly deadlocks)
author | Ralf Ertzinger <ralf@skytale.net> |
---|---|
date | Thu, 22 Nov 2007 15:52:42 +0100 |
parents | 04155ce9e72e |
children | 59e8f118ad34 |
rev | line source |
---|---|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1 #ifndef XS_SUPPORT_H |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
2 #define XS_SUPPORT_H |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
3 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
4 #ifdef __cplusplus |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
5 extern "C" { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
6 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
7 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
8 #ifdef HAVE_CONFIG_H |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
9 #include <config.h> |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
10 #endif |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
11 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
12 #include <glib.h> |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
13 #include <stdio.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
14 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
15 #ifdef AUDACIOUS_PLUGIN |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
16 #include <audacious/plugin.h> |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
17 #include <audacious/output.h> |
1476
c6947f95fd2a
converted sid plugin to new tuple system
Giacomo Lozito <james@develia.org>
parents:
735
diff
changeset
|
18 #include <audacious/util.h> |
1549
a9f544dafa91
Always #define HAVE_MEMSET when building Audacious version of SID plugin.
Matti Hamalainen <ccr@tnsp.org>
parents:
1476
diff
changeset
|
19 #define HAVE_MEMSET |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
20 #else |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
21 #include <xmms/plugin.h> |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
22 #include <xmms/util.h> |
1476
c6947f95fd2a
converted sid plugin to new tuple system
Giacomo Lozito <james@develia.org>
parents:
735
diff
changeset
|
23 #include <xmms/titlestring.h> |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
24 #endif |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
25 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
26 #ifdef HAVE_ASSERT_H |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
27 #include <assert.h> |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
28 #else |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
29 #define assert(x) /* stub */ |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
30 #endif |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
31 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
32 #ifdef HAVE_STRING_H |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
33 #include <string.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
34 #else |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
35 #ifdef HAVE_STRINGS_H |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
36 #include <strings.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
37 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
38 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
39 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
40 #ifdef HAVE_MEMORY_H |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
41 #include <memory.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
42 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
43 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
44 |
1563
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
45 /* Standard gettext macros |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
46 */ |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
47 #ifdef ENABLE_NLS |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
48 # include <libintl.h> |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
49 # undef _ |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
50 # define _(String) dgettext (PACKAGE, String) |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
51 # ifdef gettext_noop |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
52 # define N_(String) gettext_noop (String) |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
53 # else |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
54 # define N_(String) (String) |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
55 # endif |
1476
c6947f95fd2a
converted sid plugin to new tuple system
Giacomo Lozito <james@develia.org>
parents:
735
diff
changeset
|
56 #else |
1563
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
57 # define _LIBINTL_H |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
58 # define textdomain(String) (String) |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
59 # define gettext(String) (String) |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
60 # define dgettext(Domain,Message) (Message) |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
61 # define dcgettext(Domain,Message,Type) (Message) |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
62 # define bindtextdomain(Domain,Directory) (Domain) |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
63 # define _(String) (String) |
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
64 # define N_(String) (String) |
1476
c6947f95fd2a
converted sid plugin to new tuple system
Giacomo Lozito <james@develia.org>
parents:
735
diff
changeset
|
65 #endif |
c6947f95fd2a
converted sid plugin to new tuple system
Giacomo Lozito <james@develia.org>
parents:
735
diff
changeset
|
66 |
1563
828f45d8e8f8
Move NLS support macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
1549
diff
changeset
|
67 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
68 /* VFS replacement functions |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
69 */ |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
70 #ifdef __AUDACIOUS_NEWVFS__ |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
71 #include <audacious/vfs.h> |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
72 #define t_xs_file VFSFile |
1978 | 73 #define xs_fopen(a,b) aud_vfs_fopen(a,b) |
74 #define xs_fclose(a) aud_vfs_fclose(a) | |
75 #define xs_fgetc(a) aud_vfs_getc(a) | |
76 #define xs_fread(a,b,c,d) aud_vfs_fread(a,b,c,d) | |
77 #define xs_feof(a) aud_vfs_feof(a) | |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
78 #define xs_ferror(a) (0) |
1978 | 79 #define xs_ftell(a) aud_vfs_ftell(a) |
80 #define xs_fseek(a,b,c) aud_vfs_fseek(a,b,c) | |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
81 #else |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
82 #define t_xs_file FILE |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
83 t_xs_file *xs_fopen(const gchar *, const gchar *); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
84 gint xs_fclose(t_xs_file *); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
85 gint xs_fgetc(t_xs_file *); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
86 size_t xs_fread(void *, size_t, size_t, t_xs_file *); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
87 gint xs_feof(t_xs_file *); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
88 gint xs_ferror(t_xs_file *); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
89 glong xs_ftell(t_xs_file *); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
90 gint xs_fseek(t_xs_file *, glong, gint); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
91 #endif |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
92 guint16 xs_fread_be16(t_xs_file *); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
93 guint32 xs_fread_be32(t_xs_file *); |
1575 | 94 gint xs_fload_buffer(const gchar *, guint8 **, size_t *); |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
95 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
96 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
97 /* Misc functions |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
12
diff
changeset
|
98 */ |
1576 | 99 gchar *xs_strncpy(gchar *, const gchar *, size_t); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
100 gint xs_pstrcpy(gchar **, const gchar *); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
101 gint xs_pstrcat(gchar **, const gchar *); |
1576 | 102 void xs_pnstrcat(gchar *, size_t, const gchar *); |
103 gchar *xs_strrchr(gchar *, const gchar); | |
104 void xs_findnext(const gchar *, size_t *); | |
105 void xs_findeol(const gchar *, size_t *); | |
106 void xs_findnum(const gchar *, size_t *); | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
107 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
108 #ifdef HAVE_MEMSET |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
109 #define xs_memset memset |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
110 #else |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
111 void *xs_memset(void *, int, size_t); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
112 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
113 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
114 #ifdef __cplusplus |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
115 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
116 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
117 #endif /* XS_SUPPORT_H */ |