2000-10-19 17:52:12 +00:00
|
|
|
/* GLIB - Library of useful routines for C programming
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
|
|
|
* 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 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
|
2014-01-23 12:58:29 +01:00
|
|
|
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
2000-10-19 17:52:12 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Modified by the GLib Team and others 1997-2000. See the AUTHORS
|
|
|
|
* file for a list of people on the GLib Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
2008-03-14 19:30:38 +00:00
|
|
|
* GLib at ftp://ftp.gtk.org/pub/gtk/.
|
2000-10-19 17:52:12 +00:00
|
|
|
*/
|
|
|
|
|
2012-12-27 23:43:14 -05:00
|
|
|
#ifndef __G_WIN32_H__
|
|
|
|
#define __G_WIN32_H__
|
|
|
|
|
2011-10-12 00:24:46 -04:00
|
|
|
#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
|
2008-03-14 19:30:38 +00:00
|
|
|
#error "Only <glib.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2001-06-26 16:01:21 +00:00
|
|
|
#include <glib/gtypes.h>
|
2000-10-19 17:52:12 +00:00
|
|
|
|
2001-03-09 21:31:21 +00:00
|
|
|
#ifdef G_PLATFORM_WIN32
|
2000-10-19 17:52:12 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2001-03-09 21:31:21 +00:00
|
|
|
#ifndef MAXPATHLEN
|
2000-10-19 17:52:12 +00:00
|
|
|
#define MAXPATHLEN 1024
|
2001-03-09 21:31:21 +00:00
|
|
|
#endif
|
2000-10-19 17:52:12 +00:00
|
|
|
|
2001-03-09 21:31:21 +00:00
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
|
2000-10-19 17:52:12 +00:00
|
|
|
/*
|
|
|
|
* To get prototypes for the following POSIXish functions, you have to
|
|
|
|
* include the indicated non-POSIX headers. The functions are defined
|
2007-05-13 20:46:59 +00:00
|
|
|
* in OLDNAMES.LIB (MSVC) or -lmoldname-msvc (mingw32). But note that
|
|
|
|
* for POSIX functions that take or return file names in the system
|
|
|
|
* codepage, in many cases you would want to use the GLib wrappers in
|
|
|
|
* gstdio.h and UTF-8 instead.
|
2000-10-19 17:52:12 +00:00
|
|
|
*
|
|
|
|
* getcwd: <direct.h> (MSVC), <io.h> (mingw32)
|
|
|
|
* getpid: <process.h>
|
|
|
|
* access: <io.h>
|
|
|
|
* unlink: <stdio.h> or <io.h>
|
|
|
|
* open, read, write, lseek, close: <io.h>
|
2003-01-02 00:30:22 +00:00
|
|
|
* rmdir: <io.h>
|
2007-05-13 20:46:59 +00:00
|
|
|
* pipe: <io.h> (actually, _pipe())
|
2000-10-19 17:52:12 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* For some POSIX functions that are not provided by the MS runtime,
|
2004-09-15 19:12:19 +00:00
|
|
|
* we provide emulation functions in glib, which are prefixed with
|
|
|
|
* g_win32_. Or that was the idea at some time, but there is just one
|
|
|
|
* of those:
|
2000-10-19 17:52:12 +00:00
|
|
|
*/
|
2013-01-13 15:34:27 -05:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2001-03-09 21:31:21 +00:00
|
|
|
gint g_win32_ftruncate (gint f,
|
2000-10-19 17:52:12 +00:00
|
|
|
guint size);
|
2001-03-09 21:31:21 +00:00
|
|
|
#endif /* G_OS_WIN32 */
|
|
|
|
|
2000-10-19 17:52:12 +00:00
|
|
|
/* The MS setlocale uses locale names of the form "English_United
|
|
|
|
* States.1252" etc. We want the Unixish standard form "en", "zh_TW"
|
|
|
|
* etc. This function gets the current thread locale from Windows and
|
|
|
|
* returns it as a string of the above form for use in forming file
|
|
|
|
* names etc. The returned string should be deallocated with g_free().
|
|
|
|
*/
|
2013-01-13 15:34:27 -05:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2001-02-17 23:30:48 +00:00
|
|
|
gchar* g_win32_getlocale (void);
|
2000-10-19 17:52:12 +00:00
|
|
|
|
|
|
|
/* Translate a Win32 error code (as returned by GetLastError()) into
|
|
|
|
* the corresponding message. The returned string should be deallocated
|
|
|
|
* with g_free().
|
|
|
|
*/
|
2013-01-13 15:34:27 -05:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2001-02-17 23:30:48 +00:00
|
|
|
gchar* g_win32_error_message (gint error);
|
2000-10-19 17:52:12 +00:00
|
|
|
|
2013-01-13 15:34:27 -05:00
|
|
|
#ifndef _WIN64
|
|
|
|
GLIB_DEPRECATED
|
2006-12-27 14:50:17 +00:00
|
|
|
gchar* g_win32_get_package_installation_directory (const gchar *package,
|
|
|
|
const gchar *dll_name);
|
2001-01-17 21:37:32 +00:00
|
|
|
|
2013-01-13 15:34:27 -05:00
|
|
|
GLIB_DEPRECATED
|
2006-12-27 14:50:17 +00:00
|
|
|
gchar* g_win32_get_package_installation_subdirectory (const gchar *package,
|
|
|
|
const gchar *dll_name,
|
|
|
|
const gchar *subdir);
|
2008-09-13 20:23:17 +00:00
|
|
|
#endif
|
|
|
|
|
2013-01-13 15:34:27 -05:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2008-02-24 00:38:01 +00:00
|
|
|
gchar* g_win32_get_package_installation_directory_of_module (gpointer hmodule);
|
|
|
|
|
2013-01-13 15:34:27 -05:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2004-08-25 15:32:50 +00:00
|
|
|
guint g_win32_get_windows_version (void);
|
|
|
|
|
2013-01-13 15:34:27 -05:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2005-04-27 09:50:09 +00:00
|
|
|
gchar* g_win32_locale_filename_from_utf8 (const gchar *utf8filename);
|
|
|
|
|
2014-01-12 12:13:42 -05:00
|
|
|
GLIB_AVAILABLE_IN_2_40
|
|
|
|
gchar ** g_win32_get_command_line (void);
|
|
|
|
|
2006-08-29 22:45:00 +00:00
|
|
|
/* As of GLib 2.14 we only support NT-based Windows */
|
|
|
|
#define G_WIN32_IS_NT_BASED() TRUE
|
|
|
|
#define G_WIN32_HAVE_WIDECHAR_API() TRUE
|
2004-08-25 15:32:50 +00:00
|
|
|
|
2000-10-19 17:52:12 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
2001-03-09 21:31:21 +00:00
|
|
|
#endif /* G_PLATFORM_WIN32 */
|
2000-10-19 17:52:12 +00:00
|
|
|
|
2012-11-15 18:18:54 -05:00
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
#ifdef _WIN64
|
|
|
|
#define g_win32_get_package_installation_directory g_win32_get_package_installation_directory_utf8
|
|
|
|
#define g_win32_get_package_installation_subdirectory g_win32_get_package_installation_subdirectory_utf8
|
|
|
|
#endif
|
|
|
|
|
2013-01-13 15:34:27 -05:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2012-11-15 18:18:54 -05:00
|
|
|
gchar *g_win32_get_package_installation_directory_utf8 (const gchar *package,
|
|
|
|
const gchar *dll_name);
|
2013-01-13 15:34:27 -05:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2012-11-15 18:18:54 -05:00
|
|
|
gchar *g_win32_get_package_installation_subdirectory_utf8 (const gchar *package,
|
|
|
|
const gchar *dll_name,
|
|
|
|
const gchar *subdir);
|
|
|
|
|
|
|
|
#endif /* G_OS_WIN32 */
|
|
|
|
|
2000-11-14 21:40:28 +00:00
|
|
|
#endif /* __G_WIN32_H__ */
|