forked from feihengli/util
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsal_curl.h
58 lines (44 loc) · 1.67 KB
/
sal_curl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef __SAL_CURL_H__
#define __SAL_CURL_H__
#ifdef __cplusplus
#if __cplusplus
extern "C"{
#endif
#endif
#include "sal_standard.h"
typedef enum
{
CURL_RESULT_NULL,
CURL_RESULT_OK,
CURL_RESULT_MANUAL_STOP,
CURL_RESULT_WRITE_ERROR,
CURL_RESULT_READ_TIMEOUT,
CURL_RESULT_UNKNOWN,
} CURL_RESULT_E;
typedef struct
{
unsigned int u32Progress;
int bRunning;
CURL_RESULT_E enResult;
unsigned char* pu8Recv;
unsigned int u32RecvHeaderTotal;
unsigned int u32RecvBodyTotal;
} CURL_STATUS_S;
handle curl_wrapper_init(int timeout);
int curl_wrapper_destroy(handle _hndCurlWrapper);
int curl_wrapper_StartHttpPostImg(handle _hndCurlWrapper, char* _szUrl, char* _szFilename);
int curl_wrapper_StartHttpPost(handle _hndCurlWrapper, char* _szUrl, unsigned char* _pUlData, unsigned int _u32UlDataSize);
int curl_wrapper_StartHttpGet(handle _hndCurlWrapper, char* _szUrl);
int curl_wrapper_StartUpload(handle _hndCurlWrapper, char* _szUrl, char* _szUsr, char* _szPwd, char* _szLocalPath);
int curl_wrapper_StartDownload(handle _hndCurlWrapper, char* _szUrl, char* _szUsr, char* _szPwd, char* _szLocalPath);
int curl_wrapper_StartDownload2Mem(handle _hndCurlWrapper, char* _szUrl, char* _szUsr, char* _szPwd);
int curl_wrapper_Download2MemGet(handle _hndCurlWrapper, char** output, int* len);
int curl_wrapper_GetProgress(handle _hndCurlWrapper, CURL_STATUS_S* _pstStatus);
int curl_wrapper_Stop(handle _hndCurlWrapper);
int curl_wrapper_GetPostData(handle _hndCurlWrapper, char* _szRetUrl, unsigned char* _au8RetData, unsigned int* _u32RetDataSize);
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif