summaryrefslogtreecommitdiff
path: root/rtl-string.c
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2012-05-13 18:29:13 +1000
committerChris Johns <chrisj@rtems.org>2012-05-13 18:29:13 +1000
commitfb0c9b27451d420175a76a0eef733792317d225f (patch)
treefa2799063f54b4cd6324bf3f028eee40d45b87dc /rtl-string.c
parentb78c02ab55ae3c0a932901896051617e1a212952 (diff)
Support indirect pointers for strings in the object file.
Add indirect pointers and use it for the file names parts which are part of the object module.
Diffstat (limited to 'rtl-string.c')
-rw-r--r--rtl-string.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/rtl-string.c b/rtl-string.c
index cba7616..921eca0 100644
--- a/rtl-string.c
+++ b/rtl-string.c
@@ -30,3 +30,16 @@ rtems_rtl_strdup (const char *s1)
}
return s2;
}
+
+void
+rtems_rtl_str_copy (rtems_rtl_ptr_t* dst, const char* str)
+{
+ size_t len = strlen (str);
+ rtems_rtl_alloc_indirect_new (RTEMS_RTL_ALLOC_STRING, dst, len + 1);
+ if (!rtems_rtl_ptr_null (dst))
+ {
+ char* p = rtems_rtl_ptr_get (dst);
+ memcpy (p, str, len);
+ p[len] = '\0';
+ }
+}