From e47ef2722d90998256e226b2e2ec2bcec68b07b5 Mon Sep 17 00:00:00 2001 From: Ian Price Date: Tue, 8 May 2012 00:18:59 +0100 Subject: [PATCH 2/2] Document and export `declare-opaque-header!' * module/web/http.scm (declare-opaque-header!): Add docstring. New export. * doc/ref/web.texi (HTTP): Add documentation. --- doc/ref/web.texi | 5 +++++ module/web/http.scm | 3 +++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/doc/ref/web.texi b/doc/ref/web.texi index e38aee2..7f86748 100644 --- a/doc/ref/web.texi +++ b/doc/ref/web.texi @@ -398,6 +398,11 @@ HTTP stack like this: (display (inet-ntoa ip) port))) @end example +@deffn {Scheme Procedure} declare-opaque-header! name +A specialised version of @code{declare-header!} for the case in which +you want a header's value to be returned/written ``as-is''. +@end deffn + @deffn {Scheme Procedure} valid-header? sym val Return a true value iff @var{val} is a valid Scheme value for the header with name @var{sym}. diff --git a/module/web/http.scm b/module/web/http.scm index 9232b28..cc5dd5a 100644 --- a/module/web/http.scm +++ b/module/web/http.scm @@ -42,6 +42,7 @@ header->string declare-header! + declare-opaque-header! known-header? header-parser header-validator @@ -1145,6 +1146,8 @@ phrase\"." ;; emacs: (put 'declare-header! 'scheme-indent-function 1) ;; emacs: (put 'declare-opaque!-header 'scheme-indent-function 1) (define (declare-opaque-header! name) + "Declares a given header as \"opaque\", meaning that its value is not +treated specially, and is just returned as a plain string." (declare-header! name parse-opaque-string validate-opaque-string write-opaque-string)) -- 1.7.7.6