Mercurial > hg > xmms-sid
annotate src/xs_support.h @ 466:00a32ab5887d
Moved some things from xmms-sid.h to xs_support.h; File handling functions
for possible portability to Audacious (they already created their own
patch for vfs support, though)
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 25 Jan 2007 03:44:01 +0000 |
parents | aec9f4beb401 |
children | d87ac4d5dc52 |
rev | line source |
---|---|
392
b09d74eb71e6
Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents:
269
diff
changeset
|
1 #ifndef _XS_SUPPORT_H |
b09d74eb71e6
Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents:
269
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 |
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
|
15 #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
|
16 #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
|
17 #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
|
18 #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
|
19 #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
|
20 |
218 | 21 #ifdef HAVE_STRING_H |
22 #include <string.h> | |
23 #else | |
24 #ifdef HAVE_STRINGS_H | |
25 #include <strings.h> | |
26 #endif | |
27 #endif | |
28 | |
29 #ifdef HAVE_MEMORY_H | |
30 #include <memory.h> | |
31 #endif | |
32 | |
398 | 33 #ifndef HAVE_FSEEKO |
34 #define fseeko fseek | |
35 #define ftello ftell | |
36 #endif | |
218 | 37 |
452
aec9f4beb401
New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
38 |
aec9f4beb401
New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
39 #define t_xs_file FILE |
aec9f4beb401
New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
40 |
aec9f4beb401
New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
41 |
aec9f4beb401
New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
42 /* Functions |
4 | 43 */ |
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
|
44 t_xs_file *xs_fopen(const gchar *, const gchar *); |
452
aec9f4beb401
New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
45 gint xs_fclose(t_xs_file *); |
aec9f4beb401
New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
46 gint xs_fgetc(t_xs_file *); |
aec9f4beb401
New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
47 guint16 xs_fread_be16(t_xs_file *); |
aec9f4beb401
New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
48 guint32 xs_fread_be32(t_xs_file *); |
aec9f4beb401
New file reading functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
49 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
|
50 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
|
51 gint xs_ferror(t_xs_file *); |
398 | 52 |
218 | 53 gchar *xs_strncpy(gchar *, gchar *, size_t); |
206
8b896d461fdb
Trivial fixes and added strncpy replacement.
Matti Hamalainen <ccr@tnsp.org>
parents:
109
diff
changeset
|
54 gint xs_pstrcpy(gchar **, const gchar *); |
8b896d461fdb
Trivial fixes and added strncpy replacement.
Matti Hamalainen <ccr@tnsp.org>
parents:
109
diff
changeset
|
55 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
|
56 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
|
57 gchar *xs_strrchr(gchar *, gchar); |
109
578b71b62eeb
Fileinfo now basically working, STIL COMMENT-fields are not yet parsed or shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
87
diff
changeset
|
58 inline void xs_findnext(gchar *, guint *); |
578b71b62eeb
Fileinfo now basically working, STIL COMMENT-fields are not yet parsed or shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
87
diff
changeset
|
59 inline void xs_findeol(gchar *, guint *); |
578b71b62eeb
Fileinfo now basically working, STIL COMMENT-fields are not yet parsed or shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
87
diff
changeset
|
60 inline void xs_findnum(gchar *, guint *); |
4 | 61 |
214 | 62 #ifdef HAVE_MEMSET |
63 #define xs_memset memset | |
64 #else | |
65 void *xs_memset(void *, int, size_t); | |
66 #endif | |
67 | |
4 | 68 #ifdef __cplusplus |
69 } | |
70 #endif | |
392
b09d74eb71e6
Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents:
269
diff
changeset
|
71 #endif /* _XS_SUPPORT_H */ |