cleaned up mangling of properties and names in ladspa by using g_strcanon added g_str...
authorAndy Wingo <wingo@pobox.com>
Fri, 23 Nov 2001 04:20:54 +0000 (04:20 +0000)
committerAndy Wingo <wingo@pobox.com>
Fri, 23 Nov 2001 04:20:54 +0000 (04:20 +0000)
Original commit message from CVS:
* cleaned up mangling of properties and names in ladspa by using g_strcanon
* added g_strcanon to gobject2gtk.[ch], not tested though

gst/gobject2gtk.c
gst/gobject2gtk.h

index 72165d3..5637117 100644 (file)
@@ -23,7 +23,26 @@ g_slist_delete_link (GSList *list, GSList *llink)
   return temp;
 }
 
+// string helper functions not in glib 1.2
 
+gchar*
+g_strcanon (gchar       *string,
+           const gchar *valid_chars,
+           gchar        substitutor)
+{
+  register gchar *c;
+  
+  g_return_val_if_fail (string != NULL, NULL);
+  g_return_val_if_fail (valid_chars != NULL, NULL);
+    
+  for (c = string; *c; c++)
+    {
+      if (!strchr (valid_chars, *c))
+       *c = substitutor;
+    }
+
+  return string;
+}
 
 // GObject dummy implementation
 static void
index 261d9f6..a14203a 100644 (file)
@@ -21,6 +21,14 @@ GSList *g_slist_delete_link (GSList *list, GSList *llink);
 
 #define g_string_append_printf g_string_printfa
 
+// string helper functions not in glib 1.2
+#define G_CSET_A_2_Z       "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+#define G_CSET_a_2_z       "abcdefghijklmnopqrstuvwxyz"
+#define G_CSET_DIGITS      "0123456789"
+
+gchar* g_strcanon (gchar *string, const gchar *valid_chars, 
+                   gchar substitutor);
+
 
 // GObject
 typedef struct _GObject GObject;