diff options
author | Andy Wingo <wingo@pobox.com> | 2001-11-23 04:20:54 +0000 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2001-11-23 04:20:54 +0000 |
commit | 680fdd6ce77b0af71b8676dd58d649fb927168dd (patch) | |
tree | 0930f04a4cb604b4a77a0c441ac8773ee34880b9 /gst | |
parent | ec3cd024d3180b30c5f67a94ece200032f300ac1 (diff) |
cleaned up mangling of properties and names in ladspa by using g_strcanon added g_strcanon to gobject2gtk.[ch], not t...
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
Diffstat (limited to 'gst')
-rw-r--r-- | gst/gobject2gtk.c | 19 | ||||
-rw-r--r-- | gst/gobject2gtk.h | 8 |
2 files changed, 27 insertions, 0 deletions
diff --git a/gst/gobject2gtk.c b/gst/gobject2gtk.c index 72165d39c..563711744 100644 --- a/gst/gobject2gtk.c +++ b/gst/gobject2gtk.c @@ -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 diff --git a/gst/gobject2gtk.h b/gst/gobject2gtk.h index 261d9f62d..a14203a26 100644 --- a/gst/gobject2gtk.h +++ b/gst/gobject2gtk.h @@ -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; |