gconvert.inc 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // {$include <stddef.h> /* For size_t */}
  2. // {$include <glib/gerror.h>}
  3. type
  4. PGConvertError = ^TGConvertError;
  5. TGConvertError = (G_CONVERT_ERROR_NO_CONVERSION,
  6. G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
  7. G_CONVERT_ERROR_FAILED,
  8. G_CONVERT_ERROR_PARTIAL_INPUT,
  9. G_CONVERT_ERROR_BAD_URI,
  10. G_CONVERT_ERROR_NOT_ABSOLUTE_PATH
  11. );
  12. function G_CONVERT_ERROR : TGQuark;
  13. function g_convert_error_quark:TGQuark;cdecl;external gliblib name 'g_convert_error_quark';
  14. { Thin wrappers around iconv }
  15. type
  16. PGIConv = ^TGIConv;
  17. TGIConv = pointer;
  18. function g_iconv_open(to_codeset:Pgchar; from_codeset:Pgchar):TGIConv;cdecl;external gliblib name 'g_iconv_open';
  19. function g_iconv(converter:TGIConv; inbuf:PPgchar; inbytes_left:Pgsize; outbuf:PPgchar; outbytes_left:Pgsize):gsize;cdecl;external gliblib name 'g_iconv';
  20. function g_iconv_close(converter:TGIConv):gint;cdecl;external gliblib name 'g_iconv_close';
  21. function g_convert(str:Pgchar; len:gssize; to_codeset:Pgchar; from_codeset:Pgchar; bytes_read:Pgsize;
  22. bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_convert';
  23. function g_convert_with_iconv(str:Pgchar; len:gssize; converter:TGIConv; bytes_read:Pgsize; bytes_written:Pgsize;
  24. error:PPGError):Pgchar;cdecl;external gliblib name 'g_convert_with_iconv';
  25. function g_convert_with_fallback(str:Pgchar; len:gssize; to_codeset:Pgchar; from_codeset:Pgchar; fallback:Pgchar;
  26. bytes_read:Pgsize; bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_convert_with_fallback';
  27. { Convert between libc's idea of strings and UTF-8. }
  28. function g_locale_to_utf8(opsysstring:Pgchar; len:gssize; bytes_read:Pgsize; bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_locale_to_utf8';
  29. function g_locale_from_utf8(utf8string:Pgchar; len:gssize; bytes_read:Pgsize; bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_locale_from_utf8';
  30. { Convert between the operating system (or C runtime)
  31. representation of file names and UTF-8.
  32. }
  33. function g_filename_to_utf8(opsysstring:Pgchar; len:gssize; bytes_read:Pgsize; bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_filename_to_utf8';
  34. function g_filename_from_utf8(utf8string:Pgchar; len:gssize; bytes_read:Pgsize; bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_filename_from_utf8';
  35. function g_filename_from_uri(uri:Pchar; hostname:PPchar; error:PPGError):Pgchar;cdecl;external gliblib name 'g_filename_from_uri';
  36. function g_filename_to_uri(filename:Pchar; hostname:Pchar; error:PPGError):Pgchar;cdecl;external gliblib name 'g_filename_to_uri';