summaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-07-29 15:59:52 +0000
committerJakub Jelinek <jakub@redhat.com>2005-07-29 15:59:52 +0000
commit1ce6c1300b11dcd825ee372b9354607f5069a6f1 (patch)
tree67990009472995b855931e265aebae3d42649e12 /stdlib
parent6220c7e39166e868f668aa70cf3fb88ace484561 (diff)
Updated to fedora-glibc-20050729T1531
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/bits/stdlib.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/stdlib/bits/stdlib.h b/stdlib/bits/stdlib.h
index 7ca6c8613c..9ff8f622e2 100644
--- a/stdlib/bits/stdlib.h
+++ b/stdlib/bits/stdlib.h
@@ -73,3 +73,42 @@ wctomb (char *__s, wchar_t __wchar)
return __wctomb_chk (__s, __wchar, __bos (__s));
return __wctomb_alias (__s, __wchar);
}
+
+
+extern size_t __mbstowcs_chk (wchar_t *__restrict __dst,
+ __const char *__restrict __src,
+ size_t __len, size_t __dstlen) __THROW;
+extern size_t __REDIRECT_NTH (__mbstowcs_alias,
+ (wchar_t *__restrict __dst,
+ __const char *__restrict __src,
+ size_t __len), mbstowcs);
+
+extern __always_inline size_t
+mbstowcs (wchar_t *__restrict __dst, __const char *__restrict __src,
+ size_t __len)
+{
+ if (__bos (__dst) != (size_t) -1
+ && (!__builtin_constant_p (__len)
+ || __len * sizeof (wchar_t) > __bos (__dst)))
+ return __mbstowcs_chk (__dst, __src, __len, __bos (__dst));
+ return __mbstowcs_alias (__dst, __src, __len);
+}
+
+
+extern size_t __wcstombs_chk (char *__restrict __dst,
+ __const wchar_t *__restrict __src,
+ size_t __len, size_t __dstlen) __THROW;
+extern size_t __REDIRECT_NTH (__wcstombs_alias,
+ (char *__restrict __dst,
+ __const wchar_t *__restrict __src,
+ size_t __len), wcstombs);
+
+extern __always_inline size_t
+wcstombs (char *__restrict __dst, __const wchar_t *__restrict __src,
+ size_t __len)
+{
+ if (__bos (__dst) != (size_t) -1
+ && (!__builtin_constant_p (__len) || __len > __bos (__dst)))
+ return __wcstombs_chk (__dst, __src, __len, __bos (__dst));
+ return __wcstombs_alias (__dst, __src, __len);
+}