williamr@2
|
1 |
/* GLIB - Library of useful routines for C programming
|
williamr@2
|
2 |
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
williamr@2
|
3 |
*
|
williamr@2
|
4 |
* This library is free software; you can redistribute it and/or
|
williamr@2
|
5 |
* modify it under the terms of the GNU Lesser General Public
|
williamr@2
|
6 |
* License as published by the Free Software Foundation; either
|
williamr@2
|
7 |
* version 2 of the License, or (at your option) any later version.
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* This library is distributed in the hope that it will be useful,
|
williamr@2
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
williamr@2
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
williamr@2
|
12 |
* Lesser General Public License for more details.
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* You should have received a copy of the GNU Lesser General Public
|
williamr@2
|
15 |
* License along with this library; if not, write to the
|
williamr@2
|
16 |
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
williamr@2
|
17 |
* Boston, MA 02111-1307, USA.
|
williamr@2
|
18 |
*/
|
williamr@2
|
19 |
|
williamr@2
|
20 |
/*
|
williamr@2
|
21 |
* Modified by the GLib Team and others 1997-2000. See the AUTHORS
|
williamr@2
|
22 |
* file for a list of people on the GLib Team. See the ChangeLog
|
williamr@2
|
23 |
* files for a list of changes. These files are distributed with
|
williamr@2
|
24 |
* GLib at ftp://ftp.gtk.org/pub/gtk/.
|
williamr@2
|
25 |
*/
|
williamr@2
|
26 |
|
williamr@2
|
27 |
#ifndef __G_WIN32_H__
|
williamr@2
|
28 |
#define __G_WIN32_H__
|
williamr@2
|
29 |
|
williamr@2
|
30 |
#include <glib/gtypes.h>
|
williamr@2
|
31 |
|
williamr@2
|
32 |
#ifdef G_PLATFORM_WIN32
|
williamr@2
|
33 |
|
williamr@2
|
34 |
G_BEGIN_DECLS
|
williamr@2
|
35 |
|
williamr@2
|
36 |
#ifndef MAXPATHLEN
|
williamr@2
|
37 |
#define MAXPATHLEN 1024
|
williamr@2
|
38 |
#endif
|
williamr@2
|
39 |
|
williamr@2
|
40 |
#ifdef G_OS_WIN32
|
williamr@2
|
41 |
|
williamr@2
|
42 |
/*
|
williamr@2
|
43 |
* To get prototypes for the following POSIXish functions, you have to
|
williamr@2
|
44 |
* include the indicated non-POSIX headers. The functions are defined
|
williamr@2
|
45 |
* in OLDNAMES.LIB (MSVC) or -lmoldname-msvc (mingw32).
|
williamr@2
|
46 |
*
|
williamr@2
|
47 |
* getcwd: <direct.h> (MSVC), <io.h> (mingw32)
|
williamr@2
|
48 |
* getpid: <process.h>
|
williamr@2
|
49 |
* access: <io.h>
|
williamr@2
|
50 |
* unlink: <stdio.h> or <io.h>
|
williamr@2
|
51 |
* open, read, write, lseek, close: <io.h>
|
williamr@2
|
52 |
* rmdir: <io.h>
|
williamr@2
|
53 |
* pipe: <io.h>
|
williamr@2
|
54 |
*/
|
williamr@2
|
55 |
|
williamr@2
|
56 |
/* pipe is not in OLDNAMES.LIB or -lmoldname-msvc. */
|
williamr@2
|
57 |
#define pipe(phandles) _pipe (phandles, 4096, _O_BINARY)
|
williamr@2
|
58 |
|
williamr@2
|
59 |
/* For some POSIX functions that are not provided by the MS runtime,
|
williamr@2
|
60 |
* we provide emulation functions in glib, which are prefixed with
|
williamr@2
|
61 |
* g_win32_. Or that was the idea at some time, but there is just one
|
williamr@2
|
62 |
* of those:
|
williamr@2
|
63 |
*/
|
williamr@2
|
64 |
gint g_win32_ftruncate (gint f,
|
williamr@2
|
65 |
guint size);
|
williamr@2
|
66 |
#endif /* G_OS_WIN32 */
|
williamr@2
|
67 |
|
williamr@2
|
68 |
/* The MS setlocale uses locale names of the form "English_United
|
williamr@2
|
69 |
* States.1252" etc. We want the Unixish standard form "en", "zh_TW"
|
williamr@2
|
70 |
* etc. This function gets the current thread locale from Windows and
|
williamr@2
|
71 |
* returns it as a string of the above form for use in forming file
|
williamr@2
|
72 |
* names etc. The returned string should be deallocated with g_free().
|
williamr@2
|
73 |
*/
|
williamr@2
|
74 |
gchar* g_win32_getlocale (void);
|
williamr@2
|
75 |
|
williamr@2
|
76 |
/* Translate a Win32 error code (as returned by GetLastError()) into
|
williamr@2
|
77 |
* the corresponding message. The returned string should be deallocated
|
williamr@2
|
78 |
* with g_free().
|
williamr@2
|
79 |
*/
|
williamr@2
|
80 |
gchar* g_win32_error_message (gint error);
|
williamr@2
|
81 |
|
williamr@2
|
82 |
#define g_win32_get_package_installation_directory g_win32_get_package_installation_directory_utf8
|
williamr@2
|
83 |
#define g_win32_get_package_installation_subdirectory g_win32_get_package_installation_subdirectory_utf8
|
williamr@2
|
84 |
|
williamr@2
|
85 |
gchar* g_win32_get_package_installation_directory (gchar *package,
|
williamr@2
|
86 |
gchar *dll_name);
|
williamr@2
|
87 |
|
williamr@2
|
88 |
gchar* g_win32_get_package_installation_subdirectory (gchar *package,
|
williamr@2
|
89 |
gchar *dll_name,
|
williamr@2
|
90 |
gchar *subdir);
|
williamr@2
|
91 |
|
williamr@2
|
92 |
guint g_win32_get_windows_version (void);
|
williamr@2
|
93 |
|
williamr@2
|
94 |
gchar* g_win32_locale_filename_from_utf8 (const gchar *utf8filename);
|
williamr@2
|
95 |
|
williamr@2
|
96 |
#define G_WIN32_IS_NT_BASED() (g_win32_get_windows_version () < 0x80000000)
|
williamr@2
|
97 |
#define G_WIN32_HAVE_WIDECHAR_API() (G_WIN32_IS_NT_BASED ())
|
williamr@2
|
98 |
|
williamr@2
|
99 |
G_END_DECLS
|
williamr@2
|
100 |
|
williamr@2
|
101 |
#endif /* G_PLATFORM_WIN32 */
|
williamr@2
|
102 |
|
williamr@2
|
103 |
#endif /* __G_WIN32_H__ */
|