Mercurial > sdl-ios-xcode
comparison include/SDL_stdinc.h @ 2135:0313af081a84
Merge iconv const changes from 1.2
I'm not entirely happy with them. Maybe the right way to go is to leave
SDL_iconv() taking a non-const inbuf? How often are we converting const
strings anyway?
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 28 Jun 2007 06:57:08 +0000 |
parents | 874162355be5 |
children | ca80c942e69c |
comparison
equal
deleted
inserted
replaced
2134:180fa05e98e2 | 2135:0313af081a84 |
---|---|
638 | 638 |
639 #ifdef HAVE_ICONV | 639 #ifdef HAVE_ICONV |
640 #define SDL_iconv_t iconv_t | 640 #define SDL_iconv_t iconv_t |
641 #define SDL_iconv_open iconv_open | 641 #define SDL_iconv_open iconv_open |
642 #define SDL_iconv_close iconv_close | 642 #define SDL_iconv_close iconv_close |
643 extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, char **inbuf, | |
644 size_t * inbytesleft, char **outbuf, | |
645 size_t * outbytesleft); | |
646 #else | 643 #else |
647 typedef struct _SDL_iconv_t *SDL_iconv_t; | 644 typedef struct _SDL_iconv_t *SDL_iconv_t; |
648 extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, | 645 extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, |
649 const char *fromcode); | 646 const char *fromcode); |
650 extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); | 647 extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); |
651 extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, char **inbuf, | 648 #endif |
649 extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, | |
652 size_t * inbytesleft, char **outbuf, | 650 size_t * inbytesleft, char **outbuf, |
653 size_t * outbytesleft); | 651 size_t * outbytesleft); |
654 #endif | |
655 /* This function converts a string between encodings in one pass, returning a | 652 /* This function converts a string between encodings in one pass, returning a |
656 string that must be freed with SDL_free() or NULL on error. | 653 string that must be freed with SDL_free() or NULL on error. |
657 */ | 654 */ |
658 extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, | 655 extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, |
659 const char *fromcode, | 656 const char *fromcode, |
660 char *inbuf, | 657 const char *inbuf, |
661 size_t inbytesleft); | 658 size_t inbytesleft); |
662 #define SDL_iconv_utf8_ascii(S) SDL_iconv_string("ASCII", "UTF-8", S, SDL_strlen(S)+1) | 659 #define SDL_iconv_utf8_ascii(S) SDL_iconv_string("ASCII", "UTF-8", S, SDL_strlen(S)+1) |
663 #define SDL_iconv_utf8_latin1(S) SDL_iconv_string("LATIN1", "UTF-8", S, SDL_strlen(S)+1) | 660 #define SDL_iconv_utf8_latin1(S) SDL_iconv_string("LATIN1", "UTF-8", S, SDL_strlen(S)+1) |
664 #define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1) | 661 #define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1) |
665 #define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1) | 662 #define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1) |