summaryrefslogtreecommitdiff
path: root/rtl-string.h
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2012-05-08 08:47:31 +1000
committerChris Johns <chrisj@rtems.org>2012-05-08 08:47:31 +1000
commitb78c02ab55ae3c0a932901896051617e1a212952 (patch)
treed8ce5cd954bc7d6a830d49f4e6abc210c77fefab /rtl-string.h
parent7f7cdc2de97f006def935f3b2788a24dd25248eb (diff)
Add RTL allocator.
Add a custom allocator that can be hooked. The default heap allocator in this code does nothing more than wrap the libc heap allocator. Fix up the RTL initialise to better handle the locking and initialisation of internal structures.
Diffstat (limited to 'rtl-string.h')
-rw-r--r--rtl-string.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/rtl-string.h b/rtl-string.h
new file mode 100644
index 0000000..00d2c9c
--- /dev/null
+++ b/rtl-string.h
@@ -0,0 +1,35 @@
+/*
+ * COPYRIGHT (c) 2012 Chris Johns <chrisj@rtems.org>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+/**
+ * @file
+ *
+ * @ingroup rtems_rtl
+ *
+ * @brief RTEMS Run-Time Linker String managment.
+ */
+
+#if !defined (_RTEMS_RTL_STRING_H_)
+#define _RTEMS_RTL_STRING_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * A string duplicate that uses the RTL allocator.
+ *
+ * @param s1 The string to duplicate.
+ * @return char* The copy of the string. NULL if there is no memory.
+ */
+char* rtems_rtl_strdup(const char *s1);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif