SHARE
TWEET

Untitled

a guest May 19th, 2017 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /****************************************************************************
  2.  * Copyright (C) 2015
  3.  * by Dimok
  4.  *
  5.  * This software is provided 'as-is', without any express or implied
  6.  * warranty. In no event will the authors be held liable for any
  7.  * damages arising from the use of this software.
  8.  *
  9.  * Permission is granted to anyone to use this software for any
  10.  * purpose, including commercial applications, and to alter it and
  11.  * redistribute it freely, subject to the following restrictions:
  12.  *
  13.  * 1. The origin of this software must not be misrepresented; you
  14.  * must not claim that you wrote the original software. If you use
  15.  * this software in a product, an acknowledgment in the product
  16.  * documentation would be appreciated but is not required.
  17.  *
  18.  * 2. Altered source versions must be plainly marked as such, and
  19.  * must not be misrepresented as being the original software.
  20.  *
  21.  * 3. This notice may not be removed or altered from any source
  22.  * distribution.
  23.  ***************************************************************************/
  24. #include <coreinit/dynload.h>
  25. #include "curl_functions.h"
  26.  
  27. EXPORT_DECL(CURLcode,..., n_curl_global_init, long flags);
  28. EXPORT_DECL(CURL *, n_curl_easy_init, void);
  29. EXPORT_DECL(CURLcode, n_curl_easy_setopt, CURL *curl, CURLoption option, ...);
  30. EXPORT_DECL(CURLcode, n_curl_easy_perform, CURL *curl);
  31. EXPORT_DECL(void, n_curl_easy_cleanup, CURL *curl);
  32. EXPORT_DECL(CURLcode, n_curl_easy_getinfo, CURL *curl, CURLINFO info, ...);
  33.  
  34. void InitCurlFunctionPointers(void)
  35. {
  36.     unsigned int *funcPointer = 0;
  37.     OSDynLoadModule libcurl_handle;
  38.     OSDynLoad_Acquire("nlibcurl", &libcurl_handle);
  39.     OS_FIND_EXPORT_EX(libcurl_handle, curl_global_init, n_curl_global_init);
  40.     OS_FIND_EXPORT_EX(libcurl_handle, curl_easy_init, n_curl_easy_init);
  41.     OS_FIND_EXPORT_EX(libcurl_handle, curl_easy_setopt, n_curl_easy_setopt);
  42.     OS_FIND_EXPORT_EX(libcurl_handle, curl_easy_perform, n_curl_easy_perform);
  43.     OS_FIND_EXPORT_EX(libcurl_handle, curl_easy_cleanup, n_curl_easy_cleanup);
  44.     OS_FIND_EXPORT_EX(libcurl_handle, curl_easy_getinfo, n_curl_easy_getinfo);
  45.  
  46.     n_curl_global_init(CURL_GLOBAL_ALL);
  47. }
RAW Paste Data
Top