diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-05-31 13:48:41 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-05-31 13:48:41 +0200 |
commit | 4b6749f0a21547677ac4f9b2ea55a31b25432183 (patch) | |
tree | 39dbc1d4022d2d0ccb3913e1eab102eef812d7a4 /src/experiment-player.h | |
parent | 49d37756967e3eecae07ff6797bd76a655c6632c (diff) | |
download | experiment-player-4b6749f0a21547677ac4f9b2ea55a31b25432183.tar.gz |
added inline function for common task of stripping a filename extension
Diffstat (limited to 'src/experiment-player.h')
-rw-r--r-- | src/experiment-player.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/experiment-player.h b/src/experiment-player.h index a8f6e87..a7cda8a 100644 --- a/src/experiment-player.h +++ b/src/experiment-player.h @@ -1,6 +1,9 @@ #ifndef __EXPERIMENT_PLAYER_H #define __EXPERIMENT_PLAYER_H +#include <glib.h> +#include <glib/gprintf.h> + #include <gtk/gtk.h> gboolean load_media_file(const gchar *file); @@ -40,4 +43,16 @@ extern GtkWidget *transcript_wizard_combo, VAR = GTK_WIDGET(gtk_builder_get_object(BUILDER, #VAR)); \ } while (0) +static inline gchar * +path_strip_extension(const gchar *filename) +{ + gchar *ret = g_strdup(filename); + gchar *p; + + if ((p = g_strrstr(ret, ".")) != NULL) + *p = '\0'; + + return ret; +} + #endif
\ No newline at end of file |