aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorswhite <swhite@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2004-04-13 13:42:54 +0000
committerswhite <swhite@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2004-04-13 13:42:54 +0000
commit310f5363afe8ed31b6381ff002991d5c7cfa6d96 (patch)
tree8915b41c6318d49e0577f63e4cce0cad2cdcdaad /doc
parent373f2b276ec87294bb96e5b148972303308f7763 (diff)
Made HTTPD to correctly describe interface by INCLUDE HEADER mechanism.
Changed internal names of http_Auth.h http_Cookies.h http_Steer.h http_Content.h so that HTTPD thorn developers will be required to use this interface, rather than incorrectly explicitly including the source header files. * Protected SString against C++ name mangling * Gave exported functions the HTTP_ prefix * Wrote doc/Content.h * Fixed bug that disabled some steering functionality git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@192 1faa4e14-9dd3-4be0-9f0e-ffe519881164
Diffstat (limited to 'doc')
-rw-r--r--doc/Content.txt97
1 files changed, 97 insertions, 0 deletions
diff --git a/doc/Content.txt b/doc/Content.txt
new file mode 100644
index 0000000..1149ea9
--- /dev/null
+++ b/doc/Content.txt
@@ -0,0 +1,97 @@
+ /*@@
+ @file Content.txt
+ @date 08.04.2004
+ @author Steve White
+ @desc
+ Description of the Content interface
+ @enddesc
+ @version $Header$
+ @@*/
+
+There is an interface for setting HTML page content information, which is
+accessed by including http_Content.h.
+
+
+This provides functions
+
+int HTTP_SendString(httpRequest *request, const String* message);
+
+which sends the string message to HTTP,
+
+void HTTP_SetHeadInfo( String *header);
+
+which copies a string containing typical content of the HEAD element of
+the standard Cactus HTTPD web pages. Particularly, it includes style
+information, but not the title of the page.
+
+void HTTP_SetDoctype( String *header);
+
+which copies a standard DOCTYPE tag into the string. Typical use will
+be to emit this string immediately before the first HTML tag of the
+web page being generated.
+
+int HTTP_SetContentHeaderString(const cGH *cctkGH, int choice, String *mess,
+ const String *menu);
+
+This copies standard Cactus body HTML information into the string mess.
+If choice is nonzero, the information is appropriate for a main page;
+if it is 0, the information is appropriate for non-main pages.
+If the menu argument is non-null, that string will be appended as
+HTML to the standard menus.
+
+int HTTP_SetContentFooterString(const cGH *cctkGH, int choice, String *mess );
+
+This copies standard Cactus footer HTML into the string mess; if choice is
+nonzero, the information is appropriate for the main page.
+
+int HTTP_ContentSendFromFile(httpRequest *request, int filedes);
+
+which emits the entirety of the file referred to by file descriptor filedes
+to HTTP,
+
+int HTTP_ContentLink(const char *URL,
+ const char *name,
+ const char *description,
+ int flags);
+
+which...I don't know what this does.
+
+The functions
+
+int HTTP_ContentHeader(const cGH *cctkGH, int choice, int len, char *mess,
+ const char *menu);
+int HTTP_ContentFooter(const cGH *cctkGH, int choice, int len, char *mess);
+
+are a little dangerous. They are like the corresponding ContentHeader and
+Footer calls above, with the len attribute indicating the length of the
+character buffer mess.
+
+------------------------------------
+Other included functions
+
+int HTTP_SendString(httpRequest *request, const String* message);
+
+
+Example:
+--------
+
+A web page is typically generated in the following sequence.
+The HTTP connection has already been established and saved in the httpRequest
+pointer, and a String instance 'message' has been created.
+
+ 0) HTTP_Send_OK_Header( httpRequest )
+ 1a) HTTP_SetDoctype( message );
+ 1b) HTTP_SendString( httpRequest, message );
+ 2) HTTP_Send( httpRequest, "<html><head>\n" );
+ 3) HTTP_Send( httpRequest, "<title>My Title</title>\n" );
+ 4a) HTTP_HeadInfo( message );
+ 4b) HTTP_SendString( httpRequest, message );
+ 5) HTTP_Send( httpRequest, "</head><body>\n" );
+ 6) HTTP_HeadInfo( httpRequest );
+ 7a) HTTP_SetContentHeaderString(cctkGH, choice, message, menu);
+ 7b) HTTP_SendString( httpRequest, message );
+ 8) Page content
+ 9a) HTTP_SetContentFooterString(cctkGH, choice, message);
+ 9b) HTTP_SendString( httpRequest, message );
+ 10) HTTP_Send( httpRequest, "</body></html>\n" );
+