summaryrefslogtreecommitdiff
path: root/navit/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'navit/util.h')
-rw-r--r--navit/util.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/navit/util.h b/navit/util.h
index 685adc080..6da7808b4 100644
--- a/navit/util.h
+++ b/navit/util.h
@@ -26,10 +26,27 @@
#define MAX_MISMATCH 100
+/**
+ * @brief Escape modes for function str_escape()
+ */
+enum escape_mode {
+ escape_mode_none=0,
+ escape_mode_string=1, /*!< Surround string by double quotes */
+ escape_mode_quote=2, /*!< Escape double quotes and backslashes */
+ escape_mode_html_amp=4, /*!< Use HTML-style escape sequences for ampersands */
+ escape_mode_html_quote=8, /*!< Use HTML-style escape sequences for double quotes */
+ escape_mode_html_apos=16, /*!< Use HTML-style escape sequences for single quotes (apostrophes) */
+ escape_mode_html_lt=32, /*!< Use HTML-style escape sequences for lower than sign ('<') */
+ escape_mode_html_gt=64, /*!< Use HTML-style escape sequences for greater than sign ('>') */
+ escape_mode_html=escape_mode_html_amp|escape_mode_html_quote|escape_mode_html_apos|escape_mode_html_lt|escape_mode_html_gt, /*!< Use all known HTML-style escape sequences */
+};
+
void strtoupper(char *dest, const char *src);
void strtolower(char *dest, const char *src);
unsigned int uint_sqrt(unsigned int n);
int navit_utf8_strcasecmp(const char *s1, const char *s2);
+char *str_escape(enum escape_mode mode, const char *in);
+char *strncpy_unescape(char *dest, const char *src, size_t n);
int compare_name_systematic(const char *s1, const char *s2);
GList * g_hash_to_list(GHashTable *h);
GList * g_hash_to_list_keys(GHashTable *h);