Module Name: src
Committed By: christos
Date: Thu Apr 15 00:55:57 UTC 2010
Modified Files:
src/lib/libedit: chartype.c chartype.h
Log Message:
>From Jess Thrysoee
expose ct_enc_width()
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libedit/chartype.c
cvs rdiff -u -r1.4 -r1.5 src/lib/libedit/chartype.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libedit/chartype.c
diff -u src/lib/libedit/chartype.c:1.3 src/lib/libedit/chartype.c:1.4
--- src/lib/libedit/chartype.c:1.3 Tue Jan 12 14:37:18 2010
+++ src/lib/libedit/chartype.c Wed Apr 14 20:55:57 2010
@@ -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);
Index: src/lib/libedit/chartype.h
diff -u src/lib/libedit/chartype.h:1.4 src/lib/libedit/chartype.h:1.5
--- src/lib/libedit/chartype.h:1.4 Sun Jan 3 13:27:10 2010
+++ src/lib/libedit/chartype.h Wed Apr 14 20:55:57 2010
@@ -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)