-/* g_strlcat() does not exist in GLib 1.2[.x] */
-#if GLIB_MAJOR_VERSION < 2
-gsize g_strlcat(gchar *dst, gchar *src, gsize size);
-gsize g_strlcpy(gchar *dest, const gchar *src, gsize dest_size);
-#endif
-
-#if GLIB_MAJOR_VERSION < 2
-/* g_ascii_isprint() does not exist in GLib 1.2[.x].
- * assume all codes >=0x20 and <0x80 are ASCII printables.
- */
-#define g_ascii_isprint(c) \
- (((c<0x20)||(c>=0x80))?FALSE:TRUE)
-/* g_ascii_isxdigit() does not exist in Glib 1.2 */
-#define g_ascii_isxdigit(c) \
- ( ((c>='0')&&(c<='9'))?TRUE: \
- ( ((c>='a')&&(c<='f'))?TRUE: \
- (((c>='A')&&(c<='F'))?TRUE:FALSE) ) )
-
-#endif
+/** Guarantee a non-null string.
+ *
+ * @param string The string to check
+ * @return A pointer 'string' if it's non-null, otherwise "[NULL]".
+ */
+const char * string_or_null(const char *string);
+
+int escape_string_len(const char *string);
+char * escape_string(char *dst, const char *string);
+
+
+void IA5_7BIT_decode(unsigned char * dest, const unsigned char* src, int len);
+
+/** Copy a string, escaping the 'chr' characters in it
+ *
+ * @param str The string to be copied
+ * @param char The character to be escaped
+ * @return A copy of the string with every original 'chr' being
+ * transformed into double 'chr'.
+ */
+gchar* ws_strdup_escape_char (const gchar *str, const gchar chr);
+
+/** Copy a string, unescaping the 'chr' characters in it
+ *
+ * @param str The string to be copied
+ * @param char The character to be escaped
+ * @return A copy of the string with every occurence of double 'chr' in
+ * the original string being copied as a single 'chr'.
+ */
+gchar* ws_strdup_unescape_char (const gchar *str, const gchar chr);
+
+/** Replace values in a string
+ *
+ * @param str String containing 0 or more values to be replaced.
+ * @param old_val Old value.
+ * @param new_val New value. May be NULL, in which case occurences of
+ * old_value will be removed.
+ * @return A newly-allocated version of str with replacement values or
+ * NULL on failure.
+ */
+gchar *string_replace(const gchar* str, const gchar *old_val, const gchar *new_val);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */