summaryrefslogtreecommitdiff
path: root/StdLib/Include/string.h
diff options
context:
space:
mode:
authordarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2011-07-30 00:30:44 +0000
committerdarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2011-07-30 00:30:44 +0000
commitd7ce700605e1af0e455e31ec11f19ff21d26b525 (patch)
tree243b582ac3350e8c6ce6ca96fff13805318fd65c /StdLib/Include/string.h
parentf766dd76fde231ecd4f2e9faf99293e90902cebb (diff)
downloadedk2-platforms-d7ce700605e1af0e455e31ec11f19ff21d26b525.tar.xz
Add Socket Libraries.
Add Posix functions for porting compatibility. Fix compliance issues with ISO/IEC 9899:199409 New Functions: setenv(), fparseln(), GetFileNameFromPath(), rename(), realpath(), setprogname(), getprogname(), strlcat(), strlcpy(), strsep(), setitimer(), getitimer(), timegm(), getopt(), basename(), mkstemp(), ffs(), vsnprintf(), snprintf(), getpass(), usleep(), select(), writev(), strcasecmp(), getcwd(), chdir(), tcgetpgrp(), getpgrp(), gettimeofday(), bcopy(), git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12061 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib/Include/string.h')
-rw-r--r--StdLib/Include/string.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/StdLib/Include/string.h b/StdLib/Include/string.h
index 992ca0ba18..517b9e6e98 100644
--- a/StdLib/Include/string.h
+++ b/StdLib/Include/string.h
@@ -324,15 +324,31 @@ int strerror_r(int, char *, size_t);
int strcasecmp(const char *s1, const char *s2);
void *memccpy (void *, const void *, int, size_t);
int strncasecmp(const char *s1, const char *s2, size_t n);
+size_t strlcpy(char *destination, const char *source, size_t size);
+size_t strlcat(char *destination, const char *source, size_t size);
-// bcopy is same as memcpy but it is a void function, being used in socket lib
-#define bcopy(a,b,c) ( memcpy((void *)a, (void *)b, (size_t)c))
+// bcopy is is a void function with the src/dest arguments reversed, being used in socket lib
+#define bcopy(a,b,c) ( memcpy((void *)b, (const void *)a, (size_t)c))
// bcmp is same as memcmp, returns 0 for successful compare, non-zero otherwise
#define bcmp(a,b,c) ( memcmp((void *)a, (void *)b, (size_t)c))
-//strsep is the same as strtok, the only difference is for strsep the 1st parameter is a char**
-#define strsep(a,b) (strtok(*a,b))
+/*
+ * Get next token from string *stringp, where tokens are possibly-empty
+ * strings separated by characters from delim.
+ *
+ * Writes NULs into the string at *stringp to end tokens.
+ * delim need not remain constant from call to call.
+ * On return, *stringp points past the last NUL written (if there might
+ * be further tokens), or is NULL (if there are definitely no more tokens).
+ *
+ * If *stringp is NULL, strsep returns NULL.
+ */
+char *
+strsep(
+ register char **stringp,
+ register const char *delim
+ );
__END_DECLS