Subversion Repositories Kolibri OS

Rev

Rev 1905 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1905 Rev 3960
Line 13... Line 13...
13
 
13
 
14
#ifndef MPG123_COMPAT_H
14
#ifndef MPG123_COMPAT_H
Line 15... Line 15...
15
#define MPG123_COMPAT_H
15
#define MPG123_COMPAT_H
-
 
16
 
Line 16... Line 17...
16
 
17
#include "config.h"
17
#include "config.h"
18
#include "intsym.h"
18
 
19
 
19
#ifdef HAVE_STDLIB_H
20
#ifdef HAVE_STDLIB_H
Line 119... Line 120...
119
#else
120
#else
120
# define SSIZE_P "li"
121
# define SSIZE_P "li"
121
typedef long ssize_p;
122
typedef long ssize_p;
122
#endif
123
#endif
Line -... Line 124...
-
 
124
 
-
 
125
/**
-
 
126
 * Opening a file handle can be different.
-
 
127
 * This function here is defined to take a path in native encoding (ISO8859 / UTF-8 / ...), or, when MS Windows Unicode support is enabled, an UTF-8 string that will be converted back to native UCS-2 (wide character) before calling the system's open function.
-
 
128
 * @param[in] wptr Pointer to wide string.
-
 
129
 * @param[in] mbptr Pointer to multibyte string.
-
 
130
 * @return file descriptor (>=0) or error code.
-
 
131
 */
-
 
132
int compat_open(const char *filename, int flags);
-
 
133
 
-
 
134
/**
-
 
135
 * Closing a file handle can be platform specific.
-
 
136
 * This function takes a file descriptor that is to be closed.
-
 
137
 * @param[in] infd File descriptor to be closed.
-
 
138
 * @return 0 if the file was successfully closed. A return value of -1 indicates an error.
-
 
139
 */
-
 
140
int compat_close(int infd);
-
 
141
 
-
 
142
/* Those do make sense in a separate file, but I chose to include them in compat.c because that's the one source whose object is shared between mpg123 and libmpg123 -- and both need the functionality internally. */
-
 
143
 
-
 
144
#ifdef WANT_WIN32_UNICODE
-
 
145
/**
-
 
146
 * win32_uni2mbc
-
 
147
 * Converts a null terminated UCS-2 string to a multibyte (UTF-8) equivalent.
-
 
148
 * Caller is supposed to free allocated buffer.
-
 
149
 * @param[in] wptr Pointer to wide string.
-
 
150
 * @param[out] mbptr Pointer to multibyte string.
-
 
151
 * @param[out] buflen Optional parameter for length of allocated buffer.
-
 
152
 * @return status of WideCharToMultiByte conversion.
-
 
153
 *
-
 
154
 * WideCharToMultiByte - http://msdn.microsoft.com/en-us/library/dd374130(VS.85).aspx
-
 
155
 */
-
 
156
int win32_wide_utf8(const wchar_t * const wptr, char **mbptr, size_t * buflen);
-
 
157
 
-
 
158
/**
-
 
159
 * win32_mbc2uni
-
 
160
 * Converts a null terminated UTF-8 string to a UCS-2 equivalent.
-
 
161
 * Caller is supposed to free allocated buffer.
-
 
162
 * @param[out] mbptr Pointer to multibyte string.
-
 
163
 * @param[in] wptr Pointer to wide string.
-
 
164
 * @param[out] buflen Optional parameter for length of allocated buffer.
-
 
165
 * @return status of WideCharToMultiByte conversion.
-
 
166
 *
-
 
167
 * MultiByteToWideChar - http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx
-
 
168
 */
-
 
169
 
-
 
170
int win32_utf8_wide(const char *const mbptr, wchar_t **wptr, size_t *buflen);
-
 
171
#endif
-
 
172
 
-
 
173
/* That one comes from Tellie on OS/2, needed in resolver. */
-
 
174
#ifdef __KLIBC__
-
 
175
typedef int socklen_t;
-
 
176
#endif
123
 
177