Re: Bulk build test for mbsnrtowcs() and wcsnrtombs()?

2012-06-04 Thread Brett
On Mon, 4 Jun 2012 08:14:50 -0700
Matthew Dempsky  wrote:

> (FYI, naddy@ already helped me with a bulk build test of this diff;
> I'm just waiting on code reviews from a few developers now.)
> 
> On Mon, Jun 4, 2012 at 3:58 AM, Brett  wrote:
> > In case it is helpful, stuff I used a lot since rebuilding (and all working 
> > as before):
> >
> > xxxterm, mplayer, dnsmasq, leafpad, rxvt-unicode, dmenu, jwm, 
> > xcursor-themes, snownews, getmail, centerim, mupdf, vitunes, sylpheed 
> > (3.2.0beta7, not the ports version).
> 
> Cool, thanks for the report.  Are you testing with an ASCII or UTF-8 locale?
> 

No problem.

$ env
_=/usr/bin/env

LC_CTYPE=en_US.ISO8859-1
LC_ALL=en_US.ISO8859-1
XTERM_LOCALE=en_US.ISO8859-1



Re: Bulk build test for mbsnrtowcs() and wcsnrtombs()?

2012-06-04 Thread Matthew Dempsky
(FYI, naddy@ already helped me with a bulk build test of this diff;
I'm just waiting on code reviews from a few developers now.)

On Mon, Jun 4, 2012 at 3:58 AM, Brett  wrote:
> In case it is helpful, stuff I used a lot since rebuilding (and all working 
> as before):
>
> xxxterm, mplayer, dnsmasq, leafpad, rxvt-unicode, dmenu, jwm, xcursor-themes, 
> snownews, getmail, centerim, mupdf, vitunes, sylpheed (3.2.0beta7, not the 
> ports version).

Cool, thanks for the report.  Are you testing with an ASCII or UTF-8 locale?



Re: Bulk build test for mbsnrtowcs() and wcsnrtombs()?

2012-06-04 Thread Brett
On Fri, 25 May 2012 10:59:25 -0700
Matthew Dempsky  wrote:

> Diff below adds mbsnrtowcs() and wcsnrtombs(), which are new POSIX
> 2008 functions.  I'd appreciate if someone could run this through a
> bulk build and let me know if anything breaks or misbehaves.
> 
> Thanks!

Hi,

I didn't do a bulk build, but applied this patch and built everything I 
normally do after updating amd64-current on 31st May.

In case it is helpful, stuff I used a lot since rebuilding (and all working as 
before):

xxxterm, mplayer, dnsmasq, leafpad, rxvt-unicode, dmenu, jwm, xcursor-themes, 
snownews, getmail, centerim, mupdf, vitunes, sylpheed (3.2.0beta7, not the 
ports version).

Built (but not tested/used much since then):

nload, rsync, unrar, chmsee, gv, ispell, links+, comix, feh, deco.

Cheers,
Brett.




Bulk build test for mbsnrtowcs() and wcsnrtombs()?

2012-05-25 Thread Matthew Dempsky
Diff below adds mbsnrtowcs() and wcsnrtombs(), which are new POSIX
2008 functions.  I'd appreciate if someone could run this through a
bulk build and let me know if anything breaks or misbehaves.

Thanks!


Index: include/wchar.h
===
RCS file: /home/mdempsky/anoncvs/cvs/src/include/wchar.h,v
retrieving revision 1.22
diff -u -p -r1.22 wchar.h
--- include/wchar.h 5 Jan 2012 20:37:50 -   1.22
+++ include/wchar.h 25 May 2012 06:01:50 -
@@ -158,6 +158,11 @@ unsigned long int wcstoul(const wchar_t 
 wchar_t*wcsdup(const wchar_t *);
 int wcscasecmp(const wchar_t *, const wchar_t *);
 int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
+
+size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
+size_t, mbstate_t * __restrict);
+size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
+size_t, mbstate_t * __restrict);
 #endif
 
 #if __ISO_C_VISIBLE >= 1999
Index: lib/libc/locale/multibyte_citrus.c
===
RCS file: /home/mdempsky/anoncvs/cvs/src/lib/libc/locale/multibyte_citrus.c,v
retrieving revision 1.1
diff -u -p -r1.1 multibyte_citrus.c
--- lib/libc/locale/multibyte_citrus.c  27 Jul 2010 16:59:04 -  1.1
+++ lib/libc/locale/multibyte_citrus.c  25 May 2012 16:45:00 -
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "citrus_ctype.h"
@@ -65,7 +66,19 @@ mbrtowc(wchar_t *pwc, const char *s, siz
 }
 
 size_t
-mbsrtowcs(wchar_t *pwcs, const char **s, size_t n, mbstate_t *ps)
+mbsrtowcs(wchar_t *dst, const char **src, size_t len, mbstate_t *ps)
+{
+   static mbstate_t mbs;
+   struct _citrus_ctype_rec *cc;
+
+   if (ps == NULL)
+   ps = &mbs;
+   return (mbsnrtowcs(dst, src, SIZE_MAX, len, ps));
+}
+
+size_t
+mbsnrtowcs(wchar_t *dst, const char **src, size_t nmc, size_t len,
+mbstate_t *ps)
 {
static mbstate_t mbs;
struct _citrus_ctype_rec *cc;
@@ -73,7 +86,8 @@ mbsrtowcs(wchar_t *pwcs, const char **s,
if (ps == NULL)
ps = &mbs;
cc = _CurrentRuneLocale->rl_citrus_ctype;
-   return (*cc->cc_ops->co_mbsrtowcs)(pwcs, s, n, _ps_to_private(ps));
+   return (*cc->cc_ops->co_mbsnrtowcs)(dst, src, nmc, len,
+   _ps_to_private(ps));
 }
 
 size_t
@@ -89,7 +103,18 @@ wcrtomb(char *s, wchar_t wc, mbstate_t *
 }
 
 size_t
-wcsrtombs(char *s, const wchar_t **ppwcs, size_t n, mbstate_t *ps)
+wcsrtombs(char *dst, const wchar_t **src, size_t len, mbstate_t *ps)
+{
+   static mbstate_t mbs;
+
+   if (ps == NULL)
+   ps = &mbs;
+   return (wcsnrtombs(dst, src, SIZE_MAX, len, ps));
+}
+
+size_t
+wcsnrtombs(char *dst, const wchar_t **src, size_t nwc, size_t len,
+mbstate_t *ps)
 {
static mbstate_t mbs;
struct _citrus_ctype_rec *cc;
@@ -97,5 +122,6 @@ wcsrtombs(char *s, const wchar_t **ppwcs
if (ps == NULL)
ps = &mbs;
cc = _CurrentRuneLocale->rl_citrus_ctype;
-   return (*cc->cc_ops->co_wcsrtombs)(s, ppwcs, n, _ps_to_private(ps));
+   return (*cc->cc_ops->co_wcsnrtombs)(dst, src, nwc, len,
+   _ps_to_private(ps));
 }
Index: lib/libc/citrus/citrus_ctype_local.h
===
RCS file: /home/mdempsky/anoncvs/cvs/src/lib/libc/citrus/citrus_ctype_local.h,v
retrieving revision 1.2
diff -u -p -r1.2 citrus_ctype_local.h
--- lib/libc/citrus/citrus_ctype_local.h27 Jul 2010 16:59:03 -  
1.2
+++ lib/libc/citrus/citrus_ctype_local.h25 May 2012 01:36:32 -
@@ -36,43 +36,45 @@ size_t  _citrus_##_e_##_ctype_mbrtowc(wch
  const char * __restrict, size_t,  \
  void * __restrict);   \
 int_citrus_##_e_##_ctype_mbsinit(const void * __restrict); \
-size_t _citrus_##_e_##_ctype_mbsrtowcs(wchar_t * __restrict,   \
-   const char ** __restrict,   \
-   size_t, void * __restrict); \
+size_t _citrus_##_e_##_ctype_mbsnrtowcs(wchar_t * __restrict,  \
+const char ** __restrict,  \
+size_t, size_t,\
+void * __restrict);\
 size_t _citrus_##_e_##_ctype_wcrtomb(char * __restrict, wchar_t,   \
  void * __restrict);   \
-size_t _citrus_##_e_##_ctype_wcsrtombs(char * __restrict,  \
-   const wchar_t ** __restrict,\
-   size_t, void * __restrict); \
+size_t _citrus_##_e_##_ctype_wcsnrtombs(char * __restrict, \
+const wchar_t ** __rest