From f4c20290509d7ed3a8fd5304577e7a4cc0b9d974 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 3 Apr 2007 03:49:53 +0000 Subject: Ok, no code is left in src, it's all in src/old. We'll gradually move code back into src as it's fixed and re-org'd. This includes tests, which, I may write a unit test system into libbu++ just to make my life easier. --- src/old/stringrep.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/old/stringrep.cpp (limited to 'src/old/stringrep.cpp') diff --git a/src/old/stringrep.cpp b/src/old/stringrep.cpp new file mode 100644 index 0000000..a505f8a --- /dev/null +++ b/src/old/stringrep.cpp @@ -0,0 +1,19 @@ +#include "stringrep.h" + +int32_t stringlen( const char *s ) +{ + for( int32_t i = 0;; i++ ) + if( !s[i] ) + return i; +} + +char *stringdup( const char *s ) +{ + int len = stringlen( s ); + char *r = new char[len+1]; + for( int j = 0; j <= len; j++ ) + r[j] = s[j]; + + return r; +} + -- cgit v1.2.3