X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=webcit%2Fhtml2html.c;h=794f69165c15eb302f1a9cfc92722434bcb504e9;hp=c682cdc37d141121a2c1a2e2a7447de084dad254;hb=c7a28913ad7fbcd263888e0bbb24b380d3a81b9c;hpb=9f33314bbdefcb239a5f7b7ed44aa470f12fe78b diff --git a/webcit/html2html.c b/webcit/html2html.c index c682cdc37..794f69165 100644 --- a/webcit/html2html.c +++ b/webcit/html2html.c @@ -1,19 +1,21 @@ /* * $Id$ - * - * Output an HTML message, modifying it slightly to make sure it plays nice + */ +/** + * \defgroup HTML2HTML Output an HTML message, modifying it slightly to make sure it plays nice * with the rest of our web framework. * */ - +/*@{*/ #include "webcit.h" #include "vcard.h" #include "webserver.h" -/* - * Sanitize and enhance an HTML message for display. +/** + * \brief Sanitize and enhance an HTML message for display. * Also convert weird character sets to UTF-8 if necessary. + * \param charset the input charset */ void output_html(char *charset) { char buf[SIZ]; @@ -33,11 +35,11 @@ void output_html(char *charset) { int linklen; #ifdef HAVE_ICONV iconv_t ic = (iconv_t)(-1) ; - char *ibuf; /* Buffer of characters to be converted */ - char *obuf; /* Buffer for converted characters */ - size_t ibuflen; /* Length of input buffer */ - size_t obuflen; /* Length of output buffer */ - char *osav; /* Saved pointer to output buffer */ + char *ibuf; /**< Buffer of characters to be converted */ + char *obuf; /**< Buffer for converted characters */ + size_t ibuflen; /**< Length of input buffer */ + size_t obuflen; /**< Length of output buffer */ + char *osav; /**< Saved pointer to output buffer */ #endif msg = strdup(""); @@ -93,13 +95,14 @@ void output_html(char *charset) { while (ptr < msgend) { - /* Advance to next tag */ + /** Advance to next tag */ ptr = strchr(ptr, '<'); if ((ptr == NULL) || (ptr >= msgend)) break; ++ptr; if ((ptr == NULL) || (ptr >= msgend)) break; - /* Any of these tags cause everything up to and including + /** + * Any of these tags cause everything up to and including * the tag to be removed. */ if ( (!strncasecmp(ptr, "HTML", 4)) @@ -113,7 +116,8 @@ void output_html(char *charset) { msgstart = ptr; } - /* Any of these tags cause everything including and following + /** + * Any of these tags cause everything including and following * the tag to be removed. */ if ( (!strncasecmp(ptr, "/HTML", 5)) @@ -131,7 +135,8 @@ void output_html(char *charset) { strcpy(converted_msg, ""); ptr = msgstart; while (ptr < msgend) { - /* Change mailto: links to WebCit mail, by replacing the + /** + * Change mailto: links to WebCit mail, by replacing the * link with one that points back to our mail room. Due to * the way we parse URL's, it'll even handle mailto: links * that have "?subject=" in them. @@ -146,7 +151,7 @@ void output_html(char *charset) { ptr = &ptr[16]; ++alevel; } - /* Make links open in a separate window */ + /** Make links open in a separate window */ else if (!strncasecmp(ptr, "
\n"); - /* Now give back the memory */ + /** Now give back the memory */ free(converted_msg); free(msg); } +/*@}*/