+
+/*
+ * Parses a string, returns 0 if match was not found
+ */
+static ngx_uint_t parse_number(ngx_str_t string, ngx_uint_t start, ngx_uint_t end)
+{
+
+ if (end - start == 0) {
+ return 0;
+ }
+
+ return ngx_atoi(&string.data[start], end - start);
+}
+
+/*
+ * Postconfig Initialization Handler
+ * Sets the request filter at the top of the chain
+ */
+
+static ngx_int_t ngx_http_office_hours_init(ngx_conf_t * cf)
+{
+
+ ngx_http_next_body_filter = ngx_http_top_body_filter;
+ ngx_http_top_body_filter = ngx_http_office_hours_body_filter;
+
+ rc.pattern = TIME_REGEX;
+ rc.pool = cf->pool;
+ if (ngx_regex_compile(&rc) != NGX_OK) {
+ return NGX_ERROR;
+ }
+
+ return NGX_OK;
+}