From 493c40587bef8b52563f81257cba3fb9d647c8f0 Mon Sep 17 00:00:00 2001 From: Adrian Perez Date: Tue, 4 Sep 2007 21:00:48 +0200 Subject: [PATCH] started work on inliner stuff --- inliner.c | 16 ++++++++++++++++ ngx_http_fancyindex_module.h | 15 ++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/inliner.c b/inliner.c index 96066e9..da0917a 100644 --- a/inliner.c +++ b/inliner.c @@ -5,3 +5,19 @@ * Distributed under terms of the MIT license. */ +#include +#include +#include + + +ngx_buf_t* nfi_inline_getbuf(ngx_http_request_t *r, + const ngx_str_t const * path, ngx_int_t mode) +{ + ngx_buf_t *b; + + if ((b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t))) == NULL) + return NULL; + + return b; +} + diff --git a/ngx_http_fancyindex_module.h b/ngx_http_fancyindex_module.h index 8b6b338..0823103 100644 --- a/ngx_http_fancyindex_module.h +++ b/ngx_http_fancyindex_module.h @@ -8,6 +8,9 @@ #ifndef __ngx_http_fancyindex_module_h__ #define __ngx_http_fancyindex_module_h__ +#include +#include + #define NGX_HTTP_FANCYINDEX_README_ASIS 0x01 #define NGX_HTTP_FANCYINDEX_README_TOP 0x02 @@ -69,10 +72,16 @@ (((_where) & (_what)) == (_what)) -/* - * Internal module functions. +#include + +/** + * Get a buffer out of a file name. The buffer will be ready to add to + * a processing chain (an ngx_chain_t). The "mode" determines how the file + * will be searched for, it ca be either NGX_HTTP_FANCYINDEX_INCLUDE_STATIC + * or NGX_HTTP_FANCYINDEX_INCLUDE_CACHED. */ -void nfi_inliner_init(void); +ngx_buf_t* nfi_inline_getbuf(ngx_http_request_t *req, + const ngx_str_t const * path, ngx_int_t mode); #endif /* !__ngx_http_fancyindex_module_h__ */