/*
+ * Copyright notice from original mutt:
* Copyright (C) 2000 Edmund Grimley Evans <edmundo@rano.org>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * This file is part of mutt-ng, see http://www.muttng.org/.
+ * It's licensed under the GNU General Public License,
+ * please see the file GPL in the top level source directory.
*/
/*
# include "config.h"
#endif
+#include <lib-lib/macros.h>
+
#include "mutt.h"
#include "mbyte.h"
#include "charset.h"
+
#include <errno.h>
#include <ctype.h>
static size_t wcrtomb_iconv (char *s, wchar_t wc, iconv_t cd)
{
char buf[MB_LEN_MAX];
- ICONV_CONST char *ib;
+ const char *ib;
char *ob;
size_t ibl, obl, r;
ib = buf;
ob = s;
obl = MB_LEN_MAX;
- r = iconv (cd, &ib, &ibl, &ob, &obl);
+ r = my_iconv(cd, &ib, &ibl, &ob, &obl);
}
else {
ib = "";
ibl = 1;
ob = buf;
obl = sizeof (buf);
- r = iconv (cd, &ib, &ibl, &ob, &obl);
+ r = my_iconv(cd, &ib, &ibl, &ob, &obl);
}
return ob - s;
}
mbstate_t * ps, iconv_t cd)
{
static mbstate_t mbstate;
- ICONV_CONST char *ib, *ibmax;
+ const char *ib, *ibmax;
char *ob, *t;
size_t ibl, obl, k, r;
char bufi[8], bufo[6];
ibl = 1;
for (;;) {
- r = iconv (cd, &ib, &ibl, &ob, &obl);
+ r = my_iconv(cd, &ib, &ibl, &ob, &obl);
if (ob > bufo && (!k || ib > bufi + k)) {
/* we have a character */
memset (ps, 0, sizeof (*ps));
#endif /* !HAVE_WC_FUNCS */
-wchar_t replacement_char ()
+wchar_t replacement_char (void)
{
return Charset_is_utf8 ? 0xfffd : '?';
}