From ee8d3aa3f337cef3faae8d45c6e23ab05f380db8 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 3 Aug 2008 23:29:01 +0200 Subject: Always generate valid XHTML entities No need to double-escape entities in source XML files, just use single & etc. --- gallery-utils.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'gallery-utils.h') diff --git a/gallery-utils.h b/gallery-utils.h index 1547c90..95dbcff 100644 --- a/gallery-utils.h +++ b/gallery-utils.h @@ -23,10 +23,11 @@ /* * str_replace: replace substring 'search' with a 'replace' string - * - only one occurence of the string is replaced - * - reallocates the original string + * - multiple occurences of the string are replaced + * - specify 'exclude_when' if you want to skip replace when a string found at the place of 'search' + * - reallocates the original string */ -void str_replace (char **dst, const char *search, const char *replace); +void str_replace (char **dst, const char *search, const char *replace, const char *exclude_when); /* * copy_file: copy file from src to dst @@ -39,3 +40,8 @@ gboolean copy_file (const char *src, const char *dst); */ char *make_string (const char* substr, const int count); +/* + * fix_entities: replace all invalid & entities with & + * - returns newly allocated string + */ +void fix_entities (char **str); \ No newline at end of file -- cgit v1.2.3