Blame glib/glib/gwin32.h

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