src/stdlib/SDL_iconv.c
branchSDL-1.2
changeset 3918 f16c15f3bc2b
parent 1849 b5a4ac87b98c
child 3984 b74530a1dad6
equal deleted inserted replaced
3917:8a3a0f1179f3 3918:f16c15f3bc2b
   147 	}
   147 	}
   148 	return (SDL_iconv_t)-1;
   148 	return (SDL_iconv_t)-1;
   149 }
   149 }
   150 
   150 
   151 size_t SDL_iconv(SDL_iconv_t cd,
   151 size_t SDL_iconv(SDL_iconv_t cd,
   152                  char **inbuf, size_t *inbytesleft,
   152                  const char **inbuf, size_t *inbytesleft,
   153                  char **outbuf, size_t *outbytesleft)
   153                  char **outbuf, size_t *outbytesleft)
   154 {
   154 {
   155 	/* For simplicity, we'll convert everything to and from UCS-4 */
   155 	/* For simplicity, we'll convert everything to and from UCS-4 */
   156 	char *src, *dst;
   156 	const char *src;
       
   157 	char *dst;
   157 	size_t srclen, dstlen;
   158 	size_t srclen, dstlen;
   158 	Uint32 ch = 0;
   159 	Uint32 ch = 0;
   159 	size_t total;
   160 	size_t total;
   160 
   161 
   161 	if ( !inbuf || !*inbuf ) {
   162 	if ( !inbuf || !*inbuf ) {
   753 	return 0;
   754 	return 0;
   754 }
   755 }
   755 
   756 
   756 #endif /* !HAVE_ICONV */
   757 #endif /* !HAVE_ICONV */
   757 
   758 
   758 char *SDL_iconv_string(const char *tocode, const char *fromcode, char *inbuf, size_t inbytesleft)
   759 char *SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft)
   759 {
   760 {
   760 	SDL_iconv_t cd;
   761 	SDL_iconv_t cd;
   761 	char *string;
   762 	char *string;
   762 	size_t stringsize;
   763 	size_t stringsize;
   763 	char *outbuf;
   764 	char *outbuf;