#include "internal.h" static char * const fhp_strings[] = { "GET", "POST", "HEAD", "PUT", "DELETE", "OPTIONS", "HTTP/1.0", "HTTP/1.1", "content-length", "content-type", "transfer-encoding", "gzip", "x-gzip", "deflate", "x-deflate", "compress", "x-compress", "chunked", "application/x-www-form-urlencoded", "multipart/form-data", NULL }; void fhp_env_init(fhp_env_t * const env) { // calculate hashes for common strings for (size_t i = 0; fhp_strings[i]; i++) env->hashes[i] = fhp_lc_hash_string(fhp_strings[i]); } static fhp_env_t fhp_default_env; fhp_env_t * fhp_get_default_env(void) { static fhp_env_t *r = NULL; // lazy-init default environment if (!r) { r = &fhp_default_env; fhp_env_init(r); } // return success return r; }