summaryrefslogtreecommitdiff
path: root/include/inspstring.h
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-19 15:56:42 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-19 15:56:42 +0000
commit9cf56d917d92959701694477f7944d45ad2c38ed (patch)
treea379ee905e7485c2ee825790720ed2b69ba127d1 /include/inspstring.h
parent3bbb36695383badf5b3ba0ecba070f16094ae51d (diff)
Windows support. Tested and working to compile on freebsd and linux. Next step is to make sure it actually works in windows too. ;p. Add Burlex to contributors.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7043 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/inspstring.h')
-rw-r--r--include/inspstring.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/inspstring.h b/include/inspstring.h
index 5562b3d77..1e6ba68e6 100644
--- a/include/inspstring.h
+++ b/include/inspstring.h
@@ -15,14 +15,22 @@
#define __IN_INSPSTRING_H
#include "inspircd_config.h"
+#include <string.h>
#include <cstddef>
#ifndef HAS_STRLCPY
-size_t strlcpy(char *dst, const char *src, size_t siz);
-size_t strlcat(char *dst, const char *src, size_t siz);
+CoreExport size_t strlcpy(char *dst, const char *src, size_t siz);
+CoreExport size_t strlcat(char *dst, const char *src, size_t siz);
#endif
-int charlcat(char* x,char y,int z);
-bool charremove(char* mp, char remove);
+CoreExport int charlcat(char* x,char y,int z);
+CoreExport bool charremove(char* mp, char remove);
+inline char * strnewdup(const char * s1)
+{
+ size_t len = strlen(s1) + 1;
+ char * p = new char[len];
+ memcpy(p, s1, len);
+ return p;
+}
#endif