api_windows.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //go:build windows
  2. package yu_curl
  3. import yu_sys "gogs.qqck.cn/s/tools/sys"
  4. var modlibcurl yu_sys.Module
  5. var (
  6. curl_global_init yu_sys.Address
  7. curl_version yu_sys.Address
  8. curl_easy_init yu_sys.Address
  9. curl_easy_cleanup yu_sys.Address
  10. curl_easy_setopt yu_sys.Address
  11. curl_slist_append yu_sys.Address
  12. curl_slist_free_all yu_sys.Address
  13. curl_easy_perform yu_sys.Address
  14. curl_easy_strerror yu_sys.Address
  15. curl_easy_getinfo yu_sys.Address
  16. curl_ws_send yu_sys.Address
  17. curl_ws_recv yu_sys.Address
  18. )
  19. func loadDLL(path string) {
  20. modlibcurl = yu_sys.LoadLibrary(path)
  21. curl_global_init = modlibcurl.GetProcAddress("curl_global_init")
  22. curl_version = modlibcurl.GetProcAddress("curl_version")
  23. curl_easy_init = modlibcurl.GetProcAddress("curl_easy_init")
  24. curl_easy_cleanup = modlibcurl.GetProcAddress("curl_easy_cleanup")
  25. curl_easy_setopt = modlibcurl.GetProcAddress("curl_easy_setopt")
  26. curl_slist_append = modlibcurl.GetProcAddress("curl_slist_append")
  27. curl_slist_free_all = modlibcurl.GetProcAddress("curl_slist_free_all")
  28. curl_easy_perform = modlibcurl.GetProcAddress("curl_easy_perform")
  29. curl_easy_strerror = modlibcurl.GetProcAddress("curl_easy_strerror")
  30. curl_easy_getinfo = modlibcurl.GetProcAddress("curl_easy_getinfo")
  31. curl_ws_send = modlibcurl.GetProcAddress("curl_ws_send")
  32. curl_ws_recv = modlibcurl.GetProcAddress("curl_ws_recv")
  33. }