mp3splt-gtk
utilities.c File Reference
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <libmp3splt/mp3splt.h>
#include <glib.h>
#include <glib/gi18n.h>
#include <glib/gstdio.h>
#include "player.h"
#include "preferences_tab.h"
#include "main_win.h"
Include dependency graph for utilities.c:

Go to the source code of this file.

Functions

gint check_if_dir (guchar *fname)
 
gint check_if_file (guchar *fname)
 
gboolean container_has_child (GtkContainer *container, GtkWidget *my_child)
 
gint is_filee (const gchar *fname)
 
void print_processing_file (gchar *filename)
 
void remove_end_slash_n_r_from_filename (char *filename)
 
gchar * transform_to_utf8 (gchar *text, gint free_or_not, gint *must_be_freed)
 

Detailed Description


miscellaneous utilities

Miscellaneous utilities like the check if a string may contain a valid file- or directory name.

Definition in file utilities.c.

Function Documentation

gint check_if_dir ( guchar *  fname)

check if a string points to a directory

Todo:
why guchar?

Definition at line 86 of file utilities.c.

Referenced by main().

Here is the caller graph for this function:

gint check_if_file ( guchar *  fname)

check if a sting points to a file

Todo:
  • Why guchar ?
  • And what is the difference to is_filee?

Definition at line 105 of file utilities.c.

Referenced by main().

Here is the caller graph for this function:

gboolean container_has_child ( GtkContainer *  container,
GtkWidget *  my_child 
)

Does this GtkContainer contain that object?

Parameters
GtkContainerThe Container that has to be searched for the child object.
my_childThe child that has to be searched for.

Definition at line 141 of file utilities.c.

Referenced by show_connect_button(), and show_disconnect_button().

Here is the caller graph for this function:

gint is_filee ( const gchar *  fname)

check if the string passed as an argument points to a file

Definition at line 53 of file utilities.c.

Referenced by add_playlist_file(), and disconnect_button_event().

Here is the caller graph for this function:

void print_processing_file ( gchar *  filename)

Issues the message "Processing file <filename>" into the message bar.

Parameters
filenameThe filename that has to be printed.

Definition at line 121 of file utilities.c.

References put_status_message().

Referenced by split_it().

Here is the call graph for this function:

Here is the caller graph for this function:

void remove_end_slash_n_r_from_filename ( char *  filename)

Removes trailing \r or \n characters from a filename.

Todo:
Cannot find any code that removes a trailing slash as this function would suggest

Definition at line 162 of file utilities.c.

gchar* transform_to_utf8 ( gchar *  text,
gint  free_or_not,
gint *  must_be_freed 
)

transform text to utf8

Parameters
textThe text thet has to be converted
free_or_not,:TRUE if this function has to g_free() the text if during conversion it has to copy the text to a new (e.G. larger) buffer.
must_be_freedreads true, if this function has allocated a new chunk of memory to have somewhere to put the output string in - which means that the memory the output string is in has to be freed after usage.
Returns

Definition at line 196 of file utilities.c.

Referenced by freedb_search(), and update_splitpoints_from_the_state().

Here is the caller graph for this function: