Sun, 15 Jan 2017 18:27:09 +0100
removes some unused stuff
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * * THE BSD LICENSE * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef BASE_PBLOCK_H #define BASE_PBLOCK_H #ifndef NOINTNSAPI #define INTNSAPI #endif /* !NOINTNSAPI */ /* * pblock.h: Header for Parameter Block handling functions * * * A parameter block is a set of name=value pairs which are generally used * as parameters, but can be anything. They are kept in a hash table for * reasonable speed, but if you are doing any intensive modification or * access of them you should probably make a local copy of each parameter * while working. * * Rob McCool * */ #ifndef NETSITE_H #include "../public/nsapi.h" #include "../daemon/netsite.h" #endif /* !NETSITE_H */ #ifdef XP_WIN32 #ifdef BUILD_DLL #define BASE_DLL _declspec(dllexport) #else #define BASE_DLL _declspec(dllimport) #endif #else #define BASE_DLL #endif #ifdef INTNSAPI /* --- Begin function prototypes --- */ #ifdef __cplusplus extern "C" { #endif NSAPI_PUBLIC pb_param *INTparam_create(const char *name, const char *value); NSAPI_PUBLIC int INTparam_free(pb_param *pp); NSAPI_PUBLIC pblock *INTpblock_create(int n); NSAPI_PUBLIC void INTpblock_free(pblock *pb); NSAPI_PUBLIC char *INTpblock_findval(const char *name, const pblock *pb); NSAPI_PUBLIC pb_param *INTpblock_nvinsert(const char *name, const char *value, pblock *pb); NSAPI_PUBLIC pb_param *pblock_nvlinsert(const char *name, int namelen, const char *value, int valuelen, pblock *pb); NSAPI_PUBLIC pb_param *INTpblock_nninsert(const char *name, int value, pblock *pb); NSAPI_PUBLIC void INTpblock_pinsert(pb_param *pp, pblock *pb); NSAPI_PUBLIC int INTpblock_str2pblock(const char *str, pblock *pb); NSAPI_PUBLIC char *INTpblock_pblock2str(const pblock *pb, char *str); NSAPI_PUBLIC int INTpblock_copy(const pblock *src, pblock *dst); NSAPI_PUBLIC pblock *INTpblock_dup(const pblock *src); NSAPI_PUBLIC char **INTpblock_pb2env(const pblock *pb, char **env); NSAPI_PUBLIC void pblock_nvreplace (const char *name, const char *value, pblock *pb); /* --------------------------- Internal things ---------------------------- */ typedef struct pb_key pb_key; const pb_key *const pb_key_accept; const pb_key *const pb_key_accept_charset; const pb_key *const pb_key_accept_encoding; const pb_key *const pb_key_accept_language; const pb_key *const pb_key_accept_ranges; const pb_key *const pb_key_actual_route; const pb_key *const pb_key_age; const pb_key *const pb_key_always_allow_chunked; const pb_key *const pb_key_always_use_keep_alive; const pb_key *const pb_key_auth_cert; const pb_key *const pb_key_auth_expiring; const pb_key *const pb_key_auth_group; const pb_key *const pb_key_auth_type; const pb_key *const pb_key_auth_user; const pb_key *const pb_key_authorization; const pb_key *const pb_key_browser; const pb_key *const pb_key_c2p_cl; const pb_key *const pb_key_c2p_hl; const pb_key *const pb_key_cache_info; const pb_key *const pb_key_charset; const pb_key *const pb_key_check_http_server; const pb_key *const pb_key_ChunkedRequestBufferSize; const pb_key *const pb_key_ChunkedRequestTimeout; const pb_key *const pb_key_cipher; const pb_key *const pb_key_clf_request; const pb_key *const pb_key_cli_status; const pb_key *const pb_key_client_cert_nickname; const pb_key *const pb_key_client_ip; const pb_key *const pb_key_close; const pb_key *const pb_key_connect_timeout; const pb_key *const pb_key_connection; const pb_key *const pb_key_cont; const pb_key *const pb_key_content_encoding; const pb_key *const pb_key_content_language; const pb_key *const pb_key_content_length; const pb_key *const pb_key_content_location; const pb_key *const pb_key_content_md5; const pb_key *const pb_key_content_range; const pb_key *const pb_key_content_type; const pb_key *const pb_key_cookie; const pb_key *const pb_key_date; const pb_key *const pb_key_DATE_GMT; const pb_key *const pb_key_DATE_LOCAL; const pb_key *const pb_key_dir; const pb_key *const pb_key_Directive; const pb_key *const pb_key_dns; const pb_key *const pb_key_DOCUMENT_NAME; const pb_key *const pb_key_DOCUMENT_URI; const pb_key *const pb_key_domain; const pb_key *const pb_key_enc; const pb_key *const pb_key_engine; const pb_key *const pb_key_error_action; const pb_key *const pb_key_error_desc; const pb_key *const pb_key_error_fn; const pb_key *const pb_key_escape; const pb_key *const pb_key_escaped; const pb_key *const pb_key_etag; const pb_key *const pb_key_expect; const pb_key *const pb_key_expires; const pb_key *const pb_key_expr; const pb_key *const pb_key_filter; const pb_key *const pb_key_find_pathinfo_forward; const pb_key *const pb_key_flushTimer; const pb_key *const pb_key_fn; const pb_key *const pb_key_from; const pb_key *const pb_key_full_headers; const pb_key *const pb_key_hdr; const pb_key *const pb_key_host; const pb_key *const pb_key_hostname; const pb_key *const pb_key_if_match; const pb_key *const pb_key_if_modified_since; const pb_key *const pb_key_if_none_match; const pb_key *const pb_key_if_range; const pb_key *const pb_key_if_unmodified_since; const pb_key *const pb_key_ip; const pb_key *const pb_key_iponly; const pb_key *const pb_key_issuer_dn; const pb_key *const pb_key_jroute; const pb_key *const pb_key_keep_alive; const pb_key *const pb_key_keep_alive_timeout; const pb_key *const pb_key_keysize; const pb_key *const pb_key_lang; const pb_key *const pb_key_LAST_MODIFIED; const pb_key *const pb_key_last_modified; const pb_key *const pb_key_level; const pb_key *const pb_key_location; const pb_key *const pb_key_lock_owner; const pb_key *const pb_key_magnus_charset; const pb_key *const pb_key_magnus_internal; const pb_key *const pb_key_magnus_internal_dav_src; const pb_key *const pb_key_magnus_internal_default_acls_only; const pb_key *const pb_key_magnus_internal_error_j2ee; const pb_key *const pb_key_magnus_internal_j2ee_nsapi; const pb_key *const pb_key_magnus_internal_preserve_srvhdrs; const pb_key *const pb_key_magnus_internal_set_request_status; const pb_key *const pb_key_magnus_internal_set_response_status; const pb_key *const pb_key_magnus_internal_webapp_errordesc; const pb_key *const pb_key_matched_browser; const pb_key *const pb_key_max_age; const pb_key *const pb_key_max_forwards; const pb_key *const pb_key_message; const pb_key *const pb_key_method; const pb_key *const pb_key_name; const pb_key *const pb_key_nocache; const pb_key *const pb_key_nostat; const pb_key *const pb_key_ntrans_base; const pb_key *const pb_key_offline_origin_addr; const pb_key *const pb_key_offline_proxy_addr; const pb_key *const pb_key_origin_addr; const pb_key *const pb_key_p2c_cl; const pb_key *const pb_key_p2c_hl; const pb_key *const pb_key_p2r_cl; const pb_key *const pb_key_p2r_hl; const pb_key *const pb_key_parse_timeout; const pb_key *const pb_key_password; const pb_key *const pb_key_path; const pb_key *const pb_key_PATH_INFO; const pb_key *const pb_key_path_info; const pb_key *const pb_key_pblock; const pb_key *const pb_key_poll_interval; const pb_key *const pb_key_pool; // new const pb_key *const pb_key_port; const pb_key *const pb_key_ppath; const pb_key *const pb_key_pragma; const pb_key *const pb_key_process_request_body; const pb_key *const pb_key_process_response_body; const pb_key *const pb_key_protocol; const pb_key *const pb_key_proxy_addr; const pb_key *const pb_key_proxy_agent; const pb_key *const pb_key_proxy_auth_cert; const pb_key *const pb_key_proxy_authorization; const pb_key *const pb_key_proxy_cipher; const pb_key *const pb_key_proxy_issuer_dn; const pb_key *const pb_key_proxy_jroute; const pb_key *const pb_key_proxy_keysize; const pb_key *const pb_key_proxy_ping; const pb_key *const pb_key_proxy_request; const pb_key *const pb_key_proxy_secret_keysize; const pb_key *const pb_key_proxy_ssl_id; const pb_key *const pb_key_proxy_user_dn; const pb_key *const pb_key_query; const pb_key *const pb_key_QUERY_STRING; const pb_key *const pb_key_QUERY_STRING_UNESCAPED; const pb_key *const pb_key_r2p_cl; const pb_key *const pb_key_r2p_hl; const pb_key *const pb_key_range; const pb_key *const pb_key_referer; const pb_key *const pb_key_reformat_request_headers; const pb_key *const pb_key_remote_status; const pb_key *const pb_key_request_jroute; const pb_key *const pb_key_required_rights; const pb_key *const pb_key_retries; const pb_key *const pb_key_rewrite_content_location; const pb_key *const pb_key_rewrite_host; const pb_key *const pb_key_rewrite_location; const pb_key *const pb_key_rewrite_set_cookie; const pb_key *const pb_key_root; const pb_key *const pb_key_route; const pb_key *const pb_key_route_cookie; const pb_key *const pb_key_route_hdr; const pb_key *const pb_key_route_offline; const pb_key *const pb_key_script_name; const pb_key *const pb_key_secret_keysize; const pb_key *const pb_key_secure; const pb_key *const pb_key_server; const pb_key *const pb_key_set_cookie; const pb_key *const pb_key_socks_addr; const pb_key *const pb_key_ssl_id; const pb_key *const pb_key_ssl_unclean_shutdown; const pb_key *const pb_key_status; const pb_key *const pb_key_sticky_cookie; const pb_key *const pb_key_sticky_param; const pb_key *const pb_key_suppress_request_headers; const pb_key *const pb_key_svr_status; const pb_key *const pb_key_timeout; const pb_key *const pb_key_to; const pb_key *const pb_key_transfer_encoding; const pb_key *const pb_key_transmit_timeout; const pb_key *const pb_key_tunnel_non_http_response; const pb_key *const pb_key_type; const pb_key *const pb_key_upstream_jroute; const pb_key *const pb_key_uri; const pb_key *const pb_key_url; const pb_key *const pb_key_url_prefix; const pb_key *const pb_key_UseOutputStreamSize; const pb_key *const pb_key_user; const pb_key *const pb_key_user_agent; const pb_key *const pb_key_user_dn; const pb_key *const pb_key_validate_server_cert; const pb_key *const pb_key_value; const pb_key *const pb_key_vary; const pb_key *const pb_key_via; const pb_key *const pb_key_warning; NSAPI_PUBLIC pool_handle_t *pblock_pool(pblock *pb); NSAPI_PUBLIC pb_param *pblock_param_create(pblock *pb, const char *name, const char *value); NSAPI_PUBLIC pblock *pblock_create_pool(pool_handle_t *pool_handle, int n); NSAPI_PUBLIC pb_param *INTpblock_fr(const char *name, pblock *pb, int remove); NSAPI_PUBLIC char *INTpblock_replace(const char *name,char * new_value,pblock *pb); NSAPI_PUBLIC int INTpblock_str2pblock_lowercasename(const char *str, pblock *pb); NSAPI_PUBLIC pb_param *pblock_removeone(pblock *pb); NSAPI_PUBLIC const pb_key *pblock_key(const char *name); NSAPI_PUBLIC pb_param *pblock_key_param_create(pblock *pb, const pb_key *key, const char *value, int valuelen); NSAPI_PUBLIC char *pblock_findkeyval(const pb_key *key, const pblock *pb); NSAPI_PUBLIC pb_param *pblock_findkey(const pb_key *key, const pblock *pb); NSAPI_PUBLIC pb_param *pblock_removekey(const pb_key *key, pblock *pb); NSAPI_PUBLIC pb_param *pblock_kvinsert(const pb_key *key, const char *value, int valuelen, pblock *pb); NSAPI_PUBLIC void pblock_kpinsert(const pb_key *key, pb_param *pp, pblock *pb); NSAPI_PUBLIC void pblock_kvreplace(const pb_key *key, const char *value, int valuelen, pblock *pb); NSAPI_PUBLIC pb_param *pblock_kninsert(const pb_key *key, int value, pblock *pb); NSAPI_PUBLIC pb_param *pblock_kllinsert(const pb_key *key, int64_t value, pblock *pb); #ifdef __cplusplus inline const pb_key *param_key(pb_param *pp) { return *(const pb_key **)(pp + 1); /* XXX see plist_pvt.h */ } #endif #define PARAM_KEY(pp) *(const pb_key **)(pp + 1) /* new */ #ifdef __cplusplus } #endif #define param_create INTparam_create #define param_free INTparam_free #define pblock_create INTpblock_create #define pblock_free INTpblock_free #define pblock_findval INTpblock_findval #define pblock_nvinsert INTpblock_nvinsert #define pblock_nninsert INTpblock_nninsert #define pblock_pinsert INTpblock_pinsert #define pblock_str2pblock INTpblock_str2pblock #define pblock_pblock2str INTpblock_pblock2str #define pblock_copy INTpblock_copy #define pblock_dup INTpblock_dup #define pblock_pb2env INTpblock_pb2env #define pblock_fr INTpblock_fr #define pblock_replace INTpblock_replace #endif /* INTNSAPI */ #endif /* !BASE_PBLOCK_H */