⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 curl.h

📁 VC写的实现HTTP协议的完成程序
💻 H
📖 第 1 页 / 共 3 页
字号:
		CURL_TIMECOND_IFUNMODSINCE,		CURL_TIMECOND_LASTMOD,		CURL_TIMECOND_LAST	} curl_TimeCond;	/* for backwards compatibility */#ifndef TIMECOND_IFMODSINCE#define TIMECOND_IFMODSINCE CURL_TIMECOND_IFMODSINCE#endif#ifndef TIMECOND_IFUNMODSINCE#define TIMECOND_IFUNMODSINCE CURL_TIMECOND_IFUNMODSINCE#endif#ifndef TIMECOND_LASTMOD#define TIMECOND_LASTMOD CURL_TIMECOND_LASTMOD#endif#ifdef __BEOS__#include <support/SupportDefs.h>#endif	/* These functions are in the libcurl, they're here for portable reasons and	they are used by the 'curl' client. They really should be moved to some kind	of "portability library" since it has nothing to do with file transfers and	might be usable to other programs...	NOTE: they return TRUE if the strings match *case insensitively*.	*/	extern int (curl_strequal)(const char *s1, const char *s2);	extern int (curl_strnequal)(const char *s1, const char *s2, size_t n);	/* DEPRECATED function to build formdata */	int curl_formparse(char *, struct curl_httppost **,	struct curl_httppost **_post);	/* name is uppercase CURLFORM_<name> */#ifdef CFINIT#undef CFINIT#endif#ifdef CURL_ISOCPP#define CFINIT(name) CURLFORM_ ## name#else	/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */#define CFINIT(name) CURLFORM_/**/name#endif	typedef enum {		CFINIT(NOTHING),        /********* the first one is unused ************/		/*  */		CFINIT(COPYNAME),		CFINIT(PTRNAME),		CFINIT(NAMELENGTH),		CFINIT(COPYCONTENTS),		CFINIT(PTRCONTENTS),		CFINIT(CONTENTSLENGTH),		CFINIT(FILECONTENT),		CFINIT(ARRAY),		CFINIT(OBSOLETE),		CFINIT(FILE),		CFINIT(BUFFER),		CFINIT(BUFFERPTR),		CFINIT(BUFFERLENGTH),		CFINIT(CONTENTTYPE),		CFINIT(CONTENTHEADER),		CFINIT(FILENAME),		CFINIT(END),		CFINIT(OBSOLETE2),		CURLFORM_LASTENTRY /* the last unusued */	} CURLformoption;#undef CFINIT /* done */	/* structure to be used as parameter for CURLFORM_ARRAY */	struct curl_forms {		CURLformoption		option;		const char		*value;	};	/* use this for multipart formpost building */	/* Returns code for curl_formadd()	* 	* Returns:	* CURL_FORMADD_OK             on success	* CURL_FORMADD_MEMORY         if the FormInfo allocation fails	* CURL_FORMADD_OPTION_TWICE   if one option is given twice for one Form	* CURL_FORMADD_NULL           if a null pointer was given for a char	* CURL_FORMADD_MEMORY         if the allocation of a FormInfo struct failed	* CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used	* CURL_FORMADD_INCOMPLETE     if the some FormInfo is not complete (or error)	* CURL_FORMADD_MEMORY         if a HttpPost struct cannot be allocated	* CURL_FORMADD_MEMORY         if some allocation for string copying failed.	* CURL_FORMADD_ILLEGAL_ARRAY  if an illegal option is used in an array	*	***************************************************************************/	typedef enum {		CURL_FORMADD_OK, /* first, no error */		CURL_FORMADD_MEMORY,		CURL_FORMADD_OPTION_TWICE,		CURL_FORMADD_NULL,		CURL_FORMADD_UNKNOWN_OPTION,		CURL_FORMADD_INCOMPLETE,		CURL_FORMADD_ILLEGAL_ARRAY,		CURL_FORMADD_LAST /* last */	} CURLFORMcode;	CURLFORMcode curl_formadd(struct curl_httppost **httppost,	struct curl_httppost **last_post,		...);	/* cleanup a form: */	void curl_formfree(struct curl_httppost *form);	/* Unix and Win32 getenv function call, this returns a malloc()'ed string that	MUST be free()ed after usage is complete. */	char *curl_getenv(const char *variable);	/* Returns a static ascii string of the libcurl version. */	char *curl_version(void);	/* Escape and unescape URL encoding in strings. The functions return a new	* allocated string or NULL if an error occurred.  */	char *curl_escape(const char *string, int length);	char *curl_unescape(const char *string, int length);	/* 20020912 WJM. Provide for a de-allocation in the same translation unit	that did the allocation. Added in libcurl 7.10 */	void curl_free(void *p);	/* curl_global_init() should be invoked exactly once for each application that	uses libcurl */	CURLcode curl_global_init(long flags);	/* curl_global_cleanup() should be invoked exactly once for each application	that uses libcurl */	void curl_global_cleanup(void);	/* This is the version number */#define LIBCURL_VERSION "7.10.4"#define LIBCURL_VERSION_NUM 0x070a04	/* linked-list structure for the CURLOPT_QUOTE option (and other) */	struct curl_slist {		char			*data;		struct curl_slist	*next;	};	struct curl_slist *curl_slist_append(struct curl_slist *, const char *);	void curl_slist_free_all(struct curl_slist *);	/*	* NAME curl_getdate()	*	* DESCRIPTION	*	* Returns the time, in seconds since 1 Jan 1970 of the time string given in	* the first argument. The time argument in the second parameter is for cases	* where the specified time is relative now, like 'two weeks' or 'tomorrow'	* etc.	*/	time_t curl_getdate(const char *p, const time_t *now);#define CURLINFO_STRING   0x100000#define CURLINFO_LONG     0x200000#define CURLINFO_DOUBLE   0x300000#define CURLINFO_MASK     0x0fffff#define CURLINFO_TYPEMASK 0xf00000	typedef enum {		CURLINFO_NONE, /* first, never use this */		CURLINFO_EFFECTIVE_URL    = CURLINFO_STRING + 1,		CURLINFO_HTTP_CODE        = CURLINFO_LONG   + 2,		CURLINFO_TOTAL_TIME       = CURLINFO_DOUBLE + 3,		CURLINFO_NAMELOOKUP_TIME  = CURLINFO_DOUBLE + 4,		CURLINFO_CONNECT_TIME     = CURLINFO_DOUBLE + 5,		CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,		CURLINFO_SIZE_UPLOAD      = CURLINFO_DOUBLE + 7,		CURLINFO_SIZE_DOWNLOAD    = CURLINFO_DOUBLE + 8,		CURLINFO_SPEED_DOWNLOAD   = CURLINFO_DOUBLE + 9,		CURLINFO_SPEED_UPLOAD     = CURLINFO_DOUBLE + 10,		CURLINFO_HEADER_SIZE      = CURLINFO_LONG   + 11,		CURLINFO_REQUEST_SIZE     = CURLINFO_LONG   + 12,		CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG   + 13,		CURLINFO_FILETIME         = CURLINFO_LONG   + 14,		CURLINFO_CONTENT_LENGTH_DOWNLOAD   = CURLINFO_DOUBLE + 15,		CURLINFO_CONTENT_LENGTH_UPLOAD     = CURLINFO_DOUBLE + 16,		CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,		CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,		CURLINFO_REDIRECT_TIME   = CURLINFO_DOUBLE + 19,		CURLINFO_REDIRECT_COUNT  = CURLINFO_LONG + 20,		CURLINFO_PRIVATE = CURLINFO_STRING + 21,		/* Fill in new entries here! */		CURLINFO_LASTONE          = 22	} CURLINFO;	typedef enum {		CURLCLOSEPOLICY_NONE, /* first, never use this */		CURLCLOSEPOLICY_OLDEST,		CURLCLOSEPOLICY_LEAST_RECENTLY_USED,		CURLCLOSEPOLICY_LEAST_TRAFFIC,		CURLCLOSEPOLICY_SLOWEST,		CURLCLOSEPOLICY_CALLBACK,		CURLCLOSEPOLICY_LAST /* last, never use this */	} curl_closepolicy;#define CURL_GLOBAL_SSL (1<<0)#define CURL_GLOBAL_WIN32 (1<<1)#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)#define CURL_GLOBAL_NOTHING 0#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL	/*****************************************************************************	* Setup defines, protos etc for the sharing stuff.	*/	/* Different data locks for a single share */	typedef enum {		CURL_LOCK_DATA_NONE = 0,		/*  CURL_LOCK_DATA_SHARE is used internaly to say that		*  the locking is just made to change the internal state of the share		*  itself.		*/		CURL_LOCK_DATA_SHARE, 		CURL_LOCK_DATA_COOKIE,		CURL_LOCK_DATA_DNS,		CURL_LOCK_DATA_SSL_SESSION,		CURL_LOCK_DATA_CONNECT,		CURL_LOCK_DATA_LAST	} curl_lock_data;	/* Different lock access types */	typedef enum {		CURL_LOCK_ACCESS_NONE = 0,   /* unspecified action */		CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */		CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */		CURL_LOCK_ACCESS_LAST        /* never use */	} curl_lock_access;	typedef void (*curl_lock_function)(CURL *handle,		curl_lock_data data,		curl_lock_access access,		void *userptr);	typedef void (*curl_unlock_function)(CURL *handle,		curl_lock_data data,		void *userptr);	typedef void CURLSH;	typedef enum {		CURLSHE_OK,  /* all is fine */		CURLSHE_BAD_OPTION, /* 1 */		CURLSHE_IN_USE,     /* 2 */		CURLSHE_INVALID,    /* 3 */		CURLSHE_LAST /* never use */	} CURLSHcode;	typedef enum {		CURLSHOPT_NONE,  /* don't use */		CURLSHOPT_SHARE,   /* specify a data type to share */		CURLSHOPT_UNSHARE, /* specify shich data type to stop sharing */		CURLSHOPT_LOCKFUNC,   /* pass in a 'curl_lock_function' pointer */		CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */		CURLSHOPT_USERDATA,   /* pass in a user data pointer used in the lock/unlock									 callback functions */									 CURLSHOPT_LAST  /* never use */	} CURLSHoption;	CURLSH *curl_share_init(void);	CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);	CURLSHcode curl_share_cleanup(CURLSH *);	/****************************************************************************	* Structures for querying information about the curl library at runtime.	*/	typedef enum {		CURLVERSION_FIRST,		CURLVERSION_LAST /* never actually use this */	} CURLversion;	/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by	basicly all programs ever, that want to get version information. It is	meant to be a built-in version number for what kind of struct the caller	expects. If the struct ever changes, we redfine the NOW to another enum	from above. */#define CURLVERSION_NOW CURLVERSION_FIRST	typedef struct {		CURLversion age;          /* age of the returned struct */		const char *version;      /* LIBCURL_VERSION */		unsigned int version_num; /* LIBCURL_VERSION_NUM */		const char *host;         /* OS/host/cpu/machine when configured */		int features;             /* bitmask, see defines below */		char *ssl_version;        /* human readable string */		long ssl_version_num;     /* number */		const char *libz_version;       /* human readable string */		/* protocols is terminated by an entry with a NULL protoname */		const char **protocols;	} curl_version_info_data;#define CURL_VERSION_IPV6      (1<<0)#define CURL_VERSION_KERBEROS4 (1<<1)#define CURL_VERSION_SSL       (1<<2)#define CURL_VERSION_LIBZ      (1<<3)	/* returns a pointer to a static copy of the version info struct */	curl_version_info_data *curl_version_info(CURLversion);#ifdef  __cplusplus}#endif/* unfortunately, the easy.h and multi.h include files need options and infostuff before they can be included! */#include "easy.h" /* nothing in curl is fun without the easy stuff */#include "multi.h"#endif /* __CURL_CURL_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -