summaryrefslogtreecommitdiff
path: root/nuttx/lib
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-08-16 13:47:33 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-08-16 13:47:33 +0000
commit4764ba54f9306b0e39ccf5e3a0dd2f40604ea848 (patch)
treedeab40afb7173ce377032f140d88f4fbf5ae16e8 /nuttx/lib
parent24738c1122691d74a8a3b7713c2878d5ed32486c (diff)
downloadpx4-nuttx-4764ba54f9306b0e39ccf5e3a0dd2f40604ea848.tar.gz
px4-nuttx-4764ba54f9306b0e39ccf5e3a0dd2f40604ea848.tar.bz2
px4-nuttx-4764ba54f9306b0e39ccf5e3a0dd2f40604ea848.zip
Remove duplicate strtok() implementatin
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@822 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib')
-rw-r--r--nuttx/lib/lib_strtok.c24
-rw-r--r--nuttx/lib/lib_strtokr.c61
2 files changed, 24 insertions, 61 deletions
diff --git a/nuttx/lib/lib_strtok.c b/nuttx/lib/lib_strtok.c
index d72ef2383..5a15eb701 100644
--- a/nuttx/lib/lib_strtok.c
+++ b/nuttx/lib/lib_strtok.c
@@ -1,7 +1,7 @@
-/************************************************************
+/****************************************************************************
* lib_strtok.c
*
- * Copyright (C) 2007 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,25 +31,25 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Included Files
- ************************************************************/
+ ****************************************************************************/
#include <string.h>
-/************************************************************
+/****************************************************************************
* Private Data
- ************************************************************/
+ ****************************************************************************/
static char *g_saveptr = NULL;
-/************************************************************
+/****************************************************************************
* Public Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Name: strtok
*
* Description:
@@ -79,7 +79,7 @@ static char *g_saveptr = NULL;
* strtok() returns a pointer to the next token, or NULL
* if there are no more tokens.
*
- ************************************************************/
+ ****************************************************************************/
char *strtok(char *str, const char *delim)
{
diff --git a/nuttx/lib/lib_strtokr.c b/nuttx/lib/lib_strtokr.c
index be9c43797..aacacce07 100644
--- a/nuttx/lib/lib_strtokr.c
+++ b/nuttx/lib/lib_strtokr.c
@@ -1,7 +1,7 @@
-/************************************************************
+/****************************************************************************
* lib_strtokr.c
*
- * Copyright (C) 2007 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,25 +31,25 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Included Files
- ************************************************************/
+ ****************************************************************************/
#include <string.h>
-/************************************************************
+/****************************************************************************
* Private Data
- ************************************************************/
+ ****************************************************************************/
static char *g_saveptr = NULL;
-/************************************************************
+/****************************************************************************
* Public Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Name: strtok_r
*
* Description:
@@ -90,7 +90,7 @@ static char *g_saveptr = NULL;
* strtok_r() returns a pointer to the next token, or NULL
* if there are no more tokens.
*
- ************************************************************/
+ ****************************************************************************/
char *strtok_r(char *str, const char *delim, char **saveptr)
{
@@ -157,40 +157,3 @@ char *strtok_r(char *str, const char *delim, char **saveptr)
}
return pbegin;
}
-
-/************************************************************
- * Name: strtok
- *
- * Description:
- * The strtok() function parses a string into a
- * sequence of tokens. On the first call to strtok() the
- * string to be parsed should be specified in 'str'. In
- * each subsequent call that should parse the same string,
- * 'str' should be NULL.
- *
- * The 'delim' argument specifies a set of characters that
- * delimit the tokens in the parsed string. The caller
- * may specify different strings in delim in successive
- * calls that parse the same string.
- *
- * Each call to strtok() returns a pointer to a null-
- * terminated string containing the next token. This
- * string does not include the delimiting character. If
- * no more tokens are found, strtok() returns NULL.
- *
- * A sequence of two or more contiguous delimiter
- * characters in the parsed string is considered to be a
- * single delimiter. Delimiter characters at the start or
- * end of the string are ignored. The tokens returned by
- * strtok() are always non-empty strings.
- *
- * Return
- * strtok() returns a pointer to the next token, or NULL
- * if there are no more tokens.
- *
- ************************************************************/
-
-char *strtok(char *str, const char *delim)
-{
- return strtok_r(str, delim, &g_saveptr);
-}