Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libedit From Jess Thrysoee



details:   https://anonhg.NetBSD.org/src/rev/929b510c2613
branches:  trunk
changeset: 753979:929b510c2613
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Apr 15 00:55:57 2010 +0000

description:
>From Jess Thrysoee
        expose ct_enc_width()

diffstat:

 lib/libedit/chartype.c |  11 +++++------
 lib/libedit/chartype.h |   3 ++-
 2 files changed, 7 insertions(+), 7 deletions(-)

diffs (62 lines):

diff -r d9ce587a60ce -r 929b510c2613 lib/libedit/chartype.c
--- a/lib/libedit/chartype.c    Thu Apr 15 00:52:48 2010 +0000
+++ b/lib/libedit/chartype.c    Thu Apr 15 00:55:57 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: chartype.c,v 1.3 2010/01/12 19:37:18 christos Exp $    */
+/*     $NetBSD: chartype.c,v 1.4 2010/04/15 00:55:57 christos Exp $    */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -38,14 +38,13 @@
  */
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: chartype.c,v 1.3 2010/01/12 19:37:18 christos Exp $");
+__RCSID("$NetBSD: chartype.c,v 1.4 2010/04/15 00:55:57 christos Exp $");
 #endif /* not lint && not SCCSID */
 #include "el.h"
 #include <stdlib.h>
 
 #define CT_BUFSIZ 1024
 
-
 #ifdef WIDECHAR
 protected void
 ct_conv_buff_resize(ct_buffer_t *conv, size_t mincsize, size_t minwsize)
@@ -177,8 +176,8 @@
 }
 
 
-private size_t
-enc_width(Char c)
+protected size_t
+ct_enc_width(Char c)
 {
        /* UTF-8 encoding specific values */
        if (c < 0x80)
@@ -197,7 +196,7 @@
 ct_encode_char(char *dst, size_t len, Char c)
 {
        ssize_t l = 0;
-       if (len < enc_width(c))
+       if (len < ct_enc_width(c))
                return -1;
        l = ct_wctomb(dst, c);
 
diff -r d9ce587a60ce -r 929b510c2613 lib/libedit/chartype.h
--- a/lib/libedit/chartype.h    Thu Apr 15 00:52:48 2010 +0000
+++ b/lib/libedit/chartype.h    Thu Apr 15 00:55:57 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: chartype.h,v 1.4 2010/01/03 18:27:10 christos Exp $    */
+/*     $NetBSD: chartype.h,v 1.5 2010/04/15 00:55:57 christos Exp $    */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -186,6 +186,7 @@
 /* Resizes the conversion buffer(s) if needed. */
 protected void ct_conv_buff_resize(ct_buffer_t *, size_t, size_t);
 protected ssize_t ct_encode_char(char *, size_t, Char);
+protected size_t ct_enc_width(Char);
 
 #define ct_free_argv(s)        el_free(s)
 



Home | Main Index | Thread Index | Old Index