using System;
using System.Runtime.InteropServices;
namespace CurlSharp
{
///
/// Called when cURL has debug information for the client.
///
///
/// For usage, see the sample Upload.cs.
/// Arguments passed to the recipient include:
///
///
/// Argument
/// Description
///
/// -
/// infoType
///
/// Type of debug information, see
/// .
///
///
/// -
/// message
/// Debug information as a string.
///
/// -
/// extraData
/// Client-provided extra data.
///
///
///
public delegate void CurlDebugCallback(CurlInfoType infoType, String message, Object extraData);
///
/// Called when cURL has header data for the client.
///
///
/// For usage, see the sample Headers.cs.
/// Arguments passed to the recipient include:
///
///
/// Argument
/// Description
///
/// -
/// buf
/// Header data from cURL to the client.
///
/// -
/// size
/// Size of a character, in bytes.
///
/// -
/// nmemb
/// Number of characters.
///
/// -
/// extraData
/// Client-provided extra data.
///
///
/// Your implementation should return the number of bytes (not
/// characters) processed. Usually this is size * nmemb.
/// Return -1 to abort the transfer.
///
public delegate int CurlHeaderCallback(byte[] buf, int size, int nmemb, Object extraData);
///
/// Called when cURL needs for the client to perform an
/// IOCTL operation. An example might be when an FTP
/// upload requires rewinding of the input file to deal
/// with a resend occasioned by an error.
///
///
///
///
/// Argument
/// Description
///
/// -
/// cmd
///
/// A ; for now, only
/// RestartRead should be passed.
///
///
/// -
/// extraData
///
/// Client-provided extra data; in the
/// case of an FTP upload, it might be a
/// FileStream object.
///
///
///
/// Your implementation should return a ,
/// which should be if everything
/// is okay.
///
public delegate CurlIoError CurlIoctlCallback(CurlIoCommand cmd, Object extraData);
///
/// Called when cURL wants to report progress.
///
///
/// For usage, see the sample Upload.cs.
/// Arguments passed to the recipient include:
///
///
/// Argument
/// Description
///
/// -
/// extraData
/// Client-provided extra data.
///
/// -
/// dlTotal
/// Number of bytes to download.
///
/// -
/// dlNow
/// Number of bytes downloaded so far.
///
/// -
/// ulTotal
/// Number of bytes to upload.
///
/// -
/// ulNow
/// Number of bytes uploaded so far.
///
///
/// Your implementation should return 0 to continue, or a non-zero
/// value to abort the transfer.
///
public delegate int CurlProgressCallback(Object extraData, double dlTotal, double dlNow,
double ulTotal, double ulNow);
///
/// Called when cURL wants to read data from the client.
///
///
/// For usage, see the sample Upload.cs.
/// Arguments passed to the recipient include:
///
///
/// Argument
/// Description
///
/// -
/// buf
///
/// Buffer into which your client should write data
/// for cURL.
///
///
/// -
/// size
/// Size of a character, usually 1.
///
/// -
/// nmemb
/// Number of characters.
///
/// -
/// extraData
/// Client-provided extra data.
///
///
/// Your implementation should return the number of bytes (not
/// characters) written to buf. Return 0 to abort the transfer.
///
public delegate int CurlReadCallback([Out] byte[] buf, int size, int nmemb, Object extraData);
///
/// Called when cURL wants to report an Ssl event.
///
///
/// For usage, see the sample SSLGet.cs.
/// Arguments passed to the recipient include:
///
///
/// Argument
/// Description
///
/// -
/// ctx
///
/// An object that wraps an
/// OpenSSL SSL_CTX pointer.
///
///
/// -
/// extraData
/// Client-provided extra data.
///
///
/// Your implementation should return a ,
/// which should be if everything
/// is okay.
///
public delegate CurlCode CurlSslContextCallback(CurlSslContext ctx, Object extraData);
///
/// Called when cURL has data for the client.
///
///
/// For usage, see the example EasyGet.cs.
/// Arguments passed to the delegate implementation include:
///
///
/// Argument
/// Description
///
/// -
/// buf
/// Data cURL is providing to the client.
///
/// -
/// size
/// Size of a character, usually 1.
///
/// -
/// nmemb
/// Number of characters.
///
/// -
/// extraData
/// Client-provided extra data.
///
///
/// Your implementation should return the number of bytes (not
/// characters) processed. Return 0 to abort the transfer.
///
public delegate int CurlWriteCallback(byte[] buf, int size, int nmemb, Object extraData);
}