gfileutils.inc 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // {$include <glib/gerror.h>}
  2. type
  3. PGFileError = ^TGFileError;
  4. TGFileError = gint;
  5. { For backward-compat reasons, these are synced to an old
  6. anonymous enum in libgnome. But don't use that enum
  7. in new code.
  8. }
  9. type
  10. PGFileTest = ^TGFileTest;
  11. TGFileTest = integer;
  12. const
  13. G_FILE_TEST_IS_REGULAR = 1 shl 0;
  14. G_FILE_TEST_IS_SYMLINK = 1 shl 1;
  15. G_FILE_TEST_IS_DIR = 1 shl 2;
  16. G_FILE_TEST_IS_EXECUTABLE = 1 shl 3;
  17. G_FILE_TEST_EXISTS = 1 shl 4;
  18. const
  19. G_FILE_ERROR_EXIST = 0;
  20. G_FILE_ERROR_ISDIR = 1;
  21. G_FILE_ERROR_ACCES = 2;
  22. G_FILE_ERROR_NAMETOOLONG = 3;
  23. G_FILE_ERROR_NOENT = 4;
  24. G_FILE_ERROR_NOTDIR = 5;
  25. G_FILE_ERROR_NXIO = 6;
  26. G_FILE_ERROR_NODEV = 7;
  27. G_FILE_ERROR_ROFS = 8;
  28. G_FILE_ERROR_TXTBSY = 9;
  29. G_FILE_ERROR_FAULT = 10;
  30. G_FILE_ERROR_LOOP = 11;
  31. G_FILE_ERROR_NOSPC = 12;
  32. G_FILE_ERROR_NOMEM = 13;
  33. G_FILE_ERROR_MFILE = 14;
  34. G_FILE_ERROR_NFILE = 15;
  35. G_FILE_ERROR_BADF = 16;
  36. G_FILE_ERROR_INVAL = 17;
  37. G_FILE_ERROR_PIPE = 18;
  38. G_FILE_ERROR_AGAIN = 19;
  39. G_FILE_ERROR_INTR = 20;
  40. G_FILE_ERROR_IO = 21;
  41. G_FILE_ERROR_PERM = 22;
  42. G_FILE_ERROR_FAILED = 23;
  43. function G_FILE_ERROR: TGQuark;
  44. function g_file_error_quark:TGQuark;cdecl;external gliblib name 'g_file_error_quark';
  45. { So other code can generate a GFileError }
  46. function g_file_error_from_errno(err_no:gint):TGFileError;cdecl;external gliblib name 'g_file_error_from_errno';
  47. function g_file_test(filename:Pgchar; test:TGFileTest):gboolean;cdecl;external gliblib name 'g_file_test';
  48. function g_file_get_contents(filename:Pgchar; contents:PPgchar; length:Pgsize; error:PPGError):gboolean;cdecl;external gliblib name 'g_file_get_contents';
  49. { Wrapper / workalike for mkstemp() }
  50. function g_mkstemp(tmpl:Pchar):longint;cdecl;external gliblib name 'g_mkstemp';
  51. { Wrapper for g_mkstemp }
  52. function g_file_open_tmp(tmpl:Pchar; name_used:PPchar; error:PPGError):longint;cdecl;external gliblib name 'g_file_open_tmp';
  53. {$IFNDEF KYLIX}
  54. function g_build_path(separator:Pgchar; first_element:Pgchar; args:array of const):Pgchar;cdecl;overload;external gliblib name 'g_build_path';
  55. function g_build_path(separator:Pgchar; first_element:Pgchar):Pgchar;cdecl;overload;external gliblib name 'g_build_path';
  56. function g_build_filename(first_element:Pgchar; args:array of const):Pgchar;cdecl;overload;external gliblib name 'g_build_filename';
  57. function g_build_filename(first_element:Pgchar):Pgchar;cdecl;overload;external gliblib name 'g_build_filename';
  58. {$ELSE}
  59. function g_build_path(separator:Pgchar; first_element:Pgchar):Pgchar;varargs;cdecl;external gliblib name 'g_build_path';
  60. function g_build_filename(first_element:Pgchar):Pgchar;varargs;cdecl;external gliblib name 'g_build_filename';
  61. {$ENDIF}