]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - win/inspircd_win32wrapper.cpp
Test commit
[user/henk/code/inspircd.git] / win / inspircd_win32wrapper.cpp
index 7e72220e858d6bcebeb204cd94f7f83eddccda0f..03d89a7aa5a8f0b932d7cf77e61dadf009f027a7 100644 (file)
@@ -91,71 +91,6 @@ int inet_pton(int af, const char *src, void *dst)
        return rv;
 }
 
-char * strtok_r(char *_String, const char *_Control, char **_Context)
-{
-       unsigned char *str;
-       const unsigned char *ctl = (const unsigned char*)_Control;
-       unsigned char map[32];
-
-       if (_Context == 0 || !_Control)
-               return 0;
-
-       if (!(_String != NULL || *_Context != NULL))
-               return 0;
-
-       memset(map, 0, 32);
-
-       do {
-               map[*ctl >> 3] |= (1 << (*ctl & 7));
-       } while (*ctl++);
-
-       /* If string is NULL, set str to the saved
-       * pointer (i.e., continue breaking tokens out of the string
-       * from the last strtok call) */
-       if (_String != NULL)
-       {
-               str = (unsigned char*)_String;
-       }
-       else
-       {
-               str = (unsigned char*)*_Context;
-       }
-
-       /* Find beginning of token (skip over leading delimiters). Note that
-       * there is no token iff this loop sets str to point to the terminal
-       * null (*str == 0) */
-       while ((map[*str >> 3] & (1 << (*str & 7))) && *str != 0)
-       {
-               str++;
-       }
-
-       _String = (char*)str;
-
-       /* Find the end of the token. If it is not the end of the string,
-       * put a null there. */
-       for ( ; *str != 0 ; str++ )
-       {
-               if (map[*str >> 3] & (1 << (*str & 7)))
-               {
-                       *str++ = 0;
-                       break;
-               }
-       }
-
-       /* Update context */
-       *_Context = (char*)str;
-
-       /* Determine if a token has been found. */
-       if (_String == (char*)str)
-       {
-               return NULL;
-       }
-       else
-       {
-               return _String;
-       }
-}
-
 void setcolor(int color_code)
 {
        SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color_code);
@@ -776,3 +711,12 @@ int getcpu()
        pclsObj->Release();
        return -1;
 }
+
+void usleep(unsigned long usecs)
+{
+       if (usecs > 0UL)
+       {
+               unsigned long millis = ((usecs + 999UL) / 1000UL);
+               SleepEx(millis, false);
+       }
+}