5 Author: Pekka Riikonen <priikone@silcnet.org>
7 Copyright (C) 2001 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
22 #include "silcincludes.h"
24 /* XXX GNU regex may work on Win32 too!! */
25 char *silc_string_regexify(const char *string)
27 return strdup(string);
30 char *silc_string_regex_combine(const char *string1, const char *string2)
32 return strdup(string1);
35 int silc_string_regex_match(const char *regex, const char *string)
40 int silc_string_match(const char *string1, const char *string2)
45 #define FILETIME_1970 0x019db1ded53e8000
46 const BYTE DWLEN = sizeof(DWORD) * 8;
48 /* Return current time in struct timeval. Code ripped from some xntp
49 implementation on http://src.openresources.com. */
51 int silc_gettimeofday(struct timeval *tv)
56 GetSystemTimeAsFileTime(&ft);
57 msec = (__int64) ft.dwHighDateTime << DWLEN | ft.dwLowDateTime;
58 msec = (msec - FILETIME_1970) / 10;
59 tv->tv_sec = (long) (msec / 1000000);
60 tv->tv_usec = (long) (msec % 1000000);