📄 vxiinet.h
字号:
#define INET_OPEN_IF_MODIFIED_DEFAULT NULL /** Open Local File Default - TRUE */ #define INET_OPEN_LOCAL_FILE_DEFAULT TRUE /** Prefetch priority default - INET_PREFETCH_PRIORITY_LOW */ #define INET_PREFETCH_PRIORITY_DEFAULT INET_PREFETCH_PRIORITY_LOW /** Submit method default - INET_SUBMIT_METHOD_GET */ #define INET_SUBMIT_METHOD_DEFAULT INET_SUBMIT_METHOD_GET /** Submit MIME type default - "application/x-www-form-urlencoded" */ #define INET_SUBMIT_MIME_TYPE_DEFAULT L"application/x-www-form-urlencoded" /** Open timeout default - 30000 (30 seconds) */ #define INET_TIMEOUT_OPEN_DEFAULT 30000 /** Read timeout default - 30000 (30 seconds) */ #define INET_TIMEOUT_IO_DEFAULT 30000 /** Total download timeout default - 30000 (30 seconds) */ #define INET_TIMEOUT_DOWNLOAD_DEFAULT 30000 /** URL base default - "" (no base) */ #define INET_URL_BASE_DEFAULT L"" /** URL query arguments default - NULL not present by default */ #define INET_URL_QUERY_ARGS_DEFAULT NULL /*@}*/ /** * Mode values for Open( ) */ typedef enum VXIinetOpenMode { /** Open for reading, for http:// access this corresponds to a GET * or POST operation (GET in most cases, POST if * INET_URL_QUERY_ARGS is specified and INET_SUBMIT_METHOD is set * to POST) */ INET_MODE_READ = 0x0, /** Open for writing, for http:// access this corresponds to a PUT * operation. Note that this is OPTIONAL functionality that most * implementations do not support (because most Web servers do not * support PUT operations for security reasons). */ INET_MODE_WRITE = 0x1 } VXIinetOpenMode; /** * @name Open flags * @memo Flags for Open( ), may be combined through bitwise or. * @doc The Open() call takes a bitwise or of open flags which control * the behavior of the returned stream. */ /*@{*/ /** Null flag. This causes the cache to use default behavior, specifically I/O using blocking operations. */ #define INET_FLAG_NULL 0x0 /** Non-blocking reads/writes. Do all I/O using non-blocking operations. */ #define INET_FLAG_NONBLOCKING_IO 0x8 /*@}*/ /** * @name Open return properties * @memo Keys identifying properties in VXIMap used to return stream * information for Open( ). * @doc The VXIinet implementation determines information about the file or URI when it opens the URI. These are returned as key/value pairs through a VXIMap. Some values are not guaranteed to be returned after an open, see below. */ /*@{*/ /** Absolute Name, always returned. The absolute URI for a URI which may have been provided as a relative URI against a base. For local file access (file:// access or an OS dependant path) an OS dependant path must be returned, never a file:// URI. This should be passed unmodified as the value of the INET_URL_BASE property for fetching URIs referenced within this document, if any. Returned as a VXIString */ #define INET_INFO_ABSOLUTE_NAME L"inet.info.absoluteName" /** MIME type, always returned. The MIME type of the URI. For HTTP requests, this is set to the type returned by the HTTP server. For file: requests, a MIME mapping table is used to determine the correct MIME type. This table is also used when the HTTP server returns no MIME type or a generic type. If the MIME type cannot be determined at all, it is set to "application/octet-stream". Returned as a VXIString */ #define INET_INFO_MIME_TYPE L"inet.info.mimeType" /** Size in bytes, always returned. Size of the file in bytes. For HTTP requests, this is set to the size returned by the HTTP server. If the server returns no size, or if the file size cannot be determined for file: requests, it is set to zero. Returned as a VXIInteger */ #define INET_INFO_SIZE_BYTES L"inet.info.sizeBytes" /** Validator, always returned on a successful Open( ) or when INET_OPEN_IF_MODIFIED was specified and VXIinet_RESULT_NOT_MODIFIED was returned. Opaque validator for future conditional open operations against the named object, see INET_OPEN_IF_MODIFIED for details. Returned as a VXIContent */ #define INET_INFO_VALIDATOR L"inet.info.validator" /** HTTP status code, always returned for successful HTTP Open( ) operations, or HTTP Open( ) operations that fail due to the remote web server returning a HTTP failure code in the HTTP response. Never returned in other cases (such as for failures for file:// fetches, or failures for HTTP fetches due to non-HTTP response failures such as TCP/IP connection failures). HTTP status code from the last HTTP response received related to the Open( ) request. Returned as a VXIInteger. For example, a successful Open( ) for a http:// URL will most commonly report a HTTP status 200 (OK), while a failed attempt will often report a HTTP status 404 (Not Found). Note that interim response codes, such as HTTP status 301 (Redirect -- Moved Permanently) should not be returned as the VXIinet implementation should respond by doing a HTTP request against the redirected location, resulting in a new HTTP status code from the new HTTP response. */ #define INET_INFO_HTTP_STATUS L"inet.info.httpStatus" /** * INET_INFO_VALIDATOR_STRONG. Open() must return this property as a * VXIinteger with value TRUE when a strong validator is available for the * page. **/ #define INET_INFO_VALIDATOR_STRONG L"inet.info.validatorStrong" /** * Expires hint. Timestamp indicating when the cache entry will expire. * The property is returned by Open() as a VXIInteger representing an * ANSI/ISO time_t integer, representing the number of seconds since Jan 1, * 1970). If the entry is already expired, a VXIInteger of value 0 is * returned. This number only indicates this is the time where the request * has to be made again to the remote web server. This doesn't necessarily * mean that there will be new data after this time (For example, having the * property INET_INFO_VALIDATOR_STRONG with * an EXPIRES_HINT of 0, means the URL has to * be revalidated but does not imply that the data will change. **/ #define INET_INFO_EXPIRES_HINT L"inet.info.expiresHint" /*@}*/ /** * @name INET_COOKIE * @memo Cookie jar properties * * @doc * * Cookie jars are represented by a VXIVector. Each element of the * vector is a VXIMap that represents a cookie. The cookie VXIMap will * contain zero or more properties, each of which represent properties * of the cookie. * * The properties of the cookie VXIMap match the cookie attribute * names as defined in RFC 2965. The only exceptions are as follows: * * - INET_COOKIE_NAME, name of the cookie as defined in RFC 2965 * - INET_COOKIE_VALUE, value of the cookie as defined in RFC 2965 * - INET_COOKIE_EXPIRES, expiration time for the cookie as calculated * off the MaxAge parameter defined in RFC 2965 when the cookie * is accepted * - RFC 2965 Discard attribute: will never be returned in the VXIMap, * cookies with this flag set will never be returned by * GetCookieJar( ) */ /*@{*/ /** Cookie name. Value of the key is a VXIString. */ #define INET_COOKIE_NAME L"inet.cookie.NAME" /** Cookie value key. Value of the key is a VXIString. */ #define INET_COOKIE_VALUE L"inet.cookie.VALUE" /* VXIString */ /** Cookie expires key, calculated off the Max-Age property for the cookie. Value of the key is a VXIInteger giving time since the epoch for expiration. */ #define INET_COOKIE_EXPIRES L"inet.cookie.EXPIRES" /** Cookie comment, optional. Value of the key is a VXIString. */ #define INET_COOKIE_COMMENT L"inet.cookie.Comment" /** Cookie comment URL, optional. Value of the key is a VXIString. */ #define INET_COOKIE_COMMENT_URL L"inet.cookie.CommentURL" /** Cookie domain key. Value of the key is a VXIString. */ #define INET_COOKIE_DOMAIN L"inet.cookie.Domain" /** Cookie path key. Value of the key is a VXIString. */ #define INET_COOKIE_PATH L"inet.cookie.Path" /** Cookie port key, optional. Value of the key is a VXIInteger. */ #define INET_COOKIE_PORT L"inet.cookie.Port" /** Cookie secure key, optional. Value of the key is a VXIInteger set to 0 (FALSE) or 1 (TRUE). */ #define INET_COOKIE_SECURE L"inet.cookie.Secure" /** Cookie standard version. Value of the key is a VXIInteger. */ #define INET_COOKIE_VERSION L"inet.cookie.Version" /*@}*/ /** * @name VXIinetResult * @memo Result codes for interface methods * * @doc * Result codes less then zero are severe errors (likely to be * platform faults), those greater then zero are warnings (likely to * be application issues) */ typedef enum VXIinetResult { /** Fatal error, terminate call */ VXIinet_RESULT_FATAL_ERROR = -100, /** I/O error */ VXIinet_RESULT_IO_ERROR = -8, /** Out of memory */ VXIinet_RESULT_OUT_OF_MEMORY = -7, /** System error, out of service */ VXIinet_RESULT_SYSTEM_ERROR = -6, /** Errors from platform services */ VXIinet_RESULT_PLATFORM_ERROR = -5, /** Return buffer too small */ VXIinet_RESULT_BUFFER_TOO_SMALL = -4, /** Property name is not valid */ VXIinet_RESULT_INVALID_PROP_NAME = -3, /** Property value is not valid */ VXIinet_RESULT_INVALID_PROP_VALUE = -2, /** Invalid function argument */ VXIinet_RESULT_INVALID_ARGUMENT = -1, /** Success */ VXIinet_RESULT_SUCCESS = 0, /** Normal failure, nothing logged */ VXIinet_RESULT_FAILURE = 1, /** Non-fatal non-specific error */ VXIinet_RESULT_NON_FATAL_ERROR = 2, /** Named data not found */ VXIinet_RESULT_NOT_FOUND = 50, /** URL fetch timeout */ VXIinet_RESULT_FETCH_TIMEOUT = 51, /** Other URL fetch error */ VXIinet_RESULT_FETCH_ERROR = 52, /** I/O operation would block */ VXIinet_RESULT_WOULD_BLOCK = 53, /** End of stream */ VXIinet_RESULT_END_OF_STREAM = 54, /** Local file, told not to open it */ VXIinet_RESULT_LOCAL_FILE = 55, /** Conditional open attempted, cached data may be used */ VXIinet_RESULT_NOT_MODIFIED = 57, /** Operation is not supported */ VXIinet_RESULT_UNSUPPORTED = 100 } VXIinetResult; /* ** ================================================== ** VXIinetInterface Interface Definition ** ================================================== */ /** @name VXIinetInterface ** @memo VXIinet interface for URL fetching and posting ** @doc VXIinetInterface provides the URI fetch functions required by
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -