X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Fwin32%2Fsilcwin32util.c;h=fad5f5996689eeea4831d13130aa5ffac873ed58;hb=40f8443d8d3a6577336ee66d18e04d9ac4d956bb;hp=e12fa0a07ea55ca135c55794ea2bcd639ea36ac1;hpb=66e78e8f5c07f7048fb90075737c38f5452ec5c2;p=silc.git diff --git a/lib/silcutil/win32/silcwin32util.c b/lib/silcutil/win32/silcwin32util.c index e12fa0a0..fad5f599 100644 --- a/lib/silcutil/win32/silcwin32util.c +++ b/lib/silcutil/win32/silcwin32util.c @@ -2,14 +2,13 @@ silcwin32util.c - Author: Pekka Riikonen + Author: Pekka Riikonen - Copyright (C) 2001 Pekka Riikonen + Copyright (C) 2001 - 2005 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,7 +18,28 @@ */ /* $Id$ */ -#include "silcincludes.h" +#include "silc.h" + +/* XXX GNU regex may work on Win32 too!! */ +char *silc_string_regexify(const char *string) +{ + return strdup(string); +} + +char *silc_string_regex_combine(const char *string1, const char *string2) +{ + return strdup(string1); +} + +int silc_string_regex_match(const char *regex, const char *string) +{ + return TRUE; +} + +int silc_string_match(const char *string1, const char *string2) +{ + return TRUE; +} #define FILETIME_1970 0x019db1ded53e8000 const BYTE DWLEN = sizeof(DWORD) * 8; @@ -40,3 +60,21 @@ int silc_gettimeofday(struct timeval *tv) return 0; } + +char *silc_get_username(void) +{ + DWORD maxlen = 128; + char username[128]; + GetUserName(username, &maxlen); + return strdup(username); +} + +char *silc_get_real_name(void) +{ + return silc_get_username(); +} + +int silc_file_set_nonblock(int fd) +{ + return fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK); +}