gwin32.inc 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {*
  2. * gwin32.inc
  3. *
  4. * depends on gtypes.inc
  5. *}
  6. {$ifdef WIN32}
  7. { Windows emulation stubs for common Unix functions
  8. }
  9. const
  10. MAXPATHLEN = 1024;
  11. type
  12. Ppid_t = ^Tpid_t;
  13. Tpid_t = longint;
  14. { For some POSIX functions that are not provided by the MS runtime,
  15. we provide emulators in glib, which are prefixed with g_win32_.
  16. }
  17. function ftruncate(f:gint; size:guint):gint;cdecl;external gliblib name 'g_win32_ftruncate';
  18. function g_win32_ftruncate(f:gint; size:guint):gint;cdecl;external gliblib name 'g_win32_ftruncate';
  19. { The MS setlocale uses locale names of the form "English_United
  20. States.1252" etc. We want the Unixish standard form "en", "zh_TW"
  21. etc. This function gets the current thread locale from Windows and
  22. returns it as a string of the above form for use in forming file
  23. names etc. The returned string should be deallocated with g_free().
  24. }
  25. function g_win32_getlocale:Pgchar;cdecl;external gliblib name 'g_win32_getlocale';
  26. { Translate a Win32 error code (as returned by GetLastError()) into
  27. the corresponding message. The returned string should be deallocated
  28. with g_free().
  29. }
  30. function g_win32_error_message(error:gint):Pgchar;cdecl;external gliblib name 'g_win32_error_message';
  31. function g_win32_get_package_installation_directory(package:Pgchar; dll_name:Pgchar):Pgchar;cdecl;external gliblib name 'g_win32_get_package_installation_directory';
  32. function g_win32_get_package_installation_subdirectory(package:Pgchar; dll_name:Pgchar; subdir:Pgchar):Pgchar;cdecl;external gliblib name 'g_win32_get_package_installation_subdirectory';
  33. {$endif}