projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use m_strdup and m_strlen that are inlined for efficiency
[apps/madmutt.git]
/
mbyte.c
diff --git
a/mbyte.c
b/mbyte.c
index
7940dc4
..
ce26508
100644
(file)
--- a/
mbyte.c
+++ b/
mbyte.c
@@
-15,11
+15,12
@@
# include "config.h"
#endif
# include "config.h"
#endif
+#include <lib-lib/macros.h>
+
#include "mutt.h"
#include "mbyte.h"
#include "charset.h"
#include "mutt.h"
#include "mbyte.h"
#include "charset.h"
-#include "lib/intl.h"
#include <errno.h>
#include <errno.h>
@@
-91,7
+92,7
@@
void mutt_set_charset (char *charset)
static size_t wcrtomb_iconv (char *s, wchar_t wc, iconv_t cd)
{
char buf[MB_LEN_MAX];
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;
char *ob;
size_t ibl, obl, r;
@@
-102,14
+103,14
@@
static size_t wcrtomb_iconv (char *s, wchar_t wc, iconv_t cd)
ib = buf;
ob = s;
obl = MB_LEN_MAX;
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);
}
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;
}
}
return ob - s;
}
@@
-138,7
+139,7
@@
size_t mbrtowc_iconv (wchar_t * pwc, const char *s, size_t n,
mbstate_t * ps, iconv_t cd)
{
static mbstate_t mbstate;
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];
char *ob, *t;
size_t ibl, obl, k, r;
char bufi[8], bufo[6];
@@
-168,7
+169,7
@@
size_t mbrtowc_iconv (wchar_t * pwc, const char *s, size_t n,
ibl = 1;
for (;;) {
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));
if (ob > bufo && (!k || ib > bufi + k)) {
/* we have a character */
memset (ps, 0, sizeof (*ps));
@@
-431,7
+432,7
@@
size_t utf8rtowc (wchar_t * pwc, const char *s, size_t n, mbstate_t * _ps)
#endif /* !HAVE_WC_FUNCS */
#endif /* !HAVE_WC_FUNCS */
-wchar_t replacement_char ()
+wchar_t replacement_char (
void
)
{
return Charset_is_utf8 ? 0xfffd : '?';
}
{
return Charset_is_utf8 ? 0xfffd : '?';
}