Home
Highly Reusable Software By activity User Interface Text Strings Math Processing
Stored Data
Communications
Hard World File System
|
#License - #Source code - #Example Use -
#include <librock/html.h> char * librock_HTML_astrcatEntityEncodeappend to a librock_astring, encoding HTML character entities (like <,>,&)
( char **ppaszHTML, // append to this destination const char *pText, // source. Plain text. int cbText // max octets at pText ); // returns *ppaszHTML
#ifdef librock_TYPICAL_USE_HTML_astrcatEntityEncode
/* Prepare plain text for HTML output */
char *aszHTML = 0;
char *pText = "Show <maillocalhost>";
;
librock_HTML_astrcatEntityEncode(&aszHTML, /* (char **) */
pText, /* (const char *) */
strlen(pText)); /* (int) */
if (!aszHTML) return "E-0-astring memory allocation error";
printf("%s\n",aszHTML);
#endif
char *
librock_HTML_astrcatEntityDecode(
char **ppasz, // append to this destination
const char *textHTML, // Source, HTML
int cbTextHTML // max octets at textHTML
); // returns *ppasz
Typical use is to prepare plain text for HTML output, or read HTML input.
#ifdef librock_TYPICAL_USE_HTML_astrcatEntityEncode
char *asz = 0;
char *ptr = "Show <maillocalhost>";
;
librock_HTML_astrcatEntityEncode(&asz,ptr,strlen(ptr));
printf("%s\n", asz);
#endif
strlen() strcpy() librock_astrensure() librock_astrcat()
Copyright 1998-2002 Forrest J. Cavalier III, http://www.mibsoftware.com Licensed under BSD-ish license, NO WARRANTY. Copies must retain this block. License text in <librock/license/librock.txt> librock_LIDESC_HC=12440211096131f5976d36be0cddca4cd9152e45
librock_HTML_astrcatEntityDecode passed tests in thtml (Unix/Linux/BSD: 2002/08/08 sys=FreeBSD using gcc)
librock_HTML_astrcatEntityDecode passed tests in thtml (WIN32: 2002/08/08 sys=NT 4.0 using MSVC)
librock_HTML_astrcatEntityEncode passed tests in thtml (Unix/Linux/BSD: 2002/08/08 sys=FreeBSD using gcc)
librock_HTML_astrcatEntityEncode passed tests in thtml (WIN32: 2002/08/08 sys=NT 4.0 using MSVC)
Verbatim copying and distribution of this generated page is permitted in any medium provided that no changes are made.
(The source of this manual page may be covered by a more permissive license which allows modifications.)
Want to help? We welcome comments, patches. -- Need help? Request paid support.