mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-11 08:20:17 +00:00
preliminary update checker
This commit is contained in:
36
src/fe-gtk/check-version.c
Normal file
36
src/fe-gtk/check-version.c
Normal file
@@ -0,0 +1,36 @@
|
||||
#include <windows.h>
|
||||
#include <wininet.h>
|
||||
|
||||
char* check_version ()
|
||||
{
|
||||
HINTERNET hINet, hFile;
|
||||
hINet = InternetOpen("XChat-WDK Update Checker", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );
|
||||
|
||||
if (!hINet)
|
||||
{
|
||||
return "error";
|
||||
}
|
||||
|
||||
hFile = InternetOpenUrl (hINet, "http://xchat-wdk.googlecode.com/hg/version.txt", NULL, 0, 0, 0);
|
||||
|
||||
if (hFile)
|
||||
{
|
||||
static char buffer[1024];
|
||||
DWORD dwRead;
|
||||
while (InternetReadFile(hFile, buffer, 1023, &dwRead))
|
||||
{
|
||||
if (dwRead == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
buffer[dwRead] = 0;
|
||||
}
|
||||
|
||||
return buffer;
|
||||
InternetCloseHandle (hFile);
|
||||
}
|
||||
|
||||
InternetCloseHandle (hINet);
|
||||
|
||||
return "error";
|
||||
}
|
||||
1
src/fe-gtk/check-version.h
Normal file
1
src/fe-gtk/check-version.h
Normal file
@@ -0,0 +1 @@
|
||||
char* check_version ();
|
||||
@@ -4,7 +4,7 @@ CFLAGS = $(CFLAGS) /Ox /c /MD /MP2 /W0 /nologo /DWIN32 /DG_DISABLE_CAST_CHECKS /
|
||||
CFLAGS = $(CFLAGS) -Ic:\mozilla-build\build\xchat-wdk\plugins
|
||||
CPPFLAGS = /c /MD /W0 /nologo /DWIN32
|
||||
LDFLAGS = /subsystem:windows /nologo
|
||||
LIBS = $(LIBS) gdi32.lib shell32.lib user32.lib advapi32.lib imm32.lib ole32.lib winmm.lib ws2_32.lib
|
||||
LIBS = $(LIBS) gdi32.lib shell32.lib user32.lib advapi32.lib imm32.lib ole32.lib winmm.lib ws2_32.lib wininet.lib
|
||||
|
||||
!ifdef X64
|
||||
#############################################################
|
||||
@@ -89,6 +89,7 @@ ascii.obj \
|
||||
banlist.obj \
|
||||
chanlist.obj \
|
||||
chanview.obj \
|
||||
check-version.obj \
|
||||
custom-list.obj \
|
||||
dccgui.obj \
|
||||
editlist.obj \
|
||||
|
||||
Reference in New Issue
Block a user