Mercurial > hg > xmms-sid
annotate src/xs_support.h @ 652:7a2d62a249a4
Synchronize with Aud-SID.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 18 Oct 2007 00:15:05 +0000 |
parents | a50428d6cc49 |
children | acaba070cf49 |
rev | line source |
---|---|
526
fa95d942f226
Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
516
diff
changeset
|
1 #ifndef XS_SUPPORT_H |
fa95d942f226
Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
516
diff
changeset
|
2 #define XS_SUPPORT_H |
4 | 3 |
4 #ifdef __cplusplus | |
5 extern "C" { | |
6 #endif | |
7 | |
466
00a32ab5887d
Moved some things from xmms-sid.h to xs_support.h; File handling functions
Matti Hamalainen <ccr@tnsp.org>
parents:
452
diff
changeset
|
8 #ifdef HAVE_CONFIG_H |
00a32ab5887d
Moved some things from xmms-sid.h to xs_support.h; File handling functions
Matti Hamalainen <ccr@tnsp.org>
parents:
452
diff
changeset
|
9 #include <config.h> |
00a32ab5887d
Moved some things from xmms-sid.h to xs_support.h; File handling functions
Matti Hamalainen <ccr@tnsp.org>
parents:
452
diff
changeset
|
10 #endif |
00a32ab5887d
Moved some things from xmms-sid.h to xs_support.h; File handling functions
Matti Hamalainen <ccr@tnsp.org>
parents:
452
diff
changeset
|
11 |
00a32ab5887d
Moved some things from xmms-sid.h to xs_support.h; File handling functions
Matti Hamalainen <ccr@tnsp.org>
parents:
452
diff
changeset
|
12 #include <glib.h> |
226
858c09f59011
Moved some functions from xs_length.c here.
Matti Hamalainen <ccr@tnsp.org>
parents:
218
diff
changeset
|
13 #include <stdio.h> |
4 | 14 |
532 | 15 #ifdef AUDACIOUS_PLUGIN |
16 #include <audacious/plugin.h> | |
17 #include <audacious/output.h> | |
611
a751d2b85a7d
Merge in Tuple changes from Audacious-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
537
diff
changeset
|
18 #include <audacious/util.h> |
a751d2b85a7d
Merge in Tuple changes from Audacious-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
537
diff
changeset
|
19 #define HAVE_MEMSET |
532 | 20 #else |
21 #include <xmms/plugin.h> | |
535 | 22 #include <xmms/util.h> |
611
a751d2b85a7d
Merge in Tuple changes from Audacious-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
537
diff
changeset
|
23 #include <xmms/titlestring.h> |
532 | 24 #endif |
25 | |
466
00a32ab5887d
Moved some things from xmms-sid.h to xs_support.h; File handling functions
Matti Hamalainen <ccr@tnsp.org>
parents:
452
diff
changeset
|
26 #ifdef HAVE_ASSERT_H |
00a32ab5887d
Moved some things from xmms-sid.h to xs_support.h; File handling functions
Matti Hamalainen <ccr@tnsp.org>
parents:
452
diff
changeset
|
27 #include <assert.h> |
00a32ab5887d
Moved some things from xmms-sid.h to xs_support.h; File handling functions
Matti Hamalainen <ccr@tnsp.org>
parents:
452
diff
changeset
|
28 #else |
00a32ab5887d
Moved some things from xmms-sid.h to xs_support.h; File handling functions
Matti Hamalainen <ccr@tnsp.org>
parents:
452
diff
changeset
|
29 #define assert(x) /* stub */ |
00a32ab5887d
Moved some things from xmms-sid.h to xs_support.h; File handling functions
Matti Hamalainen <ccr@tnsp.org>
parents:
452
diff
changeset
|
30 #endif |
00a32ab5887d
Moved some things from xmms-sid.h to xs_support.h; File handling functions
Matti Hamalainen <ccr@tnsp.org>
parents:
452
diff
changeset
|
31 |
218 | 32 #ifdef HAVE_STRING_H |
33 #include <string.h> | |
34 #else | |
35 #ifdef HAVE_STRINGS_H | |
36 #include <strings.h> | |
37 #endif | |
38 #endif | |
39 | |
40 #ifdef HAVE_MEMORY_H | |
41 #include <memory.h> | |
42 #endif | |
43 | |
452
aec9f4beb401
New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
44 |
619
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
45 /* Standard gettext macros |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
46 */ |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
47 #ifdef ENABLE_NLS |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
48 # include <libintl.h> |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
49 # undef _ |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
50 # define _(String) dgettext (PACKAGE, String) |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
51 # ifdef gettext_noop |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
52 # define N_(String) gettext_noop (String) |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
53 # else |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
54 # define N_(String) (String) |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
55 # endif |
611
a751d2b85a7d
Merge in Tuple changes from Audacious-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
537
diff
changeset
|
56 #else |
619
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
57 # define _LIBINTL_H |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
58 # define textdomain(String) (String) |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
59 # define gettext(String) (String) |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
60 # define dgettext(Domain,Message) (Message) |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
61 # define dcgettext(Domain,Message,Type) (Message) |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
62 # define bindtextdomain(Domain,Directory) (Domain) |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
63 # define _(String) (String) |
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
64 # define N_(String) (String) |
611
a751d2b85a7d
Merge in Tuple changes from Audacious-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
537
diff
changeset
|
65 #endif |
a751d2b85a7d
Merge in Tuple changes from Audacious-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
537
diff
changeset
|
66 |
619
6f9c5bb127e6
Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents:
611
diff
changeset
|
67 |
516
c192468eb8ce
Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents:
506
diff
changeset
|
68 /* VFS replacement functions |
c192468eb8ce
Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents:
506
diff
changeset
|
69 */ |
c192468eb8ce
Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents:
506
diff
changeset
|
70 #ifdef __AUDACIOUS_NEWVFS__ |
532 | 71 #include <audacious/vfs.h> |
516
c192468eb8ce
Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents:
506
diff
changeset
|
72 #define t_xs_file VFSFile |
652 | 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) | |
516
c192468eb8ce
Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents:
506
diff
changeset
|
78 #define xs_ferror(a) (0) |
652 | 79 #define xs_ftell(a) aud_vfs_ftell(a) |
80 #define xs_fseek(a,b,c) aud_vfs_fseek(a,b,c) | |
516
c192468eb8ce
Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents:
506
diff
changeset
|
81 #else |
452
aec9f4beb401
New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
82 #define t_xs_file FILE |
466
00a32ab5887d
Moved some things from xmms-sid.h to xs_support.h; File handling functions
Matti Hamalainen <ccr@tnsp.org>
parents:
452
diff
changeset
|
83 t_xs_file *xs_fopen(const gchar *, const gchar *); |
452
aec9f4beb401
New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
84 gint xs_fclose(t_xs_file *); |
aec9f4beb401
New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
85 gint xs_fgetc(t_xs_file *); |
aec9f4beb401
New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
86 size_t xs_fread(void *, size_t, size_t, t_xs_file *); |
466
00a32ab5887d
Moved some things from xmms-sid.h to xs_support.h; File handling functions
Matti Hamalainen <ccr@tnsp.org>
parents:
452
diff
changeset
|
87 gint xs_feof(t_xs_file *); |
00a32ab5887d
Moved some things from xmms-sid.h to xs_support.h; File handling functions
Matti Hamalainen <ccr@tnsp.org>
parents:
452
diff
changeset
|
88 gint xs_ferror(t_xs_file *); |
516
c192468eb8ce
Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents:
506
diff
changeset
|
89 glong xs_ftell(t_xs_file *); |
537
3982cba928f2
Forgot to define xs_fseek()
Matti Hamalainen <ccr@tnsp.org>
parents:
535
diff
changeset
|
90 gint xs_fseek(t_xs_file *, glong, gint); |
516
c192468eb8ce
Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents:
506
diff
changeset
|
91 #endif |
c192468eb8ce
Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents:
506
diff
changeset
|
92 guint16 xs_fread_be16(t_xs_file *); |
c192468eb8ce
Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents:
506
diff
changeset
|
93 guint32 xs_fread_be32(t_xs_file *); |
628 | 94 gint xs_fload_buffer(const gchar *, guint8 **, size_t *); |
398 | 95 |
516
c192468eb8ce
Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents:
506
diff
changeset
|
96 |
c192468eb8ce
Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents:
506
diff
changeset
|
97 /* Misc functions |
c192468eb8ce
Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents:
506
diff
changeset
|
98 */ |
634 | 99 gchar *xs_strncpy(gchar *, const gchar *, size_t); |
206
8b896d461fdb
Trivial fixes and added strncpy replacement.
Matti Hamalainen <ccr@tnsp.org>
parents:
109
diff
changeset
|
100 gint xs_pstrcpy(gchar **, const gchar *); |
8b896d461fdb
Trivial fixes and added strncpy replacement.
Matti Hamalainen <ccr@tnsp.org>
parents:
109
diff
changeset
|
101 gint xs_pstrcat(gchar **, const gchar *); |
634 | 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 *); | |
4 | 107 |
214 | 108 #ifdef HAVE_MEMSET |
109 #define xs_memset memset | |
110 #else | |
111 void *xs_memset(void *, int, size_t); | |
112 #endif | |
113 | |
4 | 114 #ifdef __cplusplus |
115 } | |
116 #endif | |
526
fa95d942f226
Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
516
diff
changeset
|
117 #endif /* XS_SUPPORT_H */ |