summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-bin-debugger/tools/mrdb/apistring.h
diff options
context:
space:
mode:
authorcremno <[email protected]>2014-11-26 00:52:54 +0100
committercremno <[email protected]>2014-12-02 00:00:54 +0100
commitce5a3dbcbaae84d87c4f09d4e28523a59886c7ad (patch)
tree71f0850a72a6da2e0174c17946ac665e5b990cf5 /mrbgems/mruby-bin-debugger/tools/mrdb/apistring.h
parent1365151dcb65190b05a97768584f68cb14d584c4 (diff)
downloadmruby-ce5a3dbcbaae84d87c4f09d4e28523a59886c7ad.tar.gz
mruby-ce5a3dbcbaae84d87c4f09d4e28523a59886c7ad.zip
add mrb_debug_strdup() and mrb_debug_strndup()
They behave similar to their POSIX equivalents, except mrb_malloc_simple() is used for memory allocation and errno might not be set since ISO C99 doesn't have ENOMEM.
Diffstat (limited to 'mrbgems/mruby-bin-debugger/tools/mrdb/apistring.h')
-rw-r--r--mrbgems/mruby-bin-debugger/tools/mrdb/apistring.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/mrbgems/mruby-bin-debugger/tools/mrdb/apistring.h b/mrbgems/mruby-bin-debugger/tools/mrdb/apistring.h
new file mode 100644
index 000000000..e48478d2e
--- /dev/null
+++ b/mrbgems/mruby-bin-debugger/tools/mrdb/apistring.h
@@ -0,0 +1,14 @@
+/*
+ * apistring.h
+ */
+
+#ifndef APISTRING_H_
+#define APISTRING_H_
+
+#include "mruby.h"
+
+/* both functions return a null pointer on failure */
+char *mrb_debug_strndup(mrb_state *mrb, const char *s, size_t size);
+char *mrb_debug_strdup(mrb_state *mrb, const char *s);
+
+#endif /* APISTRING_H_ */