Blame glib/gwin32.h

Packit ae235b
/* GLIB - Library of useful routines for C programming
Packit ae235b
 * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
Packit ae235b
 *
Packit ae235b
 * This library is free software; you can redistribute it and/or
Packit ae235b
 * modify it under the terms of the GNU Lesser General Public
Packit ae235b
 * License as published by the Free Software Foundation; either
Packit ae235b
 * version 2.1 of the License, or (at your option) any later version.
Packit ae235b
 *
Packit ae235b
 * This library is distributed in the hope that it will be useful,
Packit ae235b
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit ae235b
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit ae235b
 * Lesser General Public License for more details.
Packit ae235b
 *
Packit ae235b
 * You should have received a copy of the GNU Lesser General Public
Packit ae235b
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
Packit ae235b
 */
Packit ae235b
Packit ae235b
/*
Packit ae235b
 * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
Packit ae235b
 * file for a list of people on the GLib Team.  See the ChangeLog
Packit ae235b
 * files for a list of changes.  These files are distributed with
Packit ae235b
 * GLib at ftp://ftp.gtk.org/pub/gtk/.
Packit ae235b
 */
Packit ae235b
Packit ae235b
#ifndef __G_WIN32_H__
Packit ae235b
#define __G_WIN32_H__
Packit ae235b
Packit ae235b
#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
Packit ae235b
#error "Only <glib.h> can be included directly."
Packit ae235b
#endif
Packit ae235b
Packit ae235b
#include <glib/gtypes.h>
Packit ae235b
Packit ae235b
#ifdef G_PLATFORM_WIN32
Packit ae235b
Packit ae235b
G_BEGIN_DECLS
Packit ae235b
Packit ae235b
#ifndef MAXPATHLEN
Packit ae235b
#define MAXPATHLEN 1024
Packit ae235b
#endif
Packit ae235b
Packit ae235b
#ifdef G_OS_WIN32
Packit ae235b
Packit ae235b
/*
Packit ae235b
 * To get prototypes for the following POSIXish functions, you have to
Packit ae235b
 * include the indicated non-POSIX headers. The functions are defined
Packit ae235b
 * in OLDNAMES.LIB (MSVC) or -lmoldname-msvc (mingw32). But note that
Packit ae235b
 * for POSIX functions that take or return file names in the system
Packit ae235b
 * codepage, in many cases you would want to use the GLib wrappers in
Packit ae235b
 * gstdio.h and UTF-8 instead.
Packit ae235b
 *
Packit ae235b
 * getcwd: <direct.h> (MSVC), <io.h> (mingw32)
Packit ae235b
 * getpid: <process.h>
Packit ae235b
 * access: <io.h>
Packit ae235b
 * unlink: <stdio.h> or <io.h>
Packit ae235b
 * open, read, write, lseek, close: <io.h>
Packit ae235b
 * rmdir: <io.h>
Packit ae235b
 * pipe: <io.h> (actually, _pipe())
Packit ae235b
 */
Packit ae235b
Packit ae235b
/* For some POSIX functions that are not provided by the MS runtime,
Packit ae235b
 * we provide emulation functions in glib, which are prefixed with
Packit ae235b
 * g_win32_. Or that was the idea at some time, but there is just one
Packit ae235b
 * of those:
Packit ae235b
 */
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gint		g_win32_ftruncate	(gint		 f,
Packit ae235b
					 guint		 size);
Packit ae235b
#endif /* G_OS_WIN32 */
Packit ae235b
Packit ae235b
/* The MS setlocale uses locale names of the form "English_United
Packit ae235b
 * States.1252" etc. We want the Unixish standard form "en", "zh_TW"
Packit ae235b
 * etc. This function gets the current thread locale from Windows and
Packit ae235b
 * returns it as a string of the above form for use in forming file
Packit ae235b
 * names etc. The returned string should be deallocated with g_free().
Packit ae235b
 */
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gchar* 		g_win32_getlocale  (void);
Packit ae235b
Packit ae235b
/* Translate a Win32 error code (as returned by GetLastError()) into
Packit ae235b
 * the corresponding message. The returned string should be deallocated
Packit ae235b
 * with g_free().
Packit ae235b
 */
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gchar*          g_win32_error_message (gint error);
Packit ae235b
Packit ae235b
GLIB_DEPRECATED
Packit ae235b
gchar*          g_win32_get_package_installation_directory (const gchar *package,
Packit ae235b
							    const gchar *dll_name);
Packit ae235b
Packit ae235b
GLIB_DEPRECATED
Packit ae235b
gchar*          g_win32_get_package_installation_subdirectory (const gchar *package,
Packit ae235b
							       const gchar *dll_name,
Packit ae235b
							       const gchar *subdir);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gchar*          g_win32_get_package_installation_directory_of_module (gpointer hmodule);
Packit ae235b
Packit ae235b
GLIB_DEPRECATED_IN_2_44_FOR(g_win32_check_windows_version)
Packit ae235b
guint		g_win32_get_windows_version (void);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gchar*          g_win32_locale_filename_from_utf8 (const gchar *utf8filename);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_40
Packit ae235b
gchar **        g_win32_get_command_line (void);
Packit ae235b
Packit ae235b
/* As of GLib 2.14 we only support NT-based Windows */
Packit ae235b
#define G_WIN32_IS_NT_BASED() TRUE
Packit ae235b
#define G_WIN32_HAVE_WIDECHAR_API() TRUE
Packit ae235b
Packit ae235b
/**
Packit ae235b
 * GWin32OSType:
Packit ae235b
 * @G_WIN32_OS_ANY: The running system can be a workstation or a server edition of
Packit ae235b
 *  Windows.  The type of the running system is therefore not checked.
Packit ae235b
 * @G_WIN32_OS_WORKSTATION: The running system is a workstation edition of Windows,
Packit ae235b
 *  such as Windows 7 Professional.
Packit ae235b
 * @G_WIN32_OS_SERVER: The running system is a server edition of Windows, such as
Packit ae235b
 *  Windows Server 2008 R2.
Packit ae235b
 *
Packit ae235b
 * Type of Windows edition to check for at run-time.
Packit ae235b
 **/
Packit ae235b
typedef enum
Packit ae235b
{
Packit ae235b
  G_WIN32_OS_ANY,
Packit ae235b
  G_WIN32_OS_WORKSTATION,
Packit ae235b
  G_WIN32_OS_SERVER,
Packit ae235b
} GWin32OSType;
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_44
Packit ae235b
gboolean g_win32_check_windows_version (const gint major,
Packit ae235b
                                        const gint minor,
Packit ae235b
                                        const gint spver,
Packit ae235b
                                        const GWin32OSType os_type);
Packit ae235b
Packit ae235b
G_END_DECLS
Packit ae235b
Packit ae235b
#endif	 /* G_PLATFORM_WIN32 */
Packit ae235b
Packit ae235b
#endif /* __G_WIN32_H__ */