summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2015-07-17 21:22:35 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-07-23 16:46:14 +0200
commit17e60440747c3363157a08560eb725f91f08ce4a (patch)
treebfa45ea52966ec53db23fc4670bcea1e9b257ac3 /lib
parent773be2a16842d68da84b9f2283f8bf9c07688290 (diff)
downloadbarebox-17e60440747c3363157a08560eb725f91f08ce4a.tar.gz
barebox-17e60440747c3363157a08560eb725f91f08ce4a.tar.xz
xfuncs: add wrapper for wchar strdup functions
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/xfuncs.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/xfuncs.c b/lib/xfuncs.c
index 6111f6d1c7..152081c662 100644
--- a/lib/xfuncs.c
+++ b/lib/xfuncs.c
@@ -22,6 +22,7 @@
#include <common.h>
#include <malloc.h>
#include <module.h>
+#include <wchar.h>
void *xmalloc(size_t size)
{
@@ -127,3 +128,33 @@ char *xasprintf(const char *fmt, ...)
return p;
}
EXPORT_SYMBOL(xasprintf);
+
+wchar_t *xstrdup_wchar(const wchar_t *s)
+{
+ wchar_t *p = strdup_wchar(s);
+
+ if (!p)
+ panic("ERROR: out of memory\n");
+ return p;
+}
+EXPORT_SYMBOL(xstrdup_wchar);
+
+wchar_t *xstrdup_char_to_wchar(const char *s)
+{
+ wchar_t *p = strdup_char_to_wchar(s);
+
+ if (!p)
+ panic("ERROR: out of memory\n");
+ return p;
+}
+EXPORT_SYMBOL(xstrdup_char_to_wchar);
+
+char *xstrdup_wchar_to_char(const wchar_t *s)
+{
+ char *p = strdup_wchar_to_char(s);
+
+ if (!p)
+ panic("ERROR: out of memory\n");
+ return p;
+}
+EXPORT_SYMBOL(xstrdup_wchar_to_char);