From 253f4ee284db2dc73c18d6a17d23f4fdff3ca8da Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Sat, 2 Aug 2008 10:55:56 +0000 Subject: [PATCH] - Remove unneeded code, which would have its 10 years anniversary in ~20 days (committed originally by Rex back in August, 1998, revision number 8(!), and coded by David Welch, never touched since then). svn path=/trunk/; revision=35030 --- reactos/ntoskrnl/ntoskrnl-generic.rbuild | 1 - reactos/ntoskrnl/rtl/strtok.c | 109 ----------------------- 2 files changed, 110 deletions(-) delete mode 100644 reactos/ntoskrnl/rtl/strtok.c diff --git a/reactos/ntoskrnl/ntoskrnl-generic.rbuild b/reactos/ntoskrnl/ntoskrnl-generic.rbuild index fd1aa231725..5e0a14b2b58 100644 --- a/reactos/ntoskrnl/ntoskrnl-generic.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-generic.rbuild @@ -443,7 +443,6 @@ libsupp.c misc.c - strtok.c access.c diff --git a/reactos/ntoskrnl/rtl/strtok.c b/reactos/ntoskrnl/rtl/strtok.c deleted file mode 100644 index 98ed06b0881..00000000000 --- a/reactos/ntoskrnl/rtl/strtok.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/rtl/strtok.c - * PURPOSE: Unicode and thread safe implementation of strtok - * - * PROGRAMMERS: David Welch (welch@mcmail.com) - */ - -/* INCLUDES *****************************************************************/ - -#include -#include - - -/* FUNCTIONS *****************************************************************/ - -char* __cdecl strtok(char *s, const char *delim) -{ - const char *spanp; - int c, sc; - char *tok; - static char *last; - - if (s == NULL && (s = last) == NULL) - return (NULL); - - /* - * Skip (span) leading delimiters (s += strspn(s, delim), sort of). - */ - cont: - c = *s++; - for (spanp = delim; (sc = *spanp++) != 0;) { - if (c == sc) - goto cont; - } - - if (c == 0) { /* no non-delimiter characters */ - last = NULL; - return (NULL); - } - tok = s - 1; - - /* - * Scan token (scan for delimiters: s += strcspn(s, delim), sort of). - * Note that delim must have one NUL; we stop if we see that, too. - */ - for (;;) { - c = *s++; - spanp = delim; - do { - if ((sc = *spanp++) == c) { - if (c == 0) - s = NULL; - else - s[-1] = 0; - last = s; - return (tok); - } - } while (sc != 0); - } - /* NOTREACHED */ -} - -PWSTR RtlStrtok(PUNICODE_STRING _string, PWSTR _sep, - PWSTR* temp) -/* - * FUNCTION: Splits a string into tokens - * ARGUMENTS: - * string = string to operate on - * if NULL then continue with previous string - * sep = Token deliminators - * temp = Tempory storage provided by the caller - * ARGUMENTS: Returns the beginning of the next token - */ -{ - PWSTR string; - PWSTR sep; - PWSTR start; - - if (_string!=NULL) - { - string = _string->Buffer; - } - else - { - string = *temp; - } - - start = string; - - while ((*string)!=0) - { - sep = _sep; - while ((*sep)!=0) - { - if ((*string)==(*sep)) - { - *string=0; - *temp=string+1; - return(start); - } - sep++; - } - string++; - } - *temp=NULL; - return(start); -}