api_windows.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //go:build windows
  2. package yu_deflate
  3. import yu_sys "gogs.qqck.cn/s/tools/sys"
  4. var modlibdeflate yu_sys.Module
  5. var (
  6. libdeflate_alloc_compressor yu_sys.Address
  7. libdeflate_free_compressor yu_sys.Address
  8. libdeflate_alloc_decompressor yu_sys.Address
  9. libdeflate_free_decompressor yu_sys.Address
  10. libdeflate_zlib_compress yu_sys.Address
  11. libdeflate_deflate_compress yu_sys.Address
  12. libdeflate_gzip_compress yu_sys.Address
  13. libdeflate_zlib_decompress_ex yu_sys.Address
  14. libdeflate_deflate_decompress_ex yu_sys.Address
  15. libdeflate_gzip_decompress_ex yu_sys.Address
  16. )
  17. func loadDLL(path string) {
  18. modlibdeflate = yu_sys.LoadLibrary(path)
  19. libdeflate_alloc_compressor = modlibdeflate.GetProcAddress("libdeflate_alloc_compressor")
  20. libdeflate_free_compressor = modlibdeflate.GetProcAddress("libdeflate_free_compressor")
  21. libdeflate_alloc_decompressor = modlibdeflate.GetProcAddress("libdeflate_alloc_decompressor")
  22. libdeflate_free_decompressor = modlibdeflate.GetProcAddress("libdeflate_free_decompressor")
  23. libdeflate_zlib_compress = modlibdeflate.GetProcAddress("libdeflate_zlib_compress")
  24. libdeflate_deflate_compress = modlibdeflate.GetProcAddress("libdeflate_deflate_compress")
  25. libdeflate_gzip_compress = modlibdeflate.GetProcAddress("libdeflate_gzip_compress")
  26. libdeflate_zlib_decompress_ex = modlibdeflate.GetProcAddress("libdeflate_zlib_decompress_ex")
  27. libdeflate_deflate_decompress_ex = modlibdeflate.GetProcAddress("libdeflate_deflate_decompress_ex")
  28. libdeflate_gzip_decompress_ex = modlibdeflate.GetProcAddress("libdeflate_gzip_decompress_ex")
  29. }