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