summaryrefslogtreecommitdiffstats
path: root/client/windows/main.cpp
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2014-11-21 11:01:17 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2014-12-03 11:31:17 +0100
commit1876971442ef808b5dcdaa5dc12df617f2179cb5 (patch)
tree54cdeb35593396e8319ae079f900a18808fb201a /client/windows/main.cpp
parentb532ef0866cefe260ad0f08550f7c40d3580d0d7 (diff)
downloadspice-1876971442ef808b5dcdaa5dc12df617f2179cb5.tar.gz
spice-1876971442ef808b5dcdaa5dc12df617f2179cb5.tar.xz
spice-1876971442ef808b5dcdaa5dc12df617f2179cb5.zip
client: Remove client code
The client has been superseded by virt-viewer ( http://virt-manager.org/download/sources/virt-viewer/ ) and is no longer being maintained.
Diffstat (limited to 'client/windows/main.cpp')
-rw-r--r--client/windows/main.cpp110
1 files changed, 0 insertions, 110 deletions
diff --git a/client/windows/main.cpp b/client/windows/main.cpp
deleted file mode 100644
index 7a833055..00000000
--- a/client/windows/main.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- Copyright (C) 2009 Red Hat, Inc.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "common.h"
-#include <fstream>
-#include <windows.h>
-extern "C" {
-#include "pthread.h"
-}
-
-#include "application.h"
-#include "debug.h"
-#include "utils.h"
-
-HINSTANCE instance = NULL;
-
-static void init_winsock()
-{
- WSADATA wsaData;
- int res;
-
- if ((res = WSAStartup(MAKEWORD(2, 2), &wsaData)) != 0) {
- THROW("WSAStartup failed %d", res);
- }
-}
-
-#ifdef __MINGW32__
-// XXX: for mingw32 we can do both actually, but it seems easier
-// to just use the autoconf provided PACKAGE_VERSION.
-static void init_version_string()
-{
-}
-#else
-const char* PACKAGE_VERSION = "???";
-static char _version_string[40];
-
-static void init_version_string()
-{
- DWORD handle;
- DWORD verrsion_inf_size = GetFileVersionInfoSizeA(__argv[0], &handle);
- if (verrsion_inf_size == 0) {
- return;
- }
- AutoArray<uint8_t> info_buf (new uint8_t[verrsion_inf_size]);
- if (!GetFileVersionInfoA(__argv[0], handle, verrsion_inf_size, info_buf.get())) {
- return;
- }
- UINT size;
- VS_FIXEDFILEINFO *file_info;
- if (!VerQueryValueA(info_buf.get(), "\\", (VOID**)&file_info, &size) ||
- size < sizeof(VS_FIXEDFILEINFO)) {
- return;
- }
- sprintf(_version_string, "%d.%d.%d.%d",
- (int)(file_info->dwFileVersionMS >> 16),
- (int)(file_info->dwFileVersionMS & 0x0ffff),
- (int)(file_info->dwFileVersionLS >> 16),
- (int)(file_info->dwFileVersionLS & 0x0ffff));
- PACKAGE_VERSION = _version_string;
-}
-#endif
-
-int WINAPI WinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nCmdShow)
-{
- int exit_val;
-
- instance = hInstance;
-
- try {
- init_version_string();
- pthread_win32_process_attach_np();
- init_winsock();
- exit_val = Application::main(__argc, __argv, PACKAGE_VERSION);
- LOG_INFO("Spice client terminated (exitcode = %d)", exit_val);
- } catch (Exception& e) {
- LOG_ERROR("unhandle exception: %s", e.what());
- exit_val = e.get_error_code();
- } catch (std::exception& e) {
- LOG_ERROR("unhandle exception: %s", e.what());
- exit_val = SPICEC_ERROR_CODE_ERROR;
- } catch (...) {
- LOG_ERROR("unhandled exception");
- exit_val = SPICEC_ERROR_CODE_ERROR;
- }
-
- spice_log_cleanup();
- pthread_win32_process_detach_np();
-
- return exit_val;
-}