You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

115 lines
3.8 KiB

  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. * Modified by the GLib Team and others 1997-2000. See the AUTHORS
  21. * file for a list of people on the GLib Team. See the ChangeLog
  22. * files for a list of changes. These files are distributed with
  23. * GLib at ftp://ftp.gtk.org/pub/gtk/.
  24. */
  25. #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
  26. #error "Only <glib.h> can be included directly."
  27. #endif
  28. #ifndef __G_WIN32_H__
  29. #define __G_WIN32_H__
  30. #include <glib/gtypes.h>
  31. #ifdef G_PLATFORM_WIN32
  32. G_BEGIN_DECLS
  33. #ifndef MAXPATHLEN
  34. #define MAXPATHLEN 1024
  35. #endif
  36. #ifdef G_OS_WIN32
  37. /*
  38. * To get prototypes for the following POSIXish functions, you have to
  39. * include the indicated non-POSIX headers. The functions are defined
  40. * in OLDNAMES.LIB (MSVC) or -lmoldname-msvc (mingw32). But note that
  41. * for POSIX functions that take or return file names in the system
  42. * codepage, in many cases you would want to use the GLib wrappers in
  43. * gstdio.h and UTF-8 instead.
  44. *
  45. * getcwd: <direct.h> (MSVC), <io.h> (mingw32)
  46. * getpid: <process.h>
  47. * access: <io.h>
  48. * unlink: <stdio.h> or <io.h>
  49. * open, read, write, lseek, close: <io.h>
  50. * rmdir: <io.h>
  51. * pipe: <io.h> (actually, _pipe())
  52. */
  53. /* For some POSIX functions that are not provided by the MS runtime,
  54. * we provide emulation functions in glib, which are prefixed with
  55. * g_win32_. Or that was the idea at some time, but there is just one
  56. * of those:
  57. */
  58. gint g_win32_ftruncate (gint f,
  59. guint size);
  60. #endif /* G_OS_WIN32 */
  61. /* The MS setlocale uses locale names of the form "English_United
  62. * States.1252" etc. We want the Unixish standard form "en", "zh_TW"
  63. * etc. This function gets the current thread locale from Windows and
  64. * returns it as a string of the above form for use in forming file
  65. * names etc. The returned string should be deallocated with g_free().
  66. */
  67. gchar* g_win32_getlocale (void);
  68. /* Translate a Win32 error code (as returned by GetLastError()) into
  69. * the corresponding message. The returned string should be deallocated
  70. * with g_free().
  71. */
  72. gchar* g_win32_error_message (gint error);
  73. #ifndef G_DISABLE_DEPRECATED
  74. #define g_win32_get_package_installation_directory g_win32_get_package_installation_directory_utf8
  75. #define g_win32_get_package_installation_subdirectory g_win32_get_package_installation_subdirectory_utf8
  76. gchar* g_win32_get_package_installation_directory (const gchar *package,
  77. const gchar *dll_name);
  78. gchar* g_win32_get_package_installation_subdirectory (const gchar *package,
  79. const gchar *dll_name,
  80. const gchar *subdir);
  81. #endif
  82. gchar* g_win32_get_package_installation_directory_of_module (gpointer hmodule);
  83. guint g_win32_get_windows_version (void);
  84. gchar* g_win32_locale_filename_from_utf8 (const gchar *utf8filename);
  85. /* As of GLib 2.14 we only support NT-based Windows */
  86. #define G_WIN32_IS_NT_BASED() TRUE
  87. #define G_WIN32_HAVE_WIDECHAR_API() TRUE
  88. G_END_DECLS
  89. #endif /* G_PLATFORM_WIN32 */
  90. #endif /* __G_WIN32_H__ */