📄 htreqman.c
字号:
}PUBLIC HTRsHd HTRequest_rsHd (HTRequest * me){ return me ? me->ResponseMask : 0;}/*** Set Entity Headers (for the object)*/PUBLIC void HTRequest_setEnHd (HTRequest * me, HTEnHd enhd){ if (me) me->EntityMask = enhd;}PUBLIC void HTRequest_addEnHd (HTRequest * me, HTEnHd enhd){ if (me) me->EntityMask |= enhd;}PUBLIC HTEnHd HTRequest_enHd (HTRequest * me){ return me ? me->EntityMask : 0;}/*** Extra Header Generators. list can be NULL*/PUBLIC void HTRequest_setGenerator (HTRequest * me, HTList *generator, BOOL override){ if (me) { me->generators = generator; me->gens_local = override; }}PUBLIC HTList * HTRequest_generator (HTRequest * me, BOOL *override){ if (me) { *override = me->gens_local; return me->generators; } return NULL;}/*** Extra Header Parsers. list can be NULL*/PUBLIC void HTRequest_setMIMEParseSet (HTRequest * me, HTMIMEParseSet * parseSet, BOOL local){ if (me) { me->parseSet = parseSet; me->pars_local = local; }}PUBLIC HTMIMEParseSet * HTRequest_MIMEParseSet (HTRequest * me, BOOL * pLocal){ if (me) { if (pLocal) *pLocal = me->pars_local; return me->parseSet; } return NULL;}/*** Accept Format Types** list can be NULL*/PUBLIC void HTRequest_setConversion (HTRequest * me, HTList *type, BOOL override){ if (me) { me->conversions = type; me->conv_local = override; }}PUBLIC HTList * HTRequest_conversion (HTRequest * me){ return me ? me->conversions : NULL;}/*** Accept Encoding ** list can be NULL*/PUBLIC void HTRequest_setEncoding (HTRequest * me, HTList *enc, BOOL override){ if (me) { me->encodings = enc; me->enc_local = override; }}PUBLIC HTList * HTRequest_encoding (HTRequest * me){ return me ? me->encodings : NULL;}/*** Accept Transfer Encoding ** list can be NULL*/PUBLIC void HTRequest_setTransfer (HTRequest * me, HTList * te, BOOL override){ if (me) { me->tes = te; me->te_local = override; }}PUBLIC HTList * HTRequest_transfer (HTRequest * me){ return me ? me->tes : NULL;}/*** Accept Language** list can be NULL*/PUBLIC void HTRequest_setLanguage (HTRequest * me, HTList *lang, BOOL override){ if (me) { me->languages = lang; me->lang_local = override; }}PUBLIC HTList * HTRequest_language (HTRequest * me){ return me ? me->languages : NULL;}/*** Accept Charset** list can be NULL*/PUBLIC void HTRequest_setCharset (HTRequest * me, HTList *charset, BOOL override){ if (me) { me->charsets = charset; me->char_local = override; }}PUBLIC HTList * HTRequest_charset (HTRequest * me){ return me ? me->charsets : NULL;}/*** Are we using the full URL in the request or not?*/PUBLIC void HTRequest_setFullURI (HTRequest * me, BOOL mode){ if (me) me->full_uri = mode;}PUBLIC BOOL HTRequest_fullURI (HTRequest * me){ return me ? me->full_uri : NO;}/*** Are we using a proxy or not and in that case, which one?*/PUBLIC BOOL HTRequest_setProxy (HTRequest * me, const char * proxy){ if (me && proxy) { StrAllocCopy(me->proxy, proxy); return YES; } return NO;}PUBLIC char * HTRequest_proxy (HTRequest * me){ return me ? me->proxy : NULL;}PUBLIC BOOL HTRequest_deleteProxy (HTRequest * me){ if (me) { HT_FREE(me->proxy); return YES; } return NO;}/*** Reload Mode*/PUBLIC void HTRequest_setReloadMode (HTRequest * me, HTReload mode){ if (me) me->reload = mode;}PUBLIC HTReload HTRequest_reloadMode (HTRequest * me){ return me ? me->reload : HT_CACHE_OK;}/*** Cache control directives. The cache control can be initiated by both** the server and the client which is the reason for keeping two lists*/PUBLIC BOOL HTRequest_addCacheControl (HTRequest * me, char * token, char * value){ if (me) { if (!me->cache_control) me->cache_control = HTAssocList_new(); return HTAssocList_replaceObject(me->cache_control, token, value); } return NO;}PUBLIC BOOL HTRequest_deleteCacheControl (HTRequest * me){ if (me && me->cache_control) { HTAssocList_delete(me->cache_control); me->cache_control = NULL; return YES; } return NO;}PUBLIC HTAssocList * HTRequest_cacheControl (HTRequest * me){ return (me ? me->cache_control : NULL);}/*** Byte ranges*/PUBLIC BOOL HTRequest_deleteRange (HTRequest * me){ if (me && me->byte_ranges) { HTAssocList_delete(me->byte_ranges); me->byte_ranges = NULL; return YES; } return NO;}PUBLIC BOOL HTRequest_addRange (HTRequest * me, char * unit, char * range){ if (me) { if (!me->byte_ranges) { me->byte_ranges = HTAssocList_new(); HTRequest_addRqHd(me, HT_C_RANGE); } return HTAssocList_replaceObject(me->byte_ranges, unit, range); } return NO;}PUBLIC HTAssocList * HTRequest_range (HTRequest * me){ return (me ? me->byte_ranges : NULL);}/*** Connection directives. The connection directies can be initiated by** both the server and the client which is the reason for keeping two** lists*/PUBLIC BOOL HTRequest_addConnection (HTRequest * me, char * token, char * value){ if (me) { if (!me->connection) me->connection = HTAssocList_new(); return HTAssocList_replaceObject(me->connection, token, value); } return NO;}PUBLIC BOOL HTRequest_deleteConnection (HTRequest * me){ if (me && me->connection) { HTAssocList_delete(me->connection); me->connection = NULL; return YES; } return NO;}PUBLIC HTAssocList * HTRequest_connection (HTRequest * me){ return (me ? me->connection : NULL);}/*** Expect directives. */PUBLIC BOOL HTRequest_addExpect (HTRequest * me, char * token, char * value){ if (me) { if (!me->expect) me->expect = HTAssocList_new(); return HTAssocList_replaceObject(me->expect, token, value); } return NO;}PUBLIC BOOL HTRequest_deleteExpect (HTRequest * me){ if (me && me->expect) { HTAssocList_delete(me->expect); me->expect = NULL; return YES; } return NO;}PUBLIC HTAssocList * HTRequest_expect (HTRequest * me){ return (me ? me->expect : NULL);}/*** Access Authentication Credentials*/PUBLIC BOOL HTRequest_deleteCredentialsAll (HTRequest * me){ if (me && me->credentials) { HTAssocList_delete(me->credentials); me->credentials = NULL; return YES; } return NO;}PUBLIC BOOL HTRequest_addCredentials (HTRequest * me, char * token, char * value){ if (me) { if (!me->credentials) me->credentials = HTAssocList_new(); return HTAssocList_addObject(me->credentials, token, value); } return NO;}PUBLIC HTAssocList * HTRequest_credentials (HTRequest * me){ return (me ? me->credentials : NULL);}/*** Access Authentication Realms*/PUBLIC BOOL HTRequest_setRealm (HTRequest * me, char * realm){ if (me && realm && realm != me->realm) { StrAllocCopy(me->realm, realm); return YES; } return NO;}PUBLIC const char * HTRequest_realm (HTRequest * me){ return (me ? me->realm : NULL);}PUBLIC BOOL HTRequest_deleteRealm (HTRequest * me){ if (me) { HT_FREE(me->realm); return YES; } return NO;}/*** PEP Protocol header*/PUBLIC BOOL HTRequest_addProtocol (HTRequest * me, char * token, char * value){ if (me) { if (!me->protocol) me->protocol = HTAssocList_new(); return HTAssocList_addObject(me->protocol, token,value); } return NO;}PUBLIC BOOL HTRequest_deleteProtocolAll (HTRequest * me){ if (me && me->protocol) { HTAssocList_delete(me->protocol); me->protocol = NULL; return YES; } return NO;}PUBLIC HTAssocList * HTRequest_protocol (HTRequest * me){ return (me ? me->protocol : NULL);}/*** PEP Protocol Info header*/PUBLIC BOOL HTRequest_addProtocolInfo (HTRequest * me, char * token, char * value){ if (me) { if (!me->protocol_info) me->protocol_info = HTAssocList_new(); return HTAssocList_addObject(me->protocol_info, token,value); } return NO;}PUBLIC BOOL HTRequest_deleteProtocolInfoAll (HTRequest * me){ if (me && me->protocol_info) { HTAssocList_delete(me->protocol_info); me->protocol_info = NULL; return YES; } return NO;}PUBLIC HTAssocList * HTRequest_protocolInfo (HTRequest * me){ return (me ? me->protocol_info : NULL);}/*** PEP Protocol request header*/PUBLIC BOOL HTRequest_addProtocolRequest (HTRequest * me, char * token, char * value){ if (me) { if (!me->protocol_request) me->protocol_request = HTAssocList_new(); return HTAssocList_addObject(me->protocol_request, token,value); } return NO;}PUBLIC BOOL HTRequest_deleteProtocolRequestAll (HTRequest * me){ if (me && me->protocol_request) { HTAssocList_delete(me->protocol_request); me->protocol_request = NULL; return YES; } return NO;}PUBLIC HTAssocList * HTRequest_protocolRequest (HTRequest * me){ return (me ? me->protocol_request : NULL);}/*** Anchor*/PUBLIC void HTRequest_setAnchor (HTRequest * me, HTAnchor *anchor){ if (me) { me->anchor = HTAnchor_parent(anchor); me->childAnchor = ((HTAnchor *) me->anchor != anchor) ? (HTChildAnchor *) anchor : NULL; }}PUBLIC HTParentAnchor * HTRequest_anchor (HTRequest * me){ return me ? me->anchor : NULL;}PUBLIC HTChildAnchor * HTRequest_childAnchor (HTRequest * me){ return me ? me->childAnchor : NULL;}/*** Parent anchor for Referer field*/PUBLIC void HTRequest_setParent (HTRequest * me, HTParentAnchor *parent){ if (me) me->parentAnchor = parent;}PUBLIC HTParentAnchor * HTRequest_parent (HTRequest * me){ return me ? me->parentAnchor : NULL;}/*** Output stream*/PUBLIC void HTRequest_setOutputStream (HTRequest * me, HTStream *output){ if (me) { if (output) { me->output_stream = HTNoFreeStream_new(output); me->orig_output_stream = output; } else { me->output_stream = output; } }}PUBLIC HTStream *HTRequest_outputStream (HTRequest * me){ return me ? me->output_stream : NULL;}/*** Output format*/PUBLIC void HTRequest_setOutputFormat (HTRequest * me, HTFormat format){ if (me) me->output_format = format;}PUBLIC HTFormat HTRequest_outputFormat (HTRequest * me){ return me ? me->output_format : NULL;}/*** Debug stream*/PUBLIC void HTRequest_setDebugStream (HTRequest * me, HTStream *debug){ if (debug) { me->debug_stream = HTNoFreeStream_new(debug); me->orig_debug_stream = debug; } else { me->debug_stream = debug; }}PUBLIC HTStream *HTRequest_debugStream (HTRequest * me){ return me ? me->debug_stream : NULL;}/*** Debug Format*/PUBLIC void HTRequest_setDebugFormat (HTRequest * me, HTFormat format){ if (me) me->debug_format = format;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -