annotate src/xs_support.h @ 619:6f9c5bb127e6

Moved NLS macros to xs_support.h
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 02 Sep 2007 22:13:05 +0000
parents a751d2b85a7d
children e7e47ba162b1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 #ifdef __cplusplus
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 extern "C" {
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 #endif
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14
532
bc548249464a Audacious glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 527
diff changeset
15 #ifdef AUDACIOUS_PLUGIN
bc548249464a Audacious glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 527
diff changeset
16 #include <audacious/plugin.h>
bc548249464a Audacious glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 527
diff changeset
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 #include <audacious/tuple.h>
a751d2b85a7d Merge in Tuple changes from Audacious-SID.
Matti Hamalainen <ccr@tnsp.org>
parents: 537
diff changeset
20 #define HAVE_MEMSET
532
bc548249464a Audacious glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 527
diff changeset
21 #else
bc548249464a Audacious glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 527
diff changeset
22 #include <xmms/plugin.h>
535
d609d0ece252 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 532
diff changeset
23 #include <xmms/util.h>
611
a751d2b85a7d Merge in Tuple changes from Audacious-SID.
Matti Hamalainen <ccr@tnsp.org>
parents: 537
diff changeset
24 #include <xmms/titlestring.h>
532
bc548249464a Audacious glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 527
diff changeset
25 #endif
bc548249464a Audacious glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 527
diff changeset
26
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
27 #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
28 #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
29 #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
30 #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
31 #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
32
218
57231fe14369 Minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
33 #ifdef HAVE_STRING_H
57231fe14369 Minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
34 #include <string.h>
57231fe14369 Minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
35 #else
57231fe14369 Minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
36 #ifdef HAVE_STRINGS_H
57231fe14369 Minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
37 #include <strings.h>
57231fe14369 Minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
38 #endif
57231fe14369 Minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
39 #endif
57231fe14369 Minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
40
57231fe14369 Minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
41 #ifdef HAVE_MEMORY_H
57231fe14369 Minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
42 #include <memory.h>
57231fe14369 Minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
43 #endif
57231fe14369 Minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
44
452
aec9f4beb401 New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 398
diff changeset
45
619
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
46 /* Standard gettext macros
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
47 */
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
48 #ifdef ENABLE_NLS
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
49 # include <libintl.h>
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
50 # undef _
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
51 # define _(String) dgettext (PACKAGE, String)
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
52 # ifdef gettext_noop
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
53 # define N_(String) gettext_noop (String)
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
54 # else
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
55 # define N_(String) (String)
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
56 # endif
611
a751d2b85a7d Merge in Tuple changes from Audacious-SID.
Matti Hamalainen <ccr@tnsp.org>
parents: 537
diff changeset
57 #else
619
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
58 # define _LIBINTL_H
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
59 # define textdomain(String) (String)
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
60 # define gettext(String) (String)
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
61 # define dgettext(Domain,Message) (Message)
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
62 # define dcgettext(Domain,Message,Type) (Message)
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
63 # define bindtextdomain(Domain,Directory) (Domain)
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
64 # define _(String) (String)
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
65 # define N_(String) (String)
611
a751d2b85a7d Merge in Tuple changes from Audacious-SID.
Matti Hamalainen <ccr@tnsp.org>
parents: 537
diff changeset
66 #endif
a751d2b85a7d Merge in Tuple changes from Audacious-SID.
Matti Hamalainen <ccr@tnsp.org>
parents: 537
diff changeset
67
619
6f9c5bb127e6 Moved NLS macros to xs_support.h
Matti Hamalainen <ccr@tnsp.org>
parents: 611
diff changeset
68
516
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
69 /* VFS replacement functions
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
70 */
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
71 #ifdef __AUDACIOUS_NEWVFS__
532
bc548249464a Audacious glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 527
diff changeset
72 #include <audacious/vfs.h>
516
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
73 #define t_xs_file VFSFile
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
74 #define xs_fopen(a,b) vfs_fopen(a,b)
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
75 #define xs_fclose(a) vfs_fclose(a)
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
76 #define xs_fgetc(a) vfs_getc(a)
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
77 #define xs_fread(a,b,c,d) vfs_fread(a,b,c,d)
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
78 #define xs_feof(a) vfs_feof(a)
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
79 #define xs_ferror(a) (0)
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
80 #define xs_ftell(a) vfs_ftell(a)
537
3982cba928f2 Forgot to define xs_fseek()
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
81 #define xs_fseek(a,b,c) vfs_fseek(a,b,c)
516
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
82 #else
452
aec9f4beb401 New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 398
diff changeset
83 #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
84 t_xs_file *xs_fopen(const gchar *, const gchar *);
452
aec9f4beb401 New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 398
diff changeset
85 gint xs_fclose(t_xs_file *);
aec9f4beb401 New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 398
diff changeset
86 gint xs_fgetc(t_xs_file *);
aec9f4beb401 New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 398
diff changeset
87 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
88 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
89 gint xs_ferror(t_xs_file *);
516
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
90 glong xs_ftell(t_xs_file *);
537
3982cba928f2 Forgot to define xs_fseek()
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
91 gint xs_fseek(t_xs_file *, glong, gint);
516
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
92 #endif
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
93 guint16 xs_fread_be16(t_xs_file *);
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
94 guint32 xs_fread_be32(t_xs_file *);
527
fe8b41abd923 Now everything necessary should be using the VFS functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 526
diff changeset
95 gint xs_fload_buffer(gchar *, guint8 **, size_t *);
398
933b9ea5923e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
96
516
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
97
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
98 /* Misc functions
c192468eb8ce Audacious VFS support functions finished.
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
99 */
218
57231fe14369 Minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
100 gchar *xs_strncpy(gchar *, gchar *, size_t);
206
8b896d461fdb Trivial fixes and added strncpy replacement.
Matti Hamalainen <ccr@tnsp.org>
parents: 109
diff changeset
101 gint xs_pstrcpy(gchar **, const gchar *);
8b896d461fdb Trivial fixes and added strncpy replacement.
Matti Hamalainen <ccr@tnsp.org>
parents: 109
diff changeset
102 gint xs_pstrcat(gchar **, const gchar *);
239
7833df935239 Added xs_pnstrcat() to ease forming of limited size strings.
Matti Hamalainen <ccr@tnsp.org>
parents: 226
diff changeset
103 void xs_pnstrcat(gchar *, size_t, gchar *);
56
6a3ce7260ae1 Changed some standard functions to glib ones
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
104 gchar *xs_strrchr(gchar *, gchar);
506
d87ac4d5dc52 guint -> size_t
Matti Hamalainen <ccr@tnsp.org>
parents: 466
diff changeset
105 void xs_findnext(gchar *, size_t *);
d87ac4d5dc52 guint -> size_t
Matti Hamalainen <ccr@tnsp.org>
parents: 466
diff changeset
106 void xs_findeol(gchar *, size_t *);
d87ac4d5dc52 guint -> size_t
Matti Hamalainen <ccr@tnsp.org>
parents: 466
diff changeset
107 void xs_findnum(gchar *, size_t *);
4
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
108
214
575686094eb1 Portability fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 206
diff changeset
109 #ifdef HAVE_MEMSET
575686094eb1 Portability fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 206
diff changeset
110 #define xs_memset memset
575686094eb1 Portability fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 206
diff changeset
111 #else
575686094eb1 Portability fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 206
diff changeset
112 void *xs_memset(void *, int, size_t);
575686094eb1 Portability fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 206
diff changeset
113 #endif
575686094eb1 Portability fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 206
diff changeset
114
4
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 #ifdef __cplusplus
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
116 }
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
117 #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
118 #endif /* XS_SUPPORT_H */