#ifndef __CURLUTIL_H__
#define __CURLUTIL_H__

#ifdef __cplusplus
#ifndef BEGIN_DECLS
#define BEGIN_DECLS extern "C" {
#endif
#ifndef END_DECLS
#define END_DECLS }
#endif
#else
#ifndef BEGIN_DECLS
#define BEGIN_DECLS
#endif
#ifndef END_DECLS
#define END_DECLS
#endif
#endif

BEGIN_DECLS

#include <stdlib.h>
#include <curl/curl.h>

#include "Common.h"
#include "Config.h"
#include "Log.h"

#define CURL_ERR_SUCCESS                        0
#define CURL_ERR_CANNOT_ADD_PARAMETER           -1

struct HTML_CONTEXT_DATA
{
    char *pData;
    size_t nDataSize;
};

int SetEncodedPostData(int nThreadIndex, CURL *pCurlContext, char *pEncodedPostData, int nPostDataOffset, int nEncodedPostDataLength, const char *pszParameterKey, const char *pszParameterData);
size_t CURL_WriteMemoryCallback(void *pData, size_t nSize, size_t nMemoryBlockSize, void *pStream);

END_DECLS

#endif
