summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruema2 <uema2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-05 12:33:19 +0000
committeruema2 <uema2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-05 12:33:19 +0000
commitb5d717afda44c19b652dfd1a6a2b721fa93a2762 (patch)
tree661d11a03372b854e02919879ff88be2db155d1b
parentb1937a53e664fec371cbb0f7985cbd845cf33b81 (diff)
* wince/stdlib.c: add mblen().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--wince/stdlib.c17
2 files changed, 21 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 329cdc0..149af2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Jun 5 21:31:55 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
+
+ * wince/stdlib.c: add mblen().
+
Thu Jun 5 18:33:46 2003 WATANABE Hirofumi <eban@ruby-lang.org>
* ext/curses/curses.c (window_s_allocate,curses_finalize):
diff --git a/wince/stdlib.c b/wince/stdlib.c
index b3d5f3b..c7f0c84 100644
--- a/wince/stdlib.c
+++ b/wince/stdlib.c
@@ -20,3 +20,20 @@ char *_fullpath(char *absPath, const char *relPath,
return absPath;
}
+int mblen(const char *mbstr, size_t count)
+{
+ const char *p = mbstr;
+ size_t i;
+ int n=0;
+
+ for( i=0; i<count; i++ )
+ {
+ if( *p=='\0' ) break;
+ if( IsDBCSLeadByteEx( CP_ACP, *p ) )
+ n+=2;
+ else
+ n+=1;
+ }
+
+ return n;
+}