Exemple #1
0
 public static void EasyCleanup(CurlEasyHandle handle)
 {
     if (Environment.Is64BitProcess)
     {
         LibCurlNative.EasyCleanup64(handle);
     }
     else
     {
         LibCurlNative.EasyCleanup32(handle);
     }
 }
Exemple #2
0
 public static void SListFreeAll(SListHandle handle)
 {
     if (Environment.Is64BitProcess)
     {
         LibCurlNative.SListFreeAll64(handle);
     }
     else
     {
         LibCurlNative.SListFreeAll32(handle);
     }
 }
Exemple #3
0
 public static void EasyReset(CurlEasyHandle handle)
 {
     if (Environment.Is64BitProcess)
     {
         LibCurlNative.EasyReset64(handle);
     }
     else
     {
         LibCurlNative.EasyReset32(handle);
     }
 }
Exemple #4
0
        public static CurlCode GlobalInit(CurlGlobal flags = CurlGlobal.Default)
        {
            lock (globalInitMutex) {
                // curl_global_init is reference counted, but I do manual reference counting in order to implement IsInitialized.

                ++globalInitRefCount;

                return(Environment.Is64BitProcess ?
                       LibCurlNative.GlobalInit64(flags) :
                       LibCurlNative.GlobalInit32(flags));
            }
        }
Exemple #5
0
        public static void GlobalCleanup()
        {
            lock (globalInitMutex) {
                if (globalInitRefCount == 1)
                {
                    if (Environment.Is64BitProcess)
                    {
                        LibCurlNative.GlobalCleanup64();
                    }
                    else
                    {
                        LibCurlNative.GlobalCleanup32();
                    }
                }

                if (globalInitRefCount > 0)
                {
                    --globalInitRefCount;
                }
            }
        }
Exemple #6
0
 public static CurlCode EasySetOpt(CurlEasyHandle handle, CurlOption option, ReadFunctionCallback value)
 {
     return(Environment.Is64BitProcess ?
            LibCurlNative.EasySetOpt64(handle, option, value) :
            LibCurlNative.EasySetOpt32(handle, option, value));
 }
Exemple #7
0
 public static CurlEasyHandle EasyInit()
 {
     return(Environment.Is64BitProcess ?
            LibCurlNative.EasyInit64() :
            LibCurlNative.EasyInit32());
 }
Exemple #8
0
 public static SListHandle SListAppend(SListHandle handle, string @string)
 {
     return(Environment.Is64BitProcess ?
            LibCurlNative.SListAppend64(handle, @string) :
            LibCurlNative.SListAppend32(handle, @string));
 }
Exemple #9
0
 public static CurlCode EasyPerform(CurlEasyHandle handle)
 {
     return(Environment.Is64BitProcess ?
            LibCurlNative.EasyPerform64(handle) :
            LibCurlNative.EasyPerform32(handle));
 }