[easytag/wip/easytag-next: 11/13] Add static to many declarations
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/easytag-next: 11/13] Add static to many declarations
- Date: Sun, 6 Jan 2013 14:03:59 +0000 (UTC)
commit 9047a26898f654f27f21c4fe00bf2d4c4e3f4cc9
Author: David King <amigadave amigadave com>
Date: Wed Dec 5 22:09:27 2012 +0000
Add static to many declarations
Use the Samba findstatic.pl script to find functions which should be
static, and mark them as such. Remove unused code, as the compiler gives
warnings about unused static functions.
src/bar.c | 36 +++--
src/bar.h | 2 -
src/browser.c | 261 +++++++++++++++----------------
src/browser.h | 8 -
src/cddb.c | 376 +++++++++++++++++++++-----------------------
src/charset.c | 114 -------------
src/charset.h | 3 -
src/dlm.c | 10 +-
src/easytag.c | 167 ++++++++++++--------
src/easytag.h | 3 -
src/et_core.c | 490 +++++++++++++++-----------------------------------------
src/et_core.h | 20 +---
src/log.c | 26 ++--
src/misc.c | 163 ++++++++++++-------
src/misc.h | 4 +-
src/ogg_tag.c | 5 +-
src/picture.c | 34 +++--
src/prefs.c | 105 ++++++-------
src/scan.c | 210 ++++++++++++++++---------
src/scan.h | 7 -
src/setting.c | 71 ++-------
src/setting.h | 5 -
src/vcedit.c | 9 +-
src/vcedit.h | 2 -
24 files changed, 907 insertions(+), 1224 deletions(-)
---
diff --git a/src/bar.c b/src/bar.c
index 30d8b29..294dc05 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -46,12 +46,11 @@ GList *ActionPairsList = NULL;
/**************
* Prototypes *
**************/
-void Init_Menu_Bar (void);
-void Menu_Sort_Action (GtkAction *action, gpointer data);
-void Statusbar_Start_Timer (void);
-gboolean Statusbar_Stop_Timer (void);
-void Statusbar_Remove_Timer (void);
+static void Check_Menu_Item_Toggled_Browse_Hidden_Dir (GtkWidget *checkmenuitem);
+static void Check_Menu_Item_Toggled_Browse_Subdir (GtkWidget *checkmenuitem);
+static void Init_Menu_Bar (void);
+static void Statusbar_Remove_Timer (void);
/*************
@@ -67,7 +66,8 @@ void Statusbar_Remove_Timer (void);
/*
* Menu bar
*/
-void Menu_Sort_Action (GtkAction *item, gpointer data)
+static void
+Menu_Sort_Action (GtkAction *item, gpointer data)
{
GtkWidget *TBViewMode;
const gchar *action = gtk_action_get_name(item);
@@ -337,7 +337,8 @@ void Create_UI (GtkWidget **ppmenubar, GtkWidget **pptoolbar)
/*
* Initialize some items of the main menu
*/
-void Init_Menu_Bar (void)
+static void
+Init_Menu_Bar (void)
{
CheckMenuItemBrowseSubdirMainMenu = gtk_ui_manager_get_widget(UIManager, "/MenuBar/BrowserMenu/BrowseSubdir");
@@ -364,7 +365,8 @@ void Init_Menu_Bar (void)
/*
* Callback to update state of check button to browse subdir into menu
*/
-void Check_Menu_Item_Toggled_Browse_Subdir (GtkWidget *checkmenuitem)
+static void
+Check_Menu_Item_Toggled_Browse_Subdir (GtkWidget *checkmenuitem)
{
BROWSE_SUBDIR = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(checkmenuitem));
Check_Menu_Item_Update_Browse_Subdir();
@@ -377,7 +379,8 @@ void Check_Menu_Item_Update_Browse_Subdir (void)
/*
* Callback to update state of check button to show hiddendirectories into menu
*/
-void Check_Menu_Item_Toggled_Browse_Hidden_Dir (GtkWidget *checkmenuitem)
+static void
+Check_Menu_Item_Toggled_Browse_Hidden_Dir (GtkWidget *checkmenuitem)
{
BROWSE_HIDDEN_DIR = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(checkmenuitem));
Check_Menu_Item_Update_Browse_Hidden_Dir();
@@ -385,7 +388,9 @@ void Check_Menu_Item_Toggled_Browse_Hidden_Dir (GtkWidget *checkmenuitem)
// Reload directory, in case we have changed BROWSE_HIDDEN_DIR
//Browser_Tree_Rebuild(NULL); // Commented, as already done in GtkToggleActionEntry for AM_BROWSER_HIDDEN_DIR
}
-void Check_Menu_Item_Update_Browse_Hidden_Dir (void)
+
+void
+Check_Menu_Item_Update_Browse_Hidden_Dir (void)
{
#ifndef WIN32
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(CheckMenuItemBrowseHiddenDirMainMenu),BROWSE_HIDDEN_DIR);
@@ -417,19 +422,22 @@ GtkWidget *Create_Status_Bar (void)
return StatusBar;
}
-gboolean Statusbar_Stop_Timer (void)
+static gboolean
+Statusbar_Stop_Timer (void)
{
gtk_statusbar_pop(GTK_STATUSBAR(StatusBar),StatusBarContext);
return FALSE; /* Stop the timer */
}
-void Statusbar_Start_Timer (void)
+static void
+Statusbar_Start_Timer (void)
{
- Statusbar_Remove_Timer();
+ Statusbar_Remove_Timer ();
StatusbarTimerId = g_timeout_add(4000,(GSourceFunc)Statusbar_Stop_Timer,NULL);
}
-void Statusbar_Remove_Timer (void)
+static void
+Statusbar_Remove_Timer (void)
{
if (StatusbarTimerId)
{
diff --git a/src/bar.h b/src/bar.h
index bcbcf7b..635a5bc 100644
--- a/src/bar.h
+++ b/src/bar.h
@@ -163,9 +163,7 @@ GtkWidget *Create_Status_Bar (void);
void Statusbar_Message (gchar *message, gint with_timer);
GtkWidget *Create_Progress_Bar (void);
-void Check_Menu_Item_Toggled_Browse_Subdir (GtkWidget *checkmenuitem);
void Check_Menu_Item_Update_Browse_Subdir (void);
-void Check_Menu_Item_Toggled_Browse_Hidden_Dir (GtkWidget *checkmenuitem);
void Check_Menu_Item_Update_Browse_Hidden_Dir (void);
#endif /* __BAR_H__ */
diff --git a/src/browser.c b/src/browser.c
index f30ab82..9dbdba6 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -131,80 +131,102 @@ gchar *Rename_Directory_Masks [] =
* Prototypes *
**************/
-gboolean Browser_Tree_Key_Press (GtkWidget *tree, GdkEvent *event, gpointer data);
-void Browser_Tree_Set_Node_Visible (GtkWidget *directoryView, GtkTreePath * path);
-void Browser_List_Set_Row_Visible (GtkTreeModel *treeModel, GtkTreeIter *rowIter);
+static gboolean Browser_Tree_Key_Press (GtkWidget *tree, GdkEvent *event,
+ gpointer data);
+static void Browser_Tree_Set_Node_Visible (GtkWidget *directoryView,
+ GtkTreePath *path);
+static void Browser_List_Set_Row_Visible (GtkTreeModel *treeModel,
+ GtkTreeIter *rowIter);
void Browser_Tree_Disable (void);
void Browser_Tree_Enable (void);
-void Browser_Tree_Initialize (void);
-gboolean Browser_Tree_Node_Selected (GtkTreeSelection *selection, gpointer user_data);
-void Browser_Tree_Rename_Directory (gchar *last_path, gchar *new_path);
-void Browser_Tree_Handle_Rename (GtkTreeIter *parentnode, gchar *old_path, gchar *new_path);
+static void Browser_Tree_Initialize (void);
+static gboolean Browser_Tree_Node_Selected (GtkTreeSelection *selection,
+ gpointer user_data);
+static void Browser_Tree_Rename_Directory (const gchar *last_path,
+ const gchar *new_path);
+static void Browser_Tree_Handle_Rename (GtkTreeIter *parentnode,
+ const gchar *old_path,
+ const gchar *new_path);
static gint Browser_List_Key_Press (GtkWidget *list, GdkEvent *event, gpointer data);
-gboolean Browser_List_Button_Press (GtkTreeView *treeView, GdkEventButton *event);
+static gboolean Browser_List_Button_Press (GtkTreeView *treeView,
+ GdkEventButton *event);
void Browser_List_Disable (void);
void Browser_List_Enable (void);
-void Browser_List_Row_Selected (GtkTreeSelection * selection, gpointer data);
-gint Browser_List_Sort_Func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data);
+static void Browser_List_Row_Selected (GtkTreeSelection * selection,
+ gpointer data);
+static void Browser_List_Set_Row_Appearance (GtkTreeIter *iter);
+static gint Browser_List_Sort_Func (GtkTreeModel *model, GtkTreeIter *a,
+ GtkTreeIter *b, gpointer data);
+static void Browser_List_Select_File_By_Iter (GtkTreeIter *iter,
+ gboolean select_it);
void Browser_List_Select_All_Files (void);
void Browser_List_Unselect_All_Files (void);
void Browser_List_Invert_File_Selection (void);
-void Browser_Entry_Activated (void);
+static void Browser_Entry_Activated (void);
void Browser_Entry_Disable (void);
void Browser_Entry_Enable (void);
-void Browser_Parent_Button_Clicked (void);
+static void Browser_Parent_Button_Clicked (void);
-void Browser_Artist_List_Load_Files (ET_File *etfile_to_select);
-void Browser_Artist_List_Row_Selected (GtkTreeSelection *selection, gpointer data);
-void Browser_Artist_List_Set_Row_Appearance(GtkTreeIter *row);
+static void Browser_Artist_List_Load_Files (ET_File *etfile_to_select);
+static void Browser_Artist_List_Row_Selected (GtkTreeSelection *selection,
+ gpointer data);
+static void Browser_Artist_List_Set_Row_Appearance (GtkTreeIter *row);
-void Browser_Album_List_Load_Files (GList *albumlist, ET_File *etfile_to_select);
-void Browser_Album_List_Row_Selected (GtkTreeSelection *selection, gpointer data);
-void Browser_Album_List_Set_Row_Appearance(GtkTreeIter *row);
+static void Browser_Album_List_Load_Files (GList *albumlist,
+ ET_File *etfile_to_select);
+static void Browser_Album_List_Row_Selected (GtkTreeSelection *selection,
+ gpointer data);
+static void Browser_Album_List_Set_Row_Appearance (GtkTreeIter *row);
gchar *Browser_Get_Current_Path (void);
-void Browser_Update_Current_Path (const gchar *path);
+static void Browser_Update_Current_Path (const gchar *path);
void Browser_Load_Home_Directory (void);
void Browser_Load_Default_Directory (void);
void Browser_Reload_Directory (void);
-gint Browser_Win32_Get_Drive_Root (gchar *drive, GtkTreeIter *rootNode, GtkTreePath **rootPath);
+static gboolean Browser_Win32_Get_Drive_Root (gchar *drive,
+ GtkTreeIter *rootNode,
+ GtkTreePath **rootPath);
static gboolean check_for_subdir (gchar *path);
-GtkTreePath *Find_Child_Node(GtkTreeIter *parent, gchar *searchtext);
+static GtkTreePath *Find_Child_Node(GtkTreeIter *parent, gchar *searchtext);
-GdkPixbuf *Pixmap_From_Directory_Permission (gchar *path);
+static GdkPixbuf *Pixmap_From_Directory_Permission (const gchar *path);
static void expand_cb (GtkWidget *tree, GtkTreeIter *iter, GtkTreePath *path, gpointer data);
static void collapse_cb (GtkWidget *tree, GtkTreeIter *iter, GtkTreePath *treePath, gpointer data);
/* Pop up menus */
-gboolean Browser_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event);
+static gboolean Browser_Popup_Menu_Handler (GtkMenu *menu,
+ GdkEventButton *event);
/* For window to rename a directory */
void Browser_Open_Rename_Directory_Window (void);
-void Destroy_Rename_Directory_Window (void);
-void Rename_Directory (void);
-gboolean Rename_Directory_Window_Key_Press (GtkWidget *window, GdkEvent *event);
-void Rename_Directory_With_Mask_Toggled (void);
+static void Destroy_Rename_Directory_Window (void);
+static void Rename_Directory (void);
+static gboolean Rename_Directory_Window_Key_Press (GtkWidget *window,
+ GdkEvent *event);
+static void Rename_Directory_With_Mask_Toggled (void);
/* For window to run a program with the directory */
void Browser_Open_Run_Program_Tree_Window (void);
-void Destroy_Run_Program_Tree_Window (void);
-gboolean Run_Program_Tree_Window_Key_Press (GtkWidget *window, GdkEvent *event);
-void Run_Program_With_Directory (GtkWidget *combobox);
+static void Destroy_Run_Program_Tree_Window (void);
+static gboolean Run_Program_Tree_Window_Key_Press (GtkWidget *window,
+ GdkEvent *event);
+static void Run_Program_With_Directory (GtkWidget *combobox);
/* For window to run a program with the file */
void Browser_Open_Run_Program_List_Window (void);
-void Destroy_Run_Program_List_Window (void);
-gboolean Run_Program_List_Window_Key_Press (GtkWidget *window, GdkEvent *event);
-void Run_Program_With_Selected_Files (GtkWidget *combobox);
+static void Destroy_Run_Program_List_Window (void);
+static gboolean Run_Program_List_Window_Key_Press (GtkWidget *window,
+ GdkEvent *event);
+static void Run_Program_With_Selected_Files (GtkWidget *combobox);
-gboolean Run_Program (gchar *program_name, GList *args_list);
+static gboolean Run_Program (const gchar *program_name, GList *args_list);
@@ -281,7 +303,8 @@ void Browser_Load_Default_Directory (void)
* Warning: return NULL if no row selected int the tree.
* Remember to free the value returned from this function!
*/
-gchar *Browser_Tree_Get_Path_Of_Selected_Node (void)
+static gchar *
+Browser_Tree_Get_Path_Of_Selected_Node (void)
{
GtkTreeSelection *selection;
GtkTreeIter selectedIter;
@@ -306,7 +329,8 @@ gchar *Browser_Tree_Get_Path_Of_Selected_Node (void)
/*
* Set the 'path' within the variable BrowserCurrentPath.
*/
-void Browser_Update_Current_Path (const gchar *path)
+static void
+Browser_Update_Current_Path (const gchar *path)
{
/* Be sure that we aren't passing 'BrowserCurrentPath' as parameter of the function :
* to avoid some memory problems */
@@ -367,7 +391,8 @@ void Set_Current_Path_As_Default (void)
/*
* When you press the key 'enter' in the BrowserEntry to validate the text (browse the directory)
*/
-void Browser_Entry_Activated (void)
+static void
+Browser_Entry_Activated (void)
{
const gchar *path_utf8;
gchar *path;
@@ -395,7 +420,8 @@ void Browser_Entry_Set_Text (gchar *text)
/*
* Button to go to parent directory
*/
-void Browser_Parent_Button_Clicked (void)
+static void
+Browser_Parent_Button_Clicked (void)
{
gchar *parent_dir, *path;
@@ -423,7 +449,8 @@ void Browser_Label_Set_Text (gchar *text)
/*
* Key Press events into browser tree
*/
-gboolean Browser_Tree_Key_Press (GtkWidget *tree, GdkEvent *event, gpointer data)
+static gboolean
+Browser_Tree_Key_Press (GtkWidget *tree, GdkEvent *event, gpointer data)
{
GdkEventKey *kevent;
GtkTreeIter SelectedNode;
@@ -610,7 +637,8 @@ gboolean Browser_List_Key_Press (GtkWidget *list, GdkEvent *event, gpointer data
/*
* Action for double/triple click
*/
-gboolean Browser_List_Button_Press (GtkTreeView *treeView, GdkEventButton *event)
+static gboolean
+Browser_List_Button_Press (GtkTreeView *treeView, GdkEventButton *event)
{
if (!event)
return FALSE;
@@ -681,7 +709,8 @@ void Browser_Tree_Collapse (void)
/*
* Set a row (or node) visible in the TreeView (by scrolling the tree)
*/
-void Browser_Tree_Set_Node_Visible (GtkWidget *directoryView, GtkTreePath *path)
+static void
+Browser_Tree_Set_Node_Visible (GtkWidget *directoryView, GtkTreePath *path)
{
if (!directoryView || !path) return;
@@ -712,7 +741,8 @@ void Browser_List_Set_Row_Visible (GtkTreeModel *treeModel, GtkTreeIter *rowIter
* Triggers when a new node in the browser tree is selected
* Do file-save confirmation, and then prompt the new dir to be loaded
*/
-gboolean Browser_Tree_Node_Selected (GtkTreeSelection *selection, gpointer user_data)
+static gboolean
+Browser_Tree_Node_Selected (GtkTreeSelection *selection, gpointer user_data)
{
gchar *pathName, *pathName_utf8;
static int counter = 0;
@@ -826,7 +856,8 @@ gboolean Browser_Tree_Node_Selected (GtkTreeSelection *selection, gpointer user_
}
-gint Browser_Win32_Get_Drive_Root (gchar *drive, GtkTreeIter *rootNode, GtkTreePath **rootPath)
+static gboolean
+Browser_Win32_Get_Drive_Root (gchar *drive, GtkTreeIter *rootNode, GtkTreePath **rootPath)
{
gint root_index;
gboolean found = FALSE;
@@ -969,7 +1000,8 @@ gboolean Browser_Tree_Select_Dir (const gchar *current_path)
* Callback to select-row event
* Displays the file info of the lowest selected file in the right-hand pane
*/
-void Browser_List_Row_Selected (GtkTreeSelection *selection, gpointer data)
+static void
+Browser_List_Row_Selected (GtkTreeSelection *selection, gpointer data)
{
GList *selectedRows;
GtkTreePath *lastSelected;
@@ -1385,7 +1417,8 @@ void Browser_List_Refresh_File_In_List (ET_File *ETFile)
* - change background according LIST_FILE_OTHERDIR
* - change foreground according file status (saved or not)
*/
-void Browser_List_Set_Row_Appearance (GtkTreeIter *iter)
+static void
+Browser_List_Set_Row_Appearance (GtkTreeIter *iter)
{
ET_File *rowETFile = NULL;
gboolean otherdir = FALSE;
@@ -1601,7 +1634,8 @@ GtkTreePath *Browser_List_Select_File_By_Etfile2 (ET_File *searchETFile, gboolea
/*
* Select the specified file in the list, by an iter
*/
-void Browser_List_Select_File_By_Iter (GtkTreeIter *rowIter, gboolean select_it)
+static void
+Browser_List_Select_File_By_Iter (GtkTreeIter *rowIter, gboolean select_it)
{
if (!BrowserList) return;
@@ -1701,75 +1735,6 @@ ET_File *Browser_List_Select_File_By_DLM (const gchar* string, gboolean select_i
/*
- * Unselect the specified file in the list, by its ETFile
- */
-void Browser_List_Unselect_File_By_Etfile(ET_File *searchETFile)
-{
- gint row;
- GtkTreePath *currentPath = NULL;
- GtkTreeIter currentIter;
- ET_File *currentETFile;
- gboolean valid;
-
- if (searchETFile == NULL)
- return;
-
- // Go through the file list until it is found
- for (row=0; row < gtk_tree_model_iter_n_children(GTK_TREE_MODEL(fileListModel), NULL); row++)
- {
- if (row == 0)
- currentPath = gtk_tree_path_new_first();
- else
- gtk_tree_path_next(currentPath);
-
- valid = gtk_tree_model_get_iter(GTK_TREE_MODEL(fileListModel), ¤tIter, currentPath);
- if (valid)
- {
- gtk_tree_model_get(GTK_TREE_MODEL(fileListModel), ¤tIter,
- LIST_FILE_POINTER, ¤tETFile, -1);
-
- if (currentETFile == searchETFile)
- {
- Browser_List_Unselect_File_By_Iter(¤tIter);
- break;
- }
- }
- }
-}
-
-
-/*
- * Unselect the specified file, by its iter.
- */
-void Browser_List_Unselect_File_By_Iter (GtkTreeIter *rowIter)
-{
- GtkTreeSelection *selection;
-
- if (!BrowserList) return;
-
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(BrowserList));
- if (selection)
- {
- g_signal_handlers_block_by_func(G_OBJECT(selection),G_CALLBACK(Browser_List_Row_Selected),NULL);
- gtk_tree_selection_unselect_iter(selection, rowIter);
- g_signal_handlers_unblock_by_func(G_OBJECT(selection),G_CALLBACK(Browser_List_Row_Selected),NULL);
- }
-}
-
-
-/*
- * Unselect the specified file in the list, by a string representation of an iter
- * e.g. output of gtk_tree_model_get_string_from_iter()
- */
-void Browser_List_Unselect_File_By_Iter_String(const gchar* stringIter)
-{
- GtkTreeIter iter;
-
- if (gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(fileListModel), &iter, stringIter))
- Browser_List_Unselect_File_By_Iter(&iter);
-}
-
-/*
* Clear all entries on the file list
*/
void Browser_List_Clear()
@@ -1792,7 +1757,9 @@ void Browser_List_Refresh_Sort (void)
* Intelligently sort the file list based on the current sorting method
* see also 'ET_Sort_File_List'
*/
-gint Browser_List_Sort_Func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data)
+static gint
+Browser_List_Sort_Func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b,
+ gpointer data)
{
ET_File *ETFile1;
ET_File *ETFile2;
@@ -2093,7 +2060,8 @@ void Browser_Artist_List_Load_Files (ET_File *etfile_to_select)
/*
* Callback to select-row event
*/
-void Browser_Artist_List_Row_Selected(GtkTreeSelection* selection, gpointer data)
+static void
+Browser_Artist_List_Row_Selected (GtkTreeSelection* selection, gpointer data)
{
GList *AlbumList;
GtkTreeIter iter;
@@ -2113,7 +2081,8 @@ void Browser_Artist_List_Row_Selected(GtkTreeSelection* selection, gpointer data
/*
* Set the color of the row of BrowserArtistList
*/
-void Browser_Artist_List_Set_Row_Appearance (GtkTreeIter *iter)
+static void
+Browser_Artist_List_Set_Row_Appearance (GtkTreeIter *iter)
{
GList *AlbumList;
GList *etfilelist;
@@ -2165,7 +2134,8 @@ void Browser_Artist_List_Set_Row_Appearance (GtkTreeIter *iter)
/*
* Load the list of Albums for each Artist
*/
-void Browser_Album_List_Load_Files (GList *albumlist, ET_File *etfile_to_select)
+static void
+Browser_Album_List_Load_Files (GList *albumlist, ET_File *etfile_to_select)
{
GList *AlbumList;
GList *etfilelist = NULL;
@@ -2265,7 +2235,8 @@ void Browser_Album_List_Load_Files (GList *albumlist, ET_File *etfile_to_select)
/*
* Callback to select-row event
*/
-void Browser_Album_List_Row_Selected (GtkTreeSelection *selection, gpointer data)
+static void
+Browser_Album_List_Row_Selected (GtkTreeSelection *selection, gpointer data)
{
GList *etfilelist;
GtkTreeIter iter;
@@ -2294,7 +2265,8 @@ void Browser_Album_List_Row_Selected (GtkTreeSelection *selection, gpointer data
/*
* Set the color of the row of BrowserAlbumList
*/
-void Browser_Album_List_Set_Row_Appearance (GtkTreeIter *iter)
+static void
+Browser_Album_List_Set_Row_Appearance (GtkTreeIter *iter)
{
GList *etfilelist;
gboolean not_all_saved = FALSE;
@@ -2401,7 +2373,8 @@ void Browser_Area_Set_Sensitive (gboolean activate)
/*
* Browser_Popup_Menu_Handler : displays the corresponding menu
*/
-gboolean Browser_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
+static gboolean
+Browser_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
{
if (event && (event->type==GDK_BUTTON_PRESS) && (event->button == 3))
{
@@ -2414,7 +2387,8 @@ gboolean Browser_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
/*
* Destroy the whole tree up to the root node
*/
-void Browser_Tree_Initialize (void)
+static void
+Browser_Tree_Initialize (void)
{
GtkTreeIter parent_iter;
GtkTreeIter dummy_iter;
@@ -2572,7 +2546,8 @@ void Browser_Tree_Rebuild (gchar *path_to_load)
* new_path:
* Parameters are non-utf8!
*/
-void Browser_Tree_Rename_Directory (gchar *last_path, gchar *new_path)
+static void
+Browser_Tree_Rename_Directory (const gchar *last_path, const gchar *new_path)
{
gchar **textsplit;
@@ -2643,7 +2618,9 @@ void Browser_Tree_Rename_Directory (gchar *last_path, gchar *new_path)
/*
* Recursive function to update paths of all child nodes
*/
-void Browser_Tree_Handle_Rename (GtkTreeIter *parentnode, gchar *old_path, gchar *new_path)
+static void
+Browser_Tree_Handle_Rename (GtkTreeIter *parentnode, const gchar *old_path,
+ const gchar *new_path)
{
GtkTreeIter iter;
gchar *path;
@@ -2682,6 +2659,7 @@ void Browser_Tree_Handle_Rename (GtkTreeIter *parentnode, gchar *old_path, gchar
* Find the child node of "parentnode" that has text of "childtext
* Returns NULL on failure
*/
+static
GtkTreePath *Find_Child_Node (GtkTreeIter *parentnode, gchar *childtext)
{
gint row;
@@ -2774,7 +2752,8 @@ static gboolean check_for_subdir (gchar *path)
* Check if you have permissions for directory path (autorized?, readonly? unreadable?).
* Returns the right pixmap.
*/
-GdkPixbuf *Pixmap_From_Directory_Permission (gchar *path)
+static GdkPixbuf *
+Pixmap_From_Directory_Permission (const gchar *path)
{
DIR *dir;
@@ -3828,7 +3807,8 @@ void Browser_Open_Rename_Directory_Window (void)
g_free(directory_name_utf8);
}
-void Destroy_Rename_Directory_Window (void)
+static void
+Destroy_Rename_Directory_Window (void)
{
if (RenameDirectoryWindow)
{
@@ -3853,7 +3833,8 @@ void Destroy_Rename_Directory_Window (void)
}
}
-void Rename_Directory (void)
+static void
+Rename_Directory (void)
{
DIR *dir;
gchar *directory_parent;
@@ -4102,7 +4083,8 @@ void Rename_Directory (void)
Statusbar_Message(_("Directory renamed"),TRUE);
}
-gboolean Rename_Directory_Window_Key_Press (GtkWidget *window, GdkEvent *event)
+static gboolean
+Rename_Directory_Window_Key_Press (GtkWidget *window, GdkEvent *event)
{
GdkEventKey *kevent;
@@ -4120,7 +4102,8 @@ gboolean Rename_Directory_Window_Key_Press (GtkWidget *window, GdkEvent *event)
return FALSE;
}
-void Rename_Directory_With_Mask_Toggled (void)
+static void
+Rename_Directory_With_Mask_Toggled (void)
{
gtk_widget_set_sensitive(GTK_WIDGET(RenameDirectoryCombo), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(RenameDirectoryWithMask)));
gtk_widget_set_sensitive(GTK_WIDGET(RenameDirectoryMaskCombo), gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(RenameDirectoryWithMask)));
@@ -4232,7 +4215,8 @@ void Browser_Open_Run_Program_Tree_Window (void)
gtk_widget_show_all(RunProgramTreeWindow);
}
-void Destroy_Run_Program_Tree_Window (void)
+static void
+Destroy_Run_Program_Tree_Window (void)
{
if (RunProgramTreeWindow)
{
@@ -4241,7 +4225,8 @@ void Destroy_Run_Program_Tree_Window (void)
}
}
-gboolean Run_Program_Tree_Window_Key_Press (GtkWidget *window, GdkEvent *event)
+static gboolean
+Run_Program_Tree_Window_Key_Press (GtkWidget *window, GdkEvent *event)
{
GdkEventKey *kevent;
@@ -4390,7 +4375,8 @@ void Browser_Open_Run_Program_List_Window (void)
gtk_widget_show_all(RunProgramListWindow);
}
-void Destroy_Run_Program_List_Window (void)
+static void
+Destroy_Run_Program_List_Window (void)
{
if (RunProgramListWindow)
{
@@ -4399,7 +4385,8 @@ void Destroy_Run_Program_List_Window (void)
}
}
-gboolean Run_Program_List_Window_Key_Press(GtkWidget *window, GdkEvent *event)
+static gboolean
+Run_Program_List_Window_Key_Press (GtkWidget *window, GdkEvent *event)
{
GdkEventKey *kevent;
@@ -4416,7 +4403,8 @@ gboolean Run_Program_List_Window_Key_Press(GtkWidget *window, GdkEvent *event)
return FALSE;
}
-void Run_Program_With_Selected_Files (GtkWidget *combobox)
+static void
+Run_Program_With_Selected_Files (GtkWidget *combobox)
{
gchar *program_name;
ET_File *ETFile;
@@ -4476,7 +4464,8 @@ void Run_Program_With_Selected_Files (GtkWidget *combobox)
* Run a program with a list of parameters
* - args_list : list of filename (with path)
*/
-gboolean Run_Program (gchar *program_name, GList *args_list)
+static gboolean
+Run_Program (const gchar *program_name, GList *args_list)
{
#ifdef WIN32
GList *filelist;
diff --git a/src/browser.h b/src/browser.h
index 7be49a8..3b33f47 100644
--- a/src/browser.h
+++ b/src/browser.h
@@ -154,13 +154,8 @@ void Browser_List_Refresh_File_In_List (ET_File *ETFile);
void Browser_List_Clear (void);
void Browser_List_Select_File_By_Etfile (ET_File *ETFile, gboolean select_it);
GtkTreePath *Browser_List_Select_File_By_Etfile2 (ET_File *searchETFile, gboolean select_it, GtkTreePath *startPath);
-void Browser_List_Select_File_By_Iter (GtkTreeIter *iter, gboolean select_it);
ET_File *Browser_List_Select_File_By_Iter_String(const gchar* stringiter, gboolean select_it);
ET_File *Browser_List_Select_File_By_DLM (const gchar* string, gboolean select_it);
-void Browser_List_Unselect_File_By_Etfile (ET_File *ETFile);
-void Browser_List_Unselect_File_By_Iter (GtkTreeIter *iter);
-void Browser_List_Unselect_File_By_Iter_String(const gchar* stringiter);
-void Browser_List_Set_Row_Appearance (GtkTreeIter *iter);
void Browser_List_Refresh_Sort (void);
void Browser_List_Select_All_Files (void);
void Browser_List_Unselect_All_Files (void);
@@ -169,8 +164,6 @@ void Browser_List_Remove_File (ET_File *ETFile);
ET_File *Browser_List_Get_ETFile_From_Path (GtkTreePath *path);
ET_File *Browser_List_Get_ETFile_From_Iter (GtkTreeIter *iter);
-void Browser_Artist_List_Load_Files (ET_File *etfile_to_select);
-
void Browser_Entry_Set_Text (gchar *text);
void Browser_Label_Set_Text (gchar *text);
@@ -186,7 +179,6 @@ void Browser_Load_Music_Directory (void);
void Browser_Load_Default_Directory (void);
void Browser_Reload_Directory (void);
-gchar *Browser_Tree_Get_Path_Of_Selected_Node (void);
void Set_Current_Path_As_Default (void);
gchar *Browser_Get_Current_Path (void);
diff --git a/src/cddb.c b/src/cddb.c
index 3fe3d2f..cdc8766 100644
--- a/src/cddb.c
+++ b/src/cddb.c
@@ -142,63 +142,66 @@ gboolean CddbStopSearch = FALSE;
/**************
* Prototypes *
**************/
-gboolean Cddb_Destroy_Window (GtkWidget *widget, GdkEvent *event, gpointer data);
-gboolean Cddb_Window_Key_Press (GtkWidget *window, GdkEvent *event);
-void Cddb_Show_Album_Info (GtkTreeSelection *selection, gpointer data);
-
-gboolean Cddb_Free_Album_List (void);
-gboolean Cddb_Free_Track_Album_List (GList *track_list);
-
-gint Cddb_Open_Connection (const gchar *host, gint port);
-void Cddb_Close_Connection (gint socket_id);
-gint Cddb_Read_Line (FILE **file, gchar **cddb_out);
-gint Cddb_Read_Http_Header (FILE **file, gchar **cddb_out);
-gint Cddb_Read_Cddb_Header (FILE **file, gchar **cddb_out);
-
-gint Cddb_Write_Result_To_File (gint socket_id, gulong *bytes_read_total);
-
-gboolean Cddb_Search_Album_List_From_String (void);
-gboolean Cddb_Search_Album_List_From_String_Freedb (void);
-gboolean Cddb_Search_Album_List_From_String_Gnudb (void);
-gboolean Cddb_Search_Album_From_Selected_Files (void);
-gboolean Cddb_Get_Album_Tracks_List_CB (GtkTreeSelection *selection, gpointer data);
-gboolean Cddb_Get_Album_Tracks_List (GtkTreeSelection *selection);
-
-void Cddb_Load_Album_List (gboolean only_red_lines);
-void Cddb_Load_Track_Album_List (GList *track_list);
-gboolean Cddb_Set_Track_Infos_To_File_List (void);
-void Cddb_Album_List_Set_Row_Appearance (GtkTreeIter *row);
-GdkPixbuf *Cddb_Get_Pixbuf_From_Server_Name (const gchar *server_name);
-
-void Cddb_Search_In_All_Fields_Check_Button_Toggled (void);
-void Cddb_Search_In_All_Categories_Check_Button_Toggled (void);
-void Cddb_Set_To_All_Fields_Check_Button_Toggled (void);
-void Cddb_Stop_Search (void);
-void Cddb_Notebook_Switch_Page (GtkNotebook *notebook, gpointer page, guint page_num, gpointer user_data);
-void Cddb_Search_String_In_Result (GtkWidget *entry, GtkButton *button);
-void Cddb_Display_Red_Lines_In_Result (void);
-
-void Cddb_Set_Apply_Button_Sensivity (void);
-void Cddb_Set_Search_Button_Sensivity (void);
-void Cddb_Use_Dlm_2_Check_Button_Toggled (void);
-void Cddb_Show_Categories_Button_Toggled (void);
-gchar *Cddb_Generate_Request_String_With_Fields_And_Categories_Options (void);
-gchar *Cddb_Get_Id3_Genre_From_Cddb_Genre (gchar *cddb_genre);
-
-GtkWidget *Create_Cddb_Track_List_Popup_Menu (GtkWidget *listView);
-void Cddb_Track_List_Row_Selected (GtkTreeSelection *selection, gpointer data);
-gboolean Cddb_Track_List_Button_Press (GtkTreeView *treeView, GdkEventButton *event);
-
-void Cddb_Track_List_Select_All (void);
-void Cddb_Track_List_Unselect_All (void);
-void Cddb_Track_List_Invert_Selection (void);
-
-gint Cddb_Track_List_Sort_Func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data);
-void Cddb_Track_List_Sort_By_Ascending_Track_Number (void);
-void Cddb_Track_List_Sort_By_Ascending_Track_Name (void);
-
-//char *base64_encode (char *str);
-gchar *Cddb_Format_Proxy_Authentification (void);
+static gboolean Cddb_Destroy_Window (GtkWidget *widget, GdkEvent *event,
+ gpointer data);
+static gboolean Cddb_Window_Key_Press (GtkWidget *window, GdkEvent *event);
+static void Cddb_Show_Album_Info (GtkTreeSelection *selection, gpointer data);
+
+static gboolean Cddb_Free_Album_List (void);
+static gboolean Cddb_Free_Track_Album_List (GList *track_list);
+
+static gint Cddb_Open_Connection (const gchar *host, gint port);
+static void Cddb_Close_Connection (gint socket_id);
+static gint Cddb_Read_Line (FILE **file, gchar **cddb_out);
+static gint Cddb_Read_Http_Header (FILE **file, gchar **cddb_out);
+static gint Cddb_Read_Cddb_Header (FILE **file, gchar **cddb_out);
+
+static gint Cddb_Write_Result_To_File (gint socket_id,
+ gulong *bytes_read_total);
+
+static gboolean Cddb_Search_Album_List_From_String (void);
+static gboolean Cddb_Search_Album_List_From_String_Freedb (void);
+static gboolean Cddb_Search_Album_List_From_String_Gnudb (void);
+static gboolean Cddb_Search_Album_From_Selected_Files (void);
+static gboolean Cddb_Get_Album_Tracks_List_CB (GtkTreeSelection *selection,
+ gpointer data);
+static gboolean Cddb_Get_Album_Tracks_List (GtkTreeSelection *selection);
+
+static void Cddb_Load_Album_List (gboolean only_red_lines);
+static void Cddb_Load_Track_Album_List (GList *track_list);
+static gboolean Cddb_Set_Track_Infos_To_File_List (void);
+static void Cddb_Album_List_Set_Row_Appearance (GtkTreeIter *row);
+static GdkPixbuf *Cddb_Get_Pixbuf_From_Server_Name (const gchar *server_name);
+
+static void Cddb_Search_In_All_Fields_Check_Button_Toggled (void);
+static void Cddb_Search_In_All_Categories_Check_Button_Toggled (void);
+static void Cddb_Set_To_All_Fields_Check_Button_Toggled (void);
+static void Cddb_Stop_Search (void);
+static void Cddb_Notebook_Switch_Page (GtkNotebook *notebook, gpointer page,
+ guint page_num, gpointer user_data);
+static void Cddb_Search_String_In_Result (GtkWidget *entry, GtkButton *button);
+static void Cddb_Display_Red_Lines_In_Result (void);
+
+static void Cddb_Set_Apply_Button_Sensitivity (void);
+static void Cddb_Set_Search_Button_Sensitivity (void);
+static void Cddb_Use_Dlm_2_Check_Button_Toggled (void);
+static void Cddb_Show_Categories_Button_Toggled (void);
+static gchar *Cddb_Generate_Request_String_With_Fields_And_Categories_Options (void);
+static const gchar *Cddb_Get_Id3_Genre_From_Cddb_Genre (const gchar *cddb_genre);
+
+static void Cddb_Track_List_Row_Selected (GtkTreeSelection *selection,
+ gpointer data);
+static gboolean Cddb_Track_List_Button_Press (GtkTreeView *treeView,
+ GdkEventButton *event);
+
+static void Cddb_Track_List_Select_All (void);
+static void Cddb_Track_List_Unselect_All (void);
+static void Cddb_Track_List_Invert_Selection (void);
+
+static gint Cddb_Track_List_Sort_Func (GtkTreeModel *model, GtkTreeIter *a,
+ GtkTreeIter *b, gpointer data);
+
+static gchar *Cddb_Format_Proxy_Authentification (void);
@@ -403,7 +406,7 @@ void Open_Cddb_Window (void)
g_signal_connect(G_OBJECT(CddbSearchButton),"clicked",
G_CALLBACK(Cddb_Search_Album_List_From_String),NULL);
g_signal_connect(G_OBJECT(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(CddbSearchStringCombo)))),"changed",
- G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
+ G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
// Button to stop the search
CddbStopSearchButton = Create_Button_With_Icon_And_Label(GTK_STOCK_STOP,NULL);
@@ -459,11 +462,11 @@ void Open_Cddb_Window (void)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbSearchInTrackNameField), CDDB_SEARCH_IN_TRACK_NAME_FIELD);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbSearchInOtherField), CDDB_SEARCH_IN_OTHER_FIELD);
g_signal_connect(G_OBJECT(CddbSearchInAllFields), "toggled", G_CALLBACK(Cddb_Search_In_All_Fields_Check_Button_Toggled),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInAllFields), "toggled", G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInArtistField), "toggled", G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInTitleField), "toggled", G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInTrackNameField), "toggled", G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInOtherField), "toggled", G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInAllFields), "toggled", G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInArtistField), "toggled", G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInTitleField), "toggled", G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInTrackNameField), "toggled", G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInOtherField), "toggled", G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
CddbSeparatorH = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
gtk_table_attach(GTK_TABLE(Table),CddbSeparatorH,0,7,1,2,GTK_FILL,GTK_FILL,0,0);
@@ -527,17 +530,17 @@ void Open_Cddb_Window (void)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbSearchInRockCategory), CDDB_SEARCH_IN_ROCK_CATEGORY);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbSearchInSoundtrackCategory),CDDB_SEARCH_IN_SOUNDTRACK_CATEGORY);
g_signal_connect(G_OBJECT(CddbSearchInAllCategories), "toggled",G_CALLBACK(Cddb_Search_In_All_Categories_Check_Button_Toggled),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInAllCategories), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInBluesCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInClassicalCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInCountryCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInFolkCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInJazzCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInMiscCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInNewageCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInReggaeCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInRockCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSearchInSoundtrackCategory),"toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInAllCategories), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInBluesCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInClassicalCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInCountryCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInFolkCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInJazzCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInMiscCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInNewageCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInReggaeCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInRockCategory), "toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSearchInSoundtrackCategory),"toggled",G_CALLBACK(Cddb_Set_Search_Button_Sensitivity),NULL);
gtk_widget_set_tooltip_text(CddbSearchInRockCategory,_("included: funk, soul, rap, pop, industrial, metal, etc."));
gtk_widget_set_tooltip_text(CddbSearchInSoundtrackCategory,_("movies, shows"));
gtk_widget_set_tooltip_text(CddbSearchInMiscCategory,_("others that do not fit in the above categories"));
@@ -778,15 +781,15 @@ void Open_Cddb_Window (void)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbSetToGenre), CDDB_SET_TO_GENRE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CddbSetToFileName), CDDB_SET_TO_FILE_NAME);
g_signal_connect(G_OBJECT(CddbSetToAllFields), "toggled",G_CALLBACK(Cddb_Set_To_All_Fields_Check_Button_Toggled),NULL);
- g_signal_connect(G_OBJECT(CddbSetToAllFields), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSetToTitle), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSetToArtist), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSetToAlbum), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSetToYear), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSetToTrack), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSetToTrackTotal),"toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSetToGenre), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensivity),NULL);
- g_signal_connect(G_OBJECT(CddbSetToFileName), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSetToAllFields), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSetToTitle), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSetToArtist), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSetToAlbum), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSetToYear), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSetToTrack), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSetToTrackTotal),"toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSetToGenre), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensitivity),NULL);
+ g_signal_connect(G_OBJECT(CddbSetToFileName), "toggled",G_CALLBACK(Cddb_Set_Apply_Button_Sensitivity),NULL);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,0);
@@ -851,7 +854,8 @@ void Open_Cddb_Window (void)
gtk_notebook_set_current_page(GTK_NOTEBOOK(CddbNoteBook),0);
}
-gboolean Cddb_Destroy_Window (GtkWidget *widget, GdkEvent *event, gpointer data)
+static gboolean
+Cddb_Destroy_Window (GtkWidget *widget, GdkEvent *event, gpointer data)
{
CddbStopSearch = TRUE;
@@ -945,7 +949,8 @@ void Cddb_Window_Apply_Changes (void)
}
-gboolean Cddb_Window_Key_Press (GtkWidget *window, GdkEvent *event)
+static gboolean
+Cddb_Window_Key_Press (GtkWidget *window, GdkEvent *event)
{
GdkEventKey *kevent;
@@ -963,7 +968,8 @@ gboolean Cddb_Window_Key_Press (GtkWidget *window, GdkEvent *event)
}
-void Cddb_Search_In_All_Fields_Check_Button_Toggled (void)
+static void
+Cddb_Search_In_All_Fields_Check_Button_Toggled (void)
{
if (CddbSearchInAllFields)
{
@@ -973,7 +979,9 @@ void Cddb_Search_In_All_Fields_Check_Button_Toggled (void)
gtk_widget_set_sensitive(CddbSearchInOtherField, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbSearchInAllFields)));
}
}
-void Cddb_Show_Categories_Button_Toggled (void)
+
+static void
+Cddb_Show_Categories_Button_Toggled (void)
{
if (CddbShowCategoriesButton)
{
@@ -1012,7 +1020,9 @@ void Cddb_Show_Categories_Button_Toggled (void)
gtk_widget_queue_resize(CddbWindow);
}
}
-void Cddb_Search_In_All_Categories_Check_Button_Toggled (void)
+
+static void
+Cddb_Search_In_All_Categories_Check_Button_Toggled (void)
{
if (CddbSearchInAllCategories)
{
@@ -1028,7 +1038,9 @@ void Cddb_Search_In_All_Categories_Check_Button_Toggled (void)
gtk_widget_set_sensitive(CddbSearchInSoundtrackCategory,!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CddbSearchInAllCategories)));
}
}
-void Cddb_Set_To_All_Fields_Check_Button_Toggled (void)
+
+static void
+Cddb_Set_To_All_Fields_Check_Button_Toggled (void)
{
if (CddbSetToAllFields)
{
@@ -1043,7 +1055,8 @@ void Cddb_Set_To_All_Fields_Check_Button_Toggled (void)
}
}
-void Cddb_Set_Apply_Button_Sensivity (void)
+static void
+Cddb_Set_Apply_Button_Sensitivity (void)
{
gboolean cddbsettoallfields, cddbsettotitle, cddbsettoartist, cddbsettoalbum,
cddbsettoyear, cddbsettotrack, cddbsettotracktotal, cddbsettogenre, cddbsettofilename;
@@ -1069,7 +1082,8 @@ void Cddb_Set_Apply_Button_Sensivity (void)
}
}
-void Cddb_Use_Dlm_2_Check_Button_Toggled (void)
+static void
+Cddb_Use_Dlm_2_Check_Button_Toggled (void)
{
if (CddbUseDLM2)
{
@@ -1077,7 +1091,8 @@ void Cddb_Use_Dlm_2_Check_Button_Toggled (void)
}
}
-void Cddb_Set_Search_Button_Sensivity (void)
+static void
+Cddb_Set_Search_Button_Sensitivity (void)
{
gboolean cddbinallfields, cddbinartistfield, cddbintitlefield, cddbintracknamefield, cddbinotherfield;
gboolean cddbinallcategories, cddbinbluescategory, cddbinclassicalcategory, cddbincountrycategory,
@@ -1116,12 +1131,15 @@ void Cddb_Set_Search_Button_Sensivity (void)
}
}
-void Cddb_Stop_Search (void)
+static void
+Cddb_Stop_Search (void)
{
CddbStopSearch = TRUE;
}
-void Cddb_Notebook_Switch_Page (GtkNotebook *notebook, gpointer page, guint page_num, gpointer user_data)
+static void
+Cddb_Notebook_Switch_Page (GtkNotebook *notebook, gpointer page,
+ guint page_num, gpointer user_data)
{
gint page_total;
guint page_tmp;
@@ -1156,7 +1174,8 @@ void Cddb_Notebook_Switch_Page (GtkNotebook *notebook, gpointer page, guint page
* Searches the Cddb Album List for specific terms
* (this is not search the remote CDDB database...)
*/
-void Cddb_Search_String_In_Result (GtkWidget *entry, GtkButton *button)
+static void
+Cddb_Search_String_In_Result (GtkWidget *entry, GtkButton *button)
{
gchar *string;
gchar buffer[256];
@@ -1332,7 +1351,8 @@ void Cddb_Search_String_In_Result (GtkWidget *entry, GtkButton *button)
/*
* Show collected infos of the album in the status bar
*/
-void Cddb_Show_Album_Info (GtkTreeSelection *selection, gpointer data)
+static void
+Cddb_Show_Album_Info (GtkTreeSelection *selection, gpointer data)
{
CddbAlbum *cddbalbum = NULL;
gchar *msg, *duration_str;
@@ -1370,7 +1390,8 @@ void Cddb_Show_Album_Info (GtkTreeSelection *selection, gpointer data)
/*
* Select the corresponding file into the main file list
*/
-void Cddb_Track_List_Row_Selected (GtkTreeSelection *selection, gpointer data)
+static void
+Cddb_Track_List_Row_Selected (GtkTreeSelection *selection, gpointer data)
{
GList *selectedRows;
GtkTreeIter currentFile;
@@ -1426,7 +1447,8 @@ void Cddb_Track_List_Row_Selected (GtkTreeSelection *selection, gpointer data)
/*
* Unselect all rows in the track list
*/
-void Cddb_Track_List_Unselect_All ()
+static void
+Cddb_Track_List_Unselect_All ()
{
GtkTreeSelection *selection;
@@ -1442,7 +1464,8 @@ void Cddb_Track_List_Unselect_All ()
/*
* Select all rows in the track list
*/
-void Cddb_Track_List_Select_All ()
+static void
+Cddb_Track_List_Select_All ()
{
GtkTreeSelection *selection;
@@ -1458,7 +1481,8 @@ void Cddb_Track_List_Select_All ()
/*
* Invert the selection of every row in the track list
*/
-void Cddb_Track_List_Invert_Selection ()
+static void
+Cddb_Track_List_Invert_Selection ()
{
GtkTreeSelection *selection;
GtkTreeIter iter;
@@ -1490,7 +1514,8 @@ void Cddb_Track_List_Invert_Selection ()
}
}
-gboolean Cddb_Track_List_Button_Press (GtkTreeView *treeView, GdkEventButton *event)
+static gboolean
+Cddb_Track_List_Button_Press (GtkTreeView *treeView, GdkEventButton *event)
{
if (!event)
return FALSE;
@@ -1505,64 +1530,6 @@ gboolean Cddb_Track_List_Button_Press (GtkTreeView *treeView, GdkEventButton *ev
/*
- * Cddb_Popup_Menu_Handler : displays the corresponding menu
- * Create_Browser_Tree_Popup_Menu: Create a popup menu for the tree browser
- * Create_Browser_List_Popup_Menu: Create a popup menu for the list of files of browser
- */
-static gboolean
-Cddb_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
-{
- if (event && (event->type==GDK_BUTTON_PRESS) && (event->button==3))
- {
- gtk_menu_popup(menu,NULL,NULL,NULL,NULL,event->button,event->time);
- return TRUE;
- }
- return FALSE;
-}
-
-GtkWidget *Create_Cddb_Track_List_Popup_Menu(GtkWidget *list)
-{
- GtkWidget *CddbPopupMenu;
- GtkWidget *MenuItem;
-
-
- CddbPopupMenu = gtk_menu_new();
- g_signal_connect_swapped(G_OBJECT(list), "button_press_event",
- G_CALLBACK(Cddb_Popup_Menu_Handler), G_OBJECT(CddbPopupMenu));
-
- MenuItem = gtk_menu_item_new_with_label(_("Select all lines"));
- gtk_menu_shell_append(GTK_MENU_SHELL(CddbPopupMenu), MenuItem);
- g_signal_connect(G_OBJECT(MenuItem),"activate",
- G_CALLBACK(Cddb_Track_List_Select_All),NULL);
-
- MenuItem = gtk_menu_item_new_with_label(_("Unselect all lines"));
- gtk_menu_shell_append(GTK_MENU_SHELL(CddbPopupMenu), MenuItem);
- g_signal_connect(G_OBJECT(MenuItem),"activate",
- G_CALLBACK(Cddb_Track_List_Unselect_All),NULL);
-
- MenuItem = gtk_menu_item_new_with_label(_("Invert selection"));
- gtk_menu_shell_append(GTK_MENU_SHELL(CddbPopupMenu), MenuItem);
- g_signal_connect(G_OBJECT(MenuItem),"activate",
- G_CALLBACK(Cddb_Track_List_Invert_Selection),NULL);
-
- MenuItem = gtk_menu_item_new();
- gtk_menu_shell_append(GTK_MENU_SHELL(CddbPopupMenu), MenuItem);
-
- MenuItem = gtk_menu_item_new_with_label(_("Sort by Track Number"));
- gtk_menu_shell_append(GTK_MENU_SHELL(CddbPopupMenu),MenuItem);
- g_signal_connect(G_OBJECT(MenuItem),"activate",
- G_CALLBACK(Cddb_Track_List_Sort_By_Ascending_Track_Number),NULL);
-
- MenuItem = gtk_menu_item_new_with_label(_("Sort by Track Name"));
- gtk_menu_shell_append(GTK_MENU_SHELL(CddbPopupMenu),MenuItem);
- g_signal_connect(G_OBJECT(MenuItem),"activate",
- G_CALLBACK(Cddb_Track_List_Sort_By_Ascending_Track_Name),NULL);
-
- gtk_widget_show_all(CddbPopupMenu);
- return CddbPopupMenu;
-}
-
-/*
* To run an "automatic search" from a popup menu with the sÃlected files
*/
void Cddb_Popup_Menu_Search_Selected_File (void)
@@ -1574,7 +1541,9 @@ void Cddb_Popup_Menu_Search_Selected_File (void)
/*
* Sort the track list
*/
-gint Cddb_Track_List_Sort_Func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data)
+static gint
+Cddb_Track_List_Sort_Func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b,
+ gpointer data)
{
gint sortcol = GPOINTER_TO_INT(data);
gchar *text1, *text1cp;
@@ -1615,20 +1584,6 @@ gint Cddb_Track_List_Sort_Func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter
return ret;
}
-void Cddb_Track_List_Sort_By_Ascending_Track_Number (void)
-{
- // Sort ascending by column '#'
- gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(CddbTrackListModel), SORT_LIST_NUMBER, GTK_SORT_ASCENDING);
-}
-
-void Cddb_Track_List_Sort_By_Ascending_Track_Name (void)
-{
- // Sort ascending by column 'Track Name'
- gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(CddbTrackListModel), SORT_LIST_NAME, GTK_SORT_ASCENDING);
-}
-
-
-
/*
* Open a connection to "server_name" and retun the socket_id
* On error, returns 0.
@@ -1636,7 +1591,8 @@ void Cddb_Track_List_Sort_By_Ascending_Track_Name (void)
* Some help on : http://shoe.bocks.com/net/
* http://www.zone-h.org/files/4/socket.txt
*/
-gint Cddb_Open_Connection (const gchar *host, gint port)
+static gint
+Cddb_Open_Connection (const gchar *host, gint port)
{
gint socket_id = 0;
struct hostent *hostent;
@@ -1714,7 +1670,8 @@ gint Cddb_Open_Connection (const gchar *host, gint port)
/*
* Close the connection correcponding to the socket_id
*/
-void Cddb_Close_Connection (gint socket_id)
+static void
+Cddb_Close_Connection (gint socket_id)
{
#ifndef WIN32
shutdown(socket_id,SHUT_RDWR);
@@ -1744,7 +1701,8 @@ void Cddb_Close_Connection (gint socket_id)
* <html>\n }
* [...] } "Body"
*/
-gint Cddb_Write_Result_To_File (gint socket_id, gulong *bytes_read_total)
+static gint
+Cddb_Write_Result_To_File (gint socket_id, gulong *bytes_read_total)
{
gchar *file_path = NULL;
FILE *file;
@@ -1819,7 +1777,8 @@ gint Cddb_Write_Result_To_File (gint socket_id, gulong *bytes_read_total)
* <html>\n }
* [...] } "Body"
*/
-gint Cddb_Read_Line (FILE **file, gchar **cddb_out)
+static gint
+Cddb_Read_Line (FILE **file, gchar **cddb_out)
{
gchar buffer[MAX_STRING_LEN];
gchar *result;
@@ -1875,7 +1834,8 @@ gint Cddb_Read_Line (FILE **file, gchar **cddb_out)
/*
* Read HTTP header data : from "HTTP/1.1 200 OK" to the blank line
*/
-gint Cddb_Read_Http_Header (FILE **file, gchar **cddb_out)
+static gint
+Cddb_Read_Http_Header (FILE **file, gchar **cddb_out)
{
// The 'file' is opened (if no error) in this function
@@ -1912,7 +1872,8 @@ gint Cddb_Read_Http_Header (FILE **file, gchar **cddb_out)
* Cddb Header is the line like this :
* 210 newage 710ed208 CD database entry follows (until terminating `.')
*/
-gint Cddb_Read_Cddb_Header (FILE **file, gchar **cddb_out)
+static gint
+Cddb_Read_Cddb_Header (FILE **file, gchar **cddb_out)
{
if ( Cddb_Read_Line(file,cddb_out) < 0 )
return -1; // Error!
@@ -1943,7 +1904,8 @@ gint Cddb_Read_Cddb_Header (FILE **file, gchar **cddb_out)
/*
* Free the CddbAlbumList
*/
-gboolean Cddb_Free_Album_List (void)
+static gboolean
+Cddb_Free_Album_List (void)
{
if (!CddbAlbumList) return FALSE;
@@ -1979,7 +1941,8 @@ gboolean Cddb_Free_Album_List (void)
return TRUE;
}
-gboolean Cddb_Free_Track_Album_List (GList *track_list)
+static gboolean
+Cddb_Free_Track_Album_List (GList *track_list)
{
GList *CddbTrackAlbumList;
@@ -2008,7 +1971,8 @@ gboolean Cddb_Free_Track_Album_List (GList *track_list)
/*
* Load the CddbAlbumList into the corresponding List
*/
-void Cddb_Load_Album_List (gboolean only_red_lines)
+static void
+Cddb_Load_Album_List (gboolean only_red_lines)
{
if (CddbWindow && CddbAlbumList && CddbAlbumListView)
{
@@ -2064,7 +2028,8 @@ void Cddb_Load_Album_List (gboolean only_red_lines)
/*
* Load the CddbTrackList into the corresponding List
*/
-void Cddb_Load_Track_Album_List (GList *track_list)
+static void
+Cddb_Load_Track_Album_List (GList *track_list)
{
GtkTreeIter iter;
@@ -2096,7 +2061,7 @@ void Cddb_Load_Track_Album_List (GList *track_list)
tracklist = tracklist->next;
g_free(row_text[0]);
}
- Cddb_Set_Apply_Button_Sensivity();
+ Cddb_Set_Apply_Button_Sensitivity();
}
}
@@ -2104,7 +2069,8 @@ void Cddb_Load_Track_Album_List (GList *track_list)
* Fields : artist, title, track, rest
* CDDB Categories : blues, classical, country, data, folk, jazz, misc, newage, reggae, rock, soundtrack
*/
-gchar *Cddb_Generate_Request_String_With_Fields_And_Categories_Options (void)
+static gchar *
+Cddb_Generate_Request_String_With_Fields_And_Categories_Options (void)
{
gchar string[256];
gboolean cddbinallfields, cddbinartistfield, cddbintitlefield, cddbintracknamefield, cddbinotherfield;
@@ -2173,7 +2139,8 @@ gchar *Cddb_Generate_Request_String_With_Fields_And_Categories_Options (void)
* - freedb.freedb.org
* - gnudb.gnudb.org
*/
-gboolean Cddb_Search_Album_List_From_String (void)
+static gboolean
+Cddb_Search_Album_List_From_String (void)
{
if ( strstr(CDDB_SERVER_NAME_MANUAL_SEARCH,"gnudb") != NULL )
// Use of gnudb
@@ -2189,7 +2156,8 @@ gboolean Cddb_Search_Album_List_From_String (void)
* Send request (using the HTML search page in freedb.org site) to the CD database
* to get the list of albums matching to a string.
*/
-gboolean Cddb_Search_Album_List_From_String_Freedb (void)
+static gboolean
+Cddb_Search_Album_List_From_String_Freedb (void)
{
gint socket_id;
gchar *string = NULL;
@@ -2493,7 +2461,8 @@ gboolean Cddb_Search_Album_List_From_String_Freedb (void)
* Send request (using the HTML search page in freedb.org site) to the CD database
* to get the list of albums matching to a string.
*/
-gboolean Cddb_Search_Album_List_From_String_Gnudb (void)
+static gboolean
+Cddb_Search_Album_List_From_String_Gnudb (void)
{
gint socket_id;
gchar *string = NULL;
@@ -2837,7 +2806,8 @@ gboolean Cddb_Search_Album_List_From_String_Gnudb (void)
* Send cddb query using the CddbId generated from the selected files to get the
* list of albums matching with this cddbid.
*/
-gboolean Cddb_Search_Album_From_Selected_Files (void)
+static gboolean
+Cddb_Search_Album_From_Selected_Files (void)
{
gint socket_id;
gint bytes_written;
@@ -3335,7 +3305,8 @@ gboolean Cddb_Search_Album_From_Selected_Files (void)
* Callback when selecting a row in the Album List.
* We get the list of tracks of the selected album
*/
-gboolean Cddb_Get_Album_Tracks_List_CB (GtkTreeSelection *selection, gpointer data)
+static gboolean
+Cddb_Get_Album_Tracks_List_CB (GtkTreeSelection *selection, gpointer data)
{
gint i;
gint i_max = 5;
@@ -3361,7 +3332,8 @@ gboolean Cddb_Get_Album_Tracks_List_CB (GtkTreeSelection *selection, gpointer da
/*
* Look up a specific album in freedb, and save to a CddbAlbum structure
*/
-gboolean Cddb_Get_Album_Tracks_List (GtkTreeSelection* selection)
+static gboolean
+Cddb_Get_Album_Tracks_List (GtkTreeSelection* selection)
{
gint socket_id = 0;
CddbAlbum *cddbalbum = NULL;
@@ -3382,7 +3354,7 @@ gboolean Cddb_Get_Album_Tracks_List (GtkTreeSelection* selection)
return FALSE;
gtk_list_store_clear(CddbTrackListModel);
- Cddb_Set_Apply_Button_Sensivity();
+ Cddb_Set_Apply_Button_Sensitivity();
if (gtk_tree_selection_get_selected(selection, NULL, &row))
{
gtk_tree_model_get(GTK_TREE_MODEL(CddbAlbumListModel), &row, CDDB_ALBUM_LIST_DATA, &cddbalbum, -1);
@@ -3730,7 +3702,8 @@ gboolean Cddb_Get_Album_Tracks_List (GtkTreeSelection* selection)
* Bold/Red = Info are already loaded, but not displayed
* Italic/Light Red = Duplicate CDDB entry
*/
-void Cddb_Album_List_Set_Row_Appearance (GtkTreeIter *row)
+static void
+Cddb_Album_List_Set_Row_Appearance (GtkTreeIter *row)
{
CddbAlbum *cddbalbum = NULL;
@@ -3792,7 +3765,8 @@ void Cddb_Album_List_Set_Row_Appearance (GtkTreeIter *row)
/*
* Set CDDB data (from tracks list) into tags of the main file list
*/
-gboolean Cddb_Set_Track_Infos_To_File_List (void)
+static gboolean
+Cddb_Set_Track_Infos_To_File_List (void)
{
guint row;
guint list_length;
@@ -4138,7 +4112,8 @@ gboolean Cddb_Set_Track_Infos_To_File_List (void)
}
-void Cddb_Display_Red_Lines_In_Result (void)
+static void
+Cddb_Display_Red_Lines_In_Result (void)
{
if (!CddbDisplayRedLinesButton) return;
@@ -4157,7 +4132,8 @@ void Cddb_Display_Red_Lines_In_Result (void)
/*
* Returns the corresponding ID3 genre (the name, not the value)
*/
-gchar *Cddb_Get_Id3_Genre_From_Cddb_Genre (gchar *cddb_genre)
+static const gchar *
+Cddb_Get_Id3_Genre_From_Cddb_Genre (const gchar *cddb_genre)
{
guint i;
@@ -4178,7 +4154,8 @@ gchar *Cddb_Get_Id3_Genre_From_Cddb_Genre (gchar *cddb_genre)
/*
* Returns the pixmap to display following the server name
*/
-GdkPixbuf *Cddb_Get_Pixbuf_From_Server_Name (const gchar *server_name)
+static GdkPixbuf *
+Cddb_Get_Pixbuf_From_Server_Name (const gchar *server_name)
{
if (!server_name)
return NULL;
@@ -4247,7 +4224,8 @@ char *base64_encode (char *str)
}
*/
-gchar *Cddb_Format_Proxy_Authentification (void)
+static gchar *
+Cddb_Format_Proxy_Authentification (void)
{
gchar *ret;
diff --git a/src/charset.c b/src/charset.c
index 284e213..ff95113 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -467,40 +467,6 @@ gchar *convert_to_utf8 (const gchar *string)
return output;
}
-gchar *convert_from_utf8 (const char *string)
-{
- gchar *output;
- GError *error = NULL;
-
- if (!string)
- return NULL;
-
- output = g_locale_from_utf8(string, -1, NULL, NULL, &error);
-
- if (output == NULL)
- {
- const gchar *usercharset;
- gchar *escaped_str = g_strescape(string, NULL);
- g_get_charset(&usercharset);
- Log_Print(LOG_ERROR,"convert_from_utf8(): Failed conversion to charset '%s'. "
- "String '%s'. Errcode %d (%s).",
- usercharset, escaped_str, error->code, error->message);
- g_free(escaped_str);
-
- if (g_utf8_validate(string, -1, NULL))
- Log_Print(LOG_ERROR,"convert_from_utf8(): String was valid UTF-8.");
- else
- Log_Print(LOG_ERROR,"convert_from_utf8(): String was INVALID UTF-8.");
-
- g_error_free(error);
- return g_strdup(string);
- }
-
- return output;
-}
-
-
-
/*
* Convert a string from the filename system encoding to UTF-8.
* - conversion OK : returns the UTF-8 string (new allocated)
@@ -744,83 +710,3 @@ gchar *Charset_Get_Name_From_Title (const gchar *charset_title)
return charset_trans_array[i].charset_name;
return "";
}
-
-
-/*
- * Return charset_title from charset_name
- */
-gchar *Charset_Get_Title_From_Name (gchar *charset_name)
-{
- guint i;
-
- if (charset_name)
- for (i=0; i<CHARSET_TRANS_ARRAY_LEN; i++)
- if ( strcasecmp(charset_name,charset_trans_array[i].charset_name) == 0 )
- return _(charset_trans_array[i].charset_title);
- return "";
-}
-
-
-
-/*
- * Test if the conversion is supported between two character sets ('from' and 'to)
- * (function called in the preferences window).
- * Note : for UTF-16 (2 byte for each character) we make a special test...
- */
-gboolean test_conversion_charset (const gchar *from, const gchar *to)
-{
- gchar *temp;
-
- if (!from || !to)
- return FALSE;
-
- // Do a quick test conversion and examine error output
- if ( strcmp(from,"UTF-16BE") == 0 )
- {
- temp = convert_string_1("F\0O\0O\0\0\0", 6, from, to, FALSE);
- }else if ( strcmp(from,"UTF-16LE") == 0 )
- {
- temp = convert_string_1("\0F\0O\0O\0\0", 6, from, to, FALSE);
- }else
- {
- temp = convert_string("FOO", from, to, FALSE);
- }
-
- if (!temp)
- {
- /*// Error in conversion
- if (error && error->code == G_CONVERT_ERROR_NO_CONVERSION)
- {
- Log_Print(LOG_ERROR,"Conversion error from '%s' to '%s' (G_CONVERT_ERROR_NO_CONVERSION)",from,to);
- } else if (error && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE)
- {
- Log_Print(LOG_ERROR,"Conversion error from '%s' to '%s' (G_CONVERT_ERROR_ILLEGAL_SEQUENCE)",from,to);
- } else if (error && error->code == G_CONVERT_ERROR_FAILED)
- {
- Log_Print(LOG_ERROR,"Conversion error from '%s' to '%s' (G_CONVERT_ERROR_FAILED)",from,to);
- } else if (error && error->code == G_CONVERT_ERROR_PARTIAL_INPUT)
- {
- Log_Print(LOG_ERROR,"Conversion error from '%s' to '%s' (G_CONVERT_ERROR_PARTIAL_INPUT)",from,to);
- } else if (error && error->code == G_CONVERT_ERROR_BAD_URI)
- {
- Log_Print(LOG_ERROR,"Conversion error from '%s' to '%s' (G_CONVERT_ERROR_BAD_URI)",from,to);
- } else if (error && error->code == G_CONVERT_ERROR_NOT_ABSOLUTE_PATH)
- {
- Log_Print(LOG_ERROR,"Conversion error from '%s' to '%s' (G_CONVERT_ERROR_NOT_ABSOLUTE_PATH)",from,to);
- } else
- {
- Log_Print(LOG_ERROR,"Conversion error from '%s' to '%s' (unknown : %d)",from,to,error->code);
- }
-
- if (error)
- g_error_free(error);*/
- return FALSE;
- } else
- {
- /*// No error
- if (error)
- g_error_free(error);*/
- g_free(temp);
- return TRUE;
- }
-}
diff --git a/src/charset.h b/src/charset.h
index 7613628..f756344 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -52,7 +52,6 @@ gchar *convert_string_1 (const gchar *string, gssize length, const gchar *from_c
/* Used for Ogg Vorbis and FLAC tags */
gchar *convert_to_utf8 (const gchar *string);
-gchar *convert_from_utf8 (const gchar *string);
gchar *filename_to_display (const gchar *string);
gchar *filename_from_display (const gchar *string);
@@ -61,9 +60,7 @@ gchar *Try_To_Validate_Utf8_String (const gchar *string);
void Charset_Populate_Combobox (GtkComboBox *combo, gchar *select_charset);
gchar *Charset_Get_Name_From_Title (const gchar *charset_title);
-gchar *Charset_Get_Title_From_Name (gchar *charset_name);
-gboolean test_conversion_charset (const gchar *from, const gchar *to);
void Charset_Insert_Locales_Init (void);
void Charset_Insert_Locales_Destroy (void);
diff --git a/src/dlm.c b/src/dlm.c
index f908c06..5e1d10f 100644
--- a/src/dlm.c
+++ b/src/dlm.c
@@ -5,8 +5,8 @@
#include "dlm.h"
-int dlm_cost (const gchar, const gchar);
-int dlm_minimum (int a, int b, int c, int d);
+static int dlm_cost (const gchar, const gchar);
+static int dlm_minimum (int a, int b, int c, int d);
/*
* Compute the Damerau-Levenshtein Distance between utf-8 strings ds and dt.
@@ -67,13 +67,15 @@ int dlm (const gchar *ds, const gchar *dt)
}
/* "Cost" of changing from a to b. */
-int dlm_cost (const char a, const char b)
+static int
+dlm_cost (const char a, const char b)
{
return a == b ? 0 : 1;
}
/* Return the smallest of four integers. */
-int dlm_minimum (int a, int b, int c, int d)
+static int
+dlm_minimum (int a, int b, int c, int d)
{
int min = a;
if (b < min)
diff --git a/src/easytag.c b/src/easytag.c
index bf2efa0..aaeff3b 100644
--- a/src/easytag.c
+++ b/src/easytag.c
@@ -101,43 +101,50 @@ gint SF_ButtonPressed_Delete_File;
/**************
* Prototypes *
**************/
-void Handle_Crash (gint signal_id);
-gchar *signal_to_string (gint signal);
+static void Handle_Crash (gint signal_id);
+static const gchar *signal_to_string (gint signal);
-GtkWidget *Create_Browser_Area (void);
-GtkWidget *Create_File_Area (void);
-GtkWidget *Create_Tag_Area (void);
+static GtkWidget *Create_Browser_Area (void);
+static GtkWidget *Create_File_Area (void);
+static GtkWidget *Create_Tag_Area (void);
-void Menu_Mini_Button_Clicked (GtkEntry *entry);
-void Mini_Button_Clicked (GObject *object);
-void Disable_Command_Buttons (void);
+static void Menu_Mini_Button_Clicked (GtkEntry *entry);
+static void Mini_Button_Clicked (GObject *object);
+static void Disable_Command_Buttons (void);
void Clear_Tag_Entry_Fields (void);
void Clear_File_Entry_Field (void);
void Clear_Header_Fields (void);
-gint Make_Dir (const gchar *dirname_old, const gchar *dirname_new);
-gint Remove_Dir (const gchar *dirname_old, const gchar *dirname_new);
-gboolean Write_File_Tag (ET_File *ETFile, gboolean hide_msgbox);
-gboolean Rename_File (ET_File *ETFile, gboolean hide_msgbox);
-gint Save_File (ET_File *ETFile, gboolean multiple_files, gboolean force_saving_files);
-gint Delete_File (ET_File *ETFile, gboolean multiple_files);
+static gboolean Make_Dir (const gchar *dirname_old, const gchar *dirname_new);
+static gboolean Remove_Dir (const gchar *dirname_old,
+ const gchar *dirname_new);
+static gboolean Write_File_Tag (ET_File *ETFile, gboolean hide_msgbox);
+static gboolean Rename_File (ET_File *ETFile, gboolean hide_msgbox);
+static gint Save_File (ET_File *ETFile, gboolean multiple_files,
+ gboolean force_saving_files);
+static gint Delete_File (ET_File *ETFile, gboolean multiple_files);
gint Save_All_Files_With_Answer (gboolean force_saving_files);
-gint Save_Selected_Files_With_Answer (gboolean force_saving_files);
-gint Save_List_Of_Files (GList *etfilelist, gboolean force_saving_files);
-gint Delete_Selected_Files_With_Answer (void);
-gint Copy_File (gchar const *fileold, gchar const *filenew);
+static gint Save_Selected_Files_With_Answer (gboolean force_saving_files);
+static gint Save_List_Of_Files (GList *etfilelist,
+ gboolean force_saving_files);
+static gint Delete_Selected_Files_With_Answer (void);
+static gboolean Copy_File (const gchar *fileold, const gchar *filenew);
-void Display_Usage (void);
+static void Display_Usage (void);
-void Init_Load_Default_Dir (void);
-void EasyTAG_Exit (void);
+static void Init_Load_Default_Dir (void);
+static void EasyTAG_Exit (void);
void Quit_MainWindow_Ok_Button (void);
-GList *Read_Directory_Recursively (GList *file_list, gchar *path, gint recurse);
-void Open_Quit_Recursion_Function_Window (void);
-void Destroy_Quit_Recursion_Function_Window (void);
-void Quit_Recursion_Function_Button_Pressed (void);
-void Quit_Recursion_Window_Key_Press (GtkWidget *window, GdkEvent *event);
+static GList *Read_Directory_Recursively (GList *file_list, const gchar *path,
+ gboolean recurse);
+static void Open_Quit_Recursion_Function_Window (void);
+static void Destroy_Quit_Recursion_Function_Window (void);
+static void Quit_Recursion_Function_Button_Pressed (void);
+static void Quit_Recursion_Window_Key_Press (GtkWidget *window,
+ GdkEvent *event);
+static void File_Area_Set_Sensitive (gboolean activate);
+static void Tag_Area_Set_Sensitive (gboolean activate);
#ifndef WIN32
static void
@@ -430,7 +437,8 @@ int main (int argc, char *argv[])
}
-GtkWidget *Create_Browser_Area (void)
+static GtkWidget *
+Create_Browser_Area (void)
{
GtkWidget *Frame;
GtkWidget *Tree;
@@ -450,7 +458,8 @@ GtkWidget *Create_Browser_Area (void)
}
-GtkWidget *Create_File_Area (void)
+static GtkWidget *
+Create_File_Area (void)
{
GtkWidget *VBox, *HBox;
GtkWidget *Separator;
@@ -554,7 +563,8 @@ GtkWidget *Create_File_Area (void)
}
#include "../pixmaps/sequence_track.xpm"
-GtkWidget *Create_Tag_Area (void)
+static GtkWidget *
+Create_Tag_Area (void)
{
GtkWidget *Separator;
GtkWidget *Frame;
@@ -1149,12 +1159,15 @@ GtkWidget *Create_Tag_Area (void)
/*
* Actions when mini buttons are pressed: apply the field to all others files
*/
-void Menu_Mini_Button_Clicked (GtkEntry *entry)
+static void
+Menu_Mini_Button_Clicked (GtkEntry *entry)
{
if ( g_object_get_data(G_OBJECT(entry),"MButtonName") )
Mini_Button_Clicked(G_OBJECT(g_object_get_data(G_OBJECT(entry),"MButtonName")));
}
-void Mini_Button_Clicked (GObject *object)
+
+static void
+Mini_Button_Clicked (GObject *object)
{
GList *etfilelist = NULL;
GList *selection_filelist = NULL;
@@ -2122,7 +2135,8 @@ gint Save_All_Files_With_Answer (gboolean force_saving_files)
/*
* Will save only the selected files in the file list
*/
-gint Save_Selected_Files_With_Answer (gboolean force_saving_files)
+static gint
+Save_Selected_Files_With_Answer (gboolean force_saving_files)
{
gint toreturn;
GList *etfilelist = NULL;
@@ -2155,7 +2169,8 @@ gint Save_Selected_Files_With_Answer (gboolean force_saving_files)
* - force_saving_files = TRUE => force saving the file even if it wasn't changed
* - force_saving_files = FALSE => force saving only the changed files
*/
-gint Save_List_Of_Files (GList *etfilelist, gboolean force_saving_files)
+static gint
+Save_List_Of_Files (GList *etfilelist, gboolean force_saving_files)
{
gint progress_bar_index;
gint saving_answer;
@@ -2364,7 +2379,8 @@ void Action_Delete_Selected_Files (void)
}
-gint Delete_Selected_Files_With_Answer (void)
+static gint
+Delete_Selected_Files_With_Answer (void)
{
GList *selfilelist;
GList *rowreflist = NULL;
@@ -2506,7 +2522,9 @@ gint Delete_Selected_Files_With_Answer (void)
* to do the same action for all files.
* - multiple_files = FALSE : appears only a msgbox to ask confirmation.
*/
-gint Save_File (ET_File *ETFile, gboolean multiple_files, gboolean force_saving_files)
+static gint
+Save_File (ET_File *ETFile, gboolean multiple_files,
+ gboolean force_saving_files)
{
File_Tag *FileTag;
File_Name *FileNameNew;
@@ -2768,7 +2786,8 @@ gint Save_File (ET_File *ETFile, gboolean multiple_files, gboolean force_saving_
* Return TRUE => OK
* FALSE => error
*/
-gboolean Write_File_Tag (ET_File *ETFile, gboolean hide_msgbox)
+static gboolean
+Write_File_Tag (ET_File *ETFile, gboolean hide_msgbox)
{
gchar *cur_filename_utf8 = ((File_Name *)ETFile->FileNameCur->data)->value_utf8;
gchar *msg;
@@ -2798,7 +2817,7 @@ gboolean Write_File_Tag (ET_File *ETFile, gboolean hide_msgbox)
break;
#endif
default:
- msg = g_strerror(errno);
+ msg = g_strdup (g_strerror (errno));
}
msg1 = g_strdup_printf(_("Cannot write tag in file '%s' (%s)"),
@@ -2830,7 +2849,8 @@ gboolean Write_File_Tag (ET_File *ETFile, gboolean hide_msgbox)
/*
* Make dir and all parents with permission mode
*/
-gint Make_Dir (const gchar *dirname_old, const gchar *dirname_new)
+static gboolean
+Make_Dir (const gchar *dirname_old, const gchar *dirname_new)
{
gchar *parent, *temp;
struct stat dirstat;
@@ -2860,23 +2880,24 @@ gint Make_Dir (const gchar *dirname_old, const gchar *dirname_new)
if (mkdir(parent,dirstat.st_mode)==-1 && errno!=EEXIST)
{
g_free(parent);
- return(-1);
+ return FALSE;
}
*temp=G_DIR_SEPARATOR; // To cancel the '*temp=0;'
}
g_free(parent);
if (mkdir(dirname_new,dirstat.st_mode)==-1 && errno!=EEXIST)
- return(-1);
+ return FALSE;
- return(0);
+ return TRUE;
}
/*
* Remove old directories after renaming the file
* Badly coded, but works....
*/
-gint Remove_Dir (const gchar *dirname_old, const gchar *dirname_new)
+static gboolean
+Remove_Dir (const gchar *dirname_old, const gchar *dirname_new)
{
gchar *temp_old, *temp_new;
gchar *temp_end_old, *temp_end_new;
@@ -2894,7 +2915,7 @@ gint Remove_Dir (const gchar *dirname_old, const gchar *dirname_new)
{
g_free(temp_old);
g_free(temp_new);
- return(-1);
+ return FALSE;
}else
{
break;
@@ -2918,7 +2939,7 @@ gint Remove_Dir (const gchar *dirname_old, const gchar *dirname_new)
g_free(temp_old);
g_free(temp_new);
- return(0);
+ return TRUE;
}
@@ -2927,7 +2948,8 @@ gint Remove_Dir (const gchar *dirname_old, const gchar *dirname_new)
* Return TRUE => OK
* FALSE => error
*/
-gboolean Rename_File (ET_File *ETFile, gboolean hide_msgbox)
+static gboolean
+Rename_File (ET_File *ETFile, gboolean hide_msgbox)
{
FILE *file;
gchar *tmp_filename = NULL;
@@ -3068,7 +3090,7 @@ gboolean Rename_File (ET_File *ETFile, gboolean hide_msgbox)
if (dirname_cur && dirname_new && strcmp(dirname_cur,dirname_new)) /* Need to create target directory? */
{
- if (Make_Dir(dirname_cur,dirname_new))
+ if (!Make_Dir(dirname_cur,dirname_new))
{
gchar *msg;
GtkWidget *msgdialog;
@@ -3119,7 +3141,7 @@ gboolean Rename_File (ET_File *ETFile, gboolean hide_msgbox)
Statusbar_Message(_("File(s) renamedâ"),TRUE);
/* Remove the of directory (check automatically if it is empty) */
- if (Remove_Dir(dirname_cur,dirname_new))
+ if (!Remove_Dir(dirname_cur,dirname_new))
{
gchar *msg;
GtkWidget *msgdialog;
@@ -3177,7 +3199,7 @@ gboolean Rename_File (ET_File *ETFile, gboolean hide_msgbox)
Statusbar_Message(_("File(s) movedâ"),TRUE);
/* Remove the of directory (check automatically if it is empty) */
- if (Remove_Dir(dirname_cur,dirname_new))
+ if (!Remove_Dir(dirname_cur,dirname_new))
{
gchar *msg;
GtkWidget *msgdialog;
@@ -3295,7 +3317,8 @@ gboolean Rename_File (ET_File *ETFile, gboolean hide_msgbox)
/*
* Delete the file ETFile
*/
-gint Delete_File (ET_File *ETFile, gboolean multiple_files)
+static gint
+Delete_File (ET_File *ETFile, gboolean multiple_files)
{
GtkWidget *msgdialog;
GtkWidget *msgdialog_check_button = NULL;
@@ -3384,7 +3407,8 @@ gint Delete_File (ET_File *ETFile, gboolean multiple_files)
/*
* Copy a file to a new location
*/
-gint Copy_File (gchar const *fileold, gchar const *filenew)
+static gboolean
+Copy_File (const gchar *fileold, const gchar *filenew)
{
FILE* fOld;
FILE* fNew;
@@ -3634,7 +3658,9 @@ gboolean Read_Directory (gchar *path_real)
/*
* Recurse the path to create a list of files. Return a GList of the files found.
*/
-GList *Read_Directory_Recursively (GList *file_list, gchar *path_real, gint recurse)
+static GList *
+Read_Directory_Recursively (GList *file_list, const gchar *path_real,
+ gboolean recurse)
{
DIR *dir;
struct dirent *dirent;
@@ -3692,7 +3718,8 @@ GList *Read_Directory_Recursively (GList *file_list, gchar *path_real, gint recu
/*
* Window with the 'STOP' button to stop recursion when reading directories
*/
-void Open_Quit_Recursion_Function_Window (void)
+static void
+Open_Quit_Recursion_Function_Window (void)
{
GtkWidget *button;
GtkWidget *frame;
@@ -3727,7 +3754,9 @@ void Open_Quit_Recursion_Function_Window (void)
gtk_widget_show_all(QuitRecursionWindow);
}
-void Destroy_Quit_Recursion_Function_Window (void)
+
+static void
+Destroy_Quit_Recursion_Function_Window (void)
{
if (QuitRecursionWindow)
{
@@ -3736,12 +3765,16 @@ void Destroy_Quit_Recursion_Function_Window (void)
/*Statusbar_Message(_("Recursive file search interrupted."),FALSE);*/
}
}
-void Quit_Recursion_Function_Button_Pressed (void)
+
+static void
+Quit_Recursion_Function_Button_Pressed (void)
{
Action_Main_Stop_Button_Pressed();
Destroy_Quit_Recursion_Function_Window();
}
-void Quit_Recursion_Window_Key_Press (GtkWidget *window, GdkEvent *event)
+
+static void
+Quit_Recursion_Window_Key_Press (GtkWidget *window, GdkEvent *event)
{
GdkEventKey *kevent;
@@ -4002,7 +4035,8 @@ void Update_Command_Buttons_Sensivity (void)
/*
* Just to disable buttons when we are saving files (do not disable Quit button)
*/
-void Disable_Command_Buttons (void)
+static void
+Disable_Command_Buttons (void)
{
/* Scanner Window */
if (SWScanButton)
@@ -4037,7 +4071,8 @@ void Disable_Command_Buttons (void)
/*
* Disable (FALSE) / Enable (TRUE) all user widgets in the tag area
*/
-void Tag_Area_Set_Sensitive (gboolean activate)
+static void
+Tag_Area_Set_Sensitive (gboolean activate)
{
if (!TagArea) return;
@@ -4072,7 +4107,8 @@ void Tag_Area_Set_Sensitive (gboolean activate)
/*
* Disable (FALSE) / Enable (TRUE) all user widgets in the file area
*/
-void File_Area_Set_Sensitive (gboolean activate)
+static void
+File_Area_Set_Sensitive (gboolean activate)
{
if (!FileArea) return;
@@ -4447,7 +4483,8 @@ void Clear_Header_Fields (void)
* Load the default directory when the user interface is completely displayed
* to avoid bad visualization effect at startup.
*/
-void Init_Load_Default_Dir (void)
+static void
+Init_Load_Default_Dir (void)
{
//ETCore->ETFileList = NULL;
ET_Core_Free();
@@ -4709,7 +4746,8 @@ void Attach_Popup_Menu_To_Tag_Entries (GtkEntry *entry)
* Function to manage the received signals (specially for segfaults)
* Handle crashs
*/
-void Handle_Crash (gint signal_id)
+static void
+Handle_Crash (gint signal_id)
{
//gchar commmand[256];
@@ -4737,7 +4775,8 @@ void Handle_Crash (gint signal_id)
//system(commmand);
}
-gchar *signal_to_string (gint signal)
+static const gchar *
+signal_to_string (gint signal)
{
#ifdef SIGHUP
if (signal == SIGHUP) return ("SIGHUP");
@@ -4860,7 +4899,8 @@ gchar *signal_to_string (gint signal)
/*
* Display usage information
*/
-void Display_Usage (void)
+static void
+Display_Usage (void)
{
// Fix from Steve Ralston for gcc-3.2.2
#ifdef WIN32
@@ -4893,7 +4933,8 @@ void Display_Usage (void)
/*
* Exit the program
*/
-void EasyTAG_Exit (void)
+static void
+EasyTAG_Exit (void)
{
ET_Core_Destroy();
Charset_Insert_Locales_Destroy();
diff --git a/src/easytag.h b/src/easytag.h
index e333abf..47b1845 100644
--- a/src/easytag.h
+++ b/src/easytag.h
@@ -173,13 +173,10 @@ void Action_Undo_From_History_List (void);
void Action_Redo_From_History_List (void);
void Action_Delete_Selected_Files (void);
gint Save_All_Files_With_Answer (gboolean force_saving_files);
-gint Save_Selected_Files_With_Answer (gboolean force_saving_files);
void Action_Main_Stop_Button_Pressed (void);
void Action_Select_Browser_Style (void);
-void File_Area_Set_Sensitive (gboolean activate);
-void Tag_Area_Set_Sensitive (gboolean activate);
void Tag_Area_Display_Controls (ET_File *ETFile);
gboolean Read_Directory (gchar *path);
diff --git a/src/et_core.c b/src/et_core.c
index 8a1e553..dda114a 100644
--- a/src/et_core.c
+++ b/src/et_core.c
@@ -98,83 +98,83 @@ void ET_Core_Free (void);
void ET_Core_Destroy (void);
//gboolean ET_File_Is_Supported (gchar *filename);
-gchar *ET_Get_File_Extension (gchar *filename);
-ET_File_Description *ET_Get_File_Description (gchar *filename);
-ET_File_Description *ET_Get_File_Description_From_Extension (gchar *extension);
+static gchar *ET_Get_File_Extension (const gchar *filename);
+static ET_File_Description *ET_Get_File_Description (const gchar *filename);
+static ET_File_Description *ET_Get_File_Description_From_Extension (const gchar *extension);
-gboolean ET_Free_File_List (void);
+static gboolean ET_Free_File_List (void);
gboolean ET_Free_File_List_Item (ET_File *ETFile);
-gboolean ET_Free_File_Name_List (GList *FileNameList);
-gboolean ET_Free_File_Tag_List (GList *FileTagList);
-gboolean ET_Free_File_Name_Item (File_Name *FileName);
+static gboolean ET_Free_File_Name_List (GList *FileNameList);
+static gboolean ET_Free_File_Tag_List (GList *FileTagList);
+static gboolean ET_Free_File_Name_Item (File_Name *FileName);
gboolean ET_Free_File_Tag_Item (File_Tag *FileTag);
-gboolean ET_Free_File_Tag_Item_Other_Field (File_Tag *FileTag);
-gboolean ET_Free_File_Info_Item (ET_File_Info *ETFileInfo);
-gboolean ET_Free_History_File_List (void);
-gboolean ET_Free_Displayed_File_List (void);
-gboolean ET_Free_Artist_Album_File_List (void);
+static gboolean ET_Free_File_Tag_Item_Other_Field (File_Tag *FileTag);
+static gboolean ET_Free_File_Info_Item (ET_File_Info *ETFileInfo);
+static gboolean ET_Free_History_File_List (void);
+static gboolean ET_Free_Displayed_File_List (void);
+static gboolean ET_Free_Artist_Album_File_List (void);
-void ET_Initialize_File_Item (ET_File *ETFile);
-void ET_Initialize_File_Tag_Item (File_Tag *FileTag);
-void ET_Initialize_File_Name_Item (File_Name *FileName);
-void ET_Initialize_File_Info_Item (ET_File_Info *ETFileInfo);
+static void ET_Initialize_File_Item (ET_File *ETFile);
+static void ET_Initialize_File_Tag_Item (File_Tag *FileTag);
+static void ET_Initialize_File_Name_Item (File_Name *FileName);
+static void ET_Initialize_File_Info_Item (ET_File_Info *ETFileInfo);
//gboolean ET_Copy_File_Tag_Item (ET_File *ETFile, File_Tag *FileTag);
-gboolean ET_Copy_File_Tag_Item_Other_Field (ET_File *ETFile, File_Tag *FileTag);
-//gboolean ET_Set_Field_File_Name_Item (gint *FileNameField, gchar *value);
-//gboolean ET_Set_Field_File_Name_Item (gchar **FileNameField, gchar *value);
-//gboolean ET_Set_Field_File_Tag_Item (gint *FileTagField, gchar *value);
+static gboolean ET_Copy_File_Tag_Item_Other_Field (ET_File *ETFile, File_Tag *FileTag);
//gboolean ET_Set_Field_File_Tag_Picture (gchar **FileTagField, Picture *pic);
-guint ET_File_Key_New (void);
-guint ET_Undo_Key_New (void);
+static guint ET_File_Key_New (void);
+static guint ET_Undo_Key_New (void);
GList *ET_File_List_Remove (GList *item_to_remove);
gboolean ET_Remove_File_From_File_List (ET_File *ETFile);
-gboolean ET_Remove_File_From_Artist_Album_List (ET_File *ETFile);
+static gboolean ET_Remove_File_From_Artist_Album_List (ET_File *ETFile);
-void ET_Display_File_And_List_Status_To_UI (ET_File *ETFile);
-void ET_Display_Filename_To_UI (ET_File *ETFile);
-gboolean ET_Display_File_Tag_To_UI (ET_File *ETFile);
-gboolean ET_Display_File_Info_To_UI (ET_File_Info *ETFileInfo);
+static void ET_Display_File_And_List_Status_To_UI (ET_File *ETFile);
+static void ET_Display_Filename_To_UI (ET_File *ETFile);
+static gboolean ET_Display_File_Tag_To_UI (ET_File *ETFile);
+static gboolean ET_Display_File_Info_To_UI (ET_File_Info *ETFileInfo);
-gboolean ET_Save_File_Name_From_UI (ET_File *ETFile, File_Name *FileName);
-gboolean ET_Save_File_Name_Internal (ET_File *ETFile, File_Name *FileName);
-gboolean ET_Save_File_Tag_From_UI (File_Tag *FileTag);
-gboolean ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag);
+static gboolean ET_Save_File_Name_From_UI (ET_File *ETFile,
+ File_Name *FileName);
+static gboolean ET_Save_File_Name_Internal (ET_File *ETFile, File_Name *FileName);
+static gboolean ET_Save_File_Tag_From_UI (File_Tag *FileTag);
+static gboolean ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag);
-void ET_Mark_File_Tag_As_Saved (ET_File *ETFile);
+static void ET_Mark_File_Tag_As_Saved (ET_File *ETFile);
void ET_Mark_File_Name_As_Saved (ET_File *ETFile);
gboolean ET_Manage_Changes_Of_File_Data (ET_File *ETFile, File_Name *FileName, File_Tag *FileTag);
-gboolean ET_Detect_Changes_Of_File_Name (File_Name *FileName1, File_Name *FileName2);
+static gboolean ET_Detect_Changes_Of_File_Name (File_Name *FileName1,
+ File_Name *FileName2);
gboolean ET_Detect_Changes_Of_File_Tag (File_Tag *FileTag1, File_Tag *FileTag2);
-gboolean ET_Add_File_Name_To_List (ET_File *ETFile, File_Name *FileName);
-gboolean ET_Add_File_Tag_To_List (ET_File *ETFile, File_Tag *FileTag);
-gboolean ET_Add_File_To_History_List (ET_File *ETFile);
-gboolean ET_Add_File_To_Artist_Album_File_List (ET_File *ETFile);
+static gboolean ET_Add_File_Name_To_List (ET_File *ETFile,
+ File_Name *FileName);
+static gboolean ET_Add_File_Tag_To_List (ET_File *ETFile, File_Tag *FileTag);
+static gboolean ET_Add_File_To_History_List (ET_File *ETFile);
+static gboolean ET_Add_File_To_Artist_Album_File_List (ET_File *ETFile);
GList *ET_Displayed_File_List_First (void);
GList *ET_Displayed_File_List_Previous (void);
GList *ET_Displayed_File_List_Next (void);
GList *ET_Displayed_File_List_Last (void);
GList *ET_Displayed_File_List_By_Etfile (ET_File *ETFile);
-GList *ET_Displayed_File_List_By_Position (gulong pos_in_list);
-guint ET_Displayed_File_List_Get_Length (void);
-void ET_Displayed_File_List_Number (void);
+static guint ET_Displayed_File_List_Get_Length (void);
+static void ET_Displayed_File_List_Number (void);
gboolean ET_Set_Displayed_File_List (GList *ETFileList);
-gboolean ET_Read_File_Info (gchar *filename, ET_File_Info *ETFileInfo);
-//gboolean ET_File_Name_Convert_Character (gchar *filename_utf8);
-void ET_File_Name_Check_Length (ET_File *ETFile, gchar *filename_utf8);
+static gboolean ET_Read_File_Info (const gchar *filename,
+ ET_File_Info *ETFileInfo);
-gint ET_Comp_Func_Sort_File_By_Ascending_Index_Key (ET_File *ETFile1, ET_File *ETFile2);
-
-gint ET_Comp_Func_Sort_Artist_Item_By_Ascending_Artist (GList *AlbumList1, GList *AlbumList2);
-gint ET_Comp_Func_Sort_Album_Item_By_Ascending_Album (GList *etfilelist1, GList *etfilelist2);
-gint ET_Comp_Func_Sort_Etfile_Item_By_Ascending_Filename (ET_File *ETFile1, ET_File *ETFile2);
+static gint ET_Comp_Func_Sort_Artist_Item_By_Ascending_Artist (GList *AlbumList1,
+ GList *AlbumList2);
+static gint ET_Comp_Func_Sort_Album_Item_By_Ascending_Album (GList *etfilelist1,
+ GList *etfilelist2);
+static gint ET_Comp_Func_Sort_Etfile_Item_By_Ascending_Filename (ET_File *ETFile1,
+ ET_File *ETFile2);
+static gchar *ET_File_Name_Format_Extension (ET_File *ETFile);
/*******************
@@ -184,7 +184,8 @@ gint ET_Comp_Func_Sort_Etfile_Item_By_Ascending_Filename (ET_File *ETFile1, ET_F
/*
* Returns the extension of the file
*/
-gchar *ET_Get_File_Extension (gchar *filename)
+static gchar *
+ET_Get_File_Extension (const gchar *filename)
{
if (filename)
return strrchr(filename, '.');
@@ -197,7 +198,8 @@ gchar *ET_Get_File_Extension (gchar *filename)
* Determine description of file using his extension.
* If extension is NULL or not found into the tab, it returns the last entry for UNKNOWN_FILE.
*/
-ET_File_Description *ET_Get_File_Description_From_Extension (gchar *extension)
+static ET_File_Description *
+ET_Get_File_Description_From_Extension (const gchar *extension)
{
guint i;
@@ -218,7 +220,8 @@ ET_File_Description *ET_Get_File_Description_From_Extension (gchar *extension)
* Determines first the extension. If extension is NULL or not found into the tab,
* it returns the last entry for UNKNOWN_FILE.
*/
-ET_File_Description *ET_Get_File_Description (gchar *filename)
+static ET_File_Description *
+ET_Get_File_Description (const gchar *filename)
{
return ET_Get_File_Description_From_Extension(ET_Get_File_Extension(filename));
}
@@ -330,7 +333,8 @@ File_Tag *ET_File_Tag_Item_New (void)
/*
* Create a new File_Info structure
*/
-ET_File_Info *ET_File_Info_Item_New (void)
+static ET_File_Info *
+ET_File_Info_Item_New (void)
{
ET_File_Info *ETFileInfo;
@@ -355,7 +359,8 @@ ET_File *ET_File_Item_New (void)
}
-void ET_Initialize_File_Name_Item (File_Name *FileName)
+static void
+ET_Initialize_File_Name_Item (File_Name *FileName)
{
if (FileName)
{
@@ -368,7 +373,8 @@ void ET_Initialize_File_Name_Item (File_Name *FileName)
}
-void ET_Initialize_File_Tag_Item (File_Tag *FileTag)
+static void
+ET_Initialize_File_Tag_Item (File_Tag *FileTag)
{
if (FileTag)
{
@@ -395,7 +401,8 @@ void ET_Initialize_File_Tag_Item (File_Tag *FileTag)
}
-void ET_Initialize_File_Info_Item (ET_File_Info *ETFileInfo)
+static void
+ET_Initialize_File_Info_Item (ET_File_Info *ETFileInfo)
{
if (ETFileInfo)
{
@@ -405,7 +412,8 @@ void ET_Initialize_File_Info_Item (ET_File_Info *ETFileInfo)
}
-void ET_Initialize_File_Item (ET_File *ETFile)
+static void
+ET_Initialize_File_Item (ET_File *ETFile)
{
if (ETFile)
{
@@ -425,14 +433,16 @@ void ET_Initialize_File_Item (ET_File *ETFile)
/* Key for each item of ETFileList */
-guint ET_File_Key_New (void)
+static guint
+ET_File_Key_New (void)
{
static guint ETFileKey = 0;
return ++ETFileKey;
}
/* Key for Undo */
-guint ET_Undo_Key_New (void)
+static guint
+ET_Undo_Key_New (void)
{
static guint ETUndoKey = 0;
return ++ETUndoKey;
@@ -662,7 +672,8 @@ gboolean ET_Create_Artist_Album_File_List (void)
* - "AlbumList" list is a list of ETFile items.
* Note : use the function ET_Debug_Print_Artist_Album_List(...) to understand how it works, it needed...
*/
-gboolean ET_Add_File_To_Artist_Album_File_List (ET_File *ETFile)
+static gboolean
+ET_Add_File_To_Artist_Album_File_List (ET_File *ETFile)
{
if (ETFile)
{
@@ -785,7 +796,6 @@ gboolean ET_Remove_File_From_File_List (ET_File *ETFile)
// Remove the file from the ETArtistAlbumList list
ET_Remove_File_From_Artist_Album_List(ETFile);
- //ET_Debug_Print_Artist_Album_List(__FILE__,__LINE__,__FUNCTION__);
// Remove the file from the ETFileDisplayedList list (if not already done)
if ( (ETFileDisplayedList = g_list_find(ETCore->ETFileDisplayedList,ETFile)) )
@@ -834,7 +844,8 @@ gboolean ET_Remove_File_From_File_List (ET_File *ETFile)
/*
* Delete the corresponding file (allocated data was previously freed!). Return TRUE if deleted.
*/
-gboolean ET_Remove_File_From_Artist_Album_List (ET_File *ETFile)
+static gboolean
+ET_Remove_File_From_Artist_Album_List (ET_File *ETFile)
{
GList *ArtistList;
GList *AlbumList;
@@ -882,7 +893,6 @@ gboolean ET_Remove_File_From_Artist_Album_List (ET_File *ETFile)
}
ArtistList = ArtistList->next;
}
- //ET_Debug_Print_Artist_Album_List(__FILE__,__LINE__,__FUNCTION__);
return FALSE; // ETFile is NUL, or not found in the list
}
@@ -896,7 +906,8 @@ gboolean ET_Remove_File_From_Artist_Album_List (ET_File *ETFile)
* Sort the 'ETFileDisplayedList' following the 'Sorting_Type'
* Note : Add also new sorting in 'Browser_List_Sort_Func'
*/
-void ET_Sort_Displayed_File_List (ET_Sorting_Type Sorting_Type)
+static void
+ET_Sort_Displayed_File_List (ET_Sorting_Type Sorting_Type)
{
ETCore->ETFileDisplayedList = ET_Sort_File_List(ETCore->ETFileDisplayedList,Sorting_Type);
}
@@ -1781,18 +1792,10 @@ gint ET_Comp_Func_Sort_File_By_Descending_File_Samplerate (ET_File *ETFile1, ET_
/*
- * Comparison function for sorting by ascending IndexKey (used mainly to have the ETFileSelectionList already sorted.)
- */
-gint ET_Comp_Func_Sort_File_By_Ascending_Index_Key (ET_File *ETFile1, ET_File *ETFile2)
-{
- return (ETFile1->IndexKey - ETFile2->IndexKey);
-}
-
-
-/*
* Comparison function for sorting by ascending artist in the ArtistAlbumList.
*/
-gint ET_Comp_Func_Sort_Artist_Item_By_Ascending_Artist (GList *AlbumList1, GList *AlbumList2)
+static gint ET_Comp_Func_Sort_Artist_Item_By_Ascending_Artist (GList *AlbumList1,
+ GList *AlbumList2)
{
GList *etfilelist1 = NULL, *etfilelist2 = NULL;
ET_File *etfile1 = NULL, *etfile2 = NULL;
@@ -1819,7 +1822,9 @@ gint ET_Comp_Func_Sort_Artist_Item_By_Ascending_Artist (GList *AlbumList1, GList
/*
* Comparison function for sorting by ascending album in the ArtistAlbumList.
*/
-gint ET_Comp_Func_Sort_Album_Item_By_Ascending_Album (GList *etfilelist1, GList *etfilelist2)
+static gint
+ET_Comp_Func_Sort_Album_Item_By_Ascending_Album (GList *etfilelist1,
+ GList *etfilelist2)
{
ET_File *etfile1, *etfile2;
gchar *etfile1_album, *etfile2_album;
@@ -1844,7 +1849,9 @@ gint ET_Comp_Func_Sort_Album_Item_By_Ascending_Album (GList *etfilelist1, GList
* Comparison function for sorting etfile in the ArtistAlbumList.
* FIX ME : should use the default sorting!
*/
-gint ET_Comp_Func_Sort_Etfile_Item_By_Ascending_Filename (ET_File *ETFile1, ET_File *ETFile2)
+static gint
+ET_Comp_Func_Sort_Etfile_Item_By_Ascending_Filename (ET_File *ETFile1,
+ ET_File *ETFile2)
{
if (!ETFile1) return -1;
@@ -1920,27 +1927,6 @@ GList *ET_Displayed_File_List_By_Etfile (ET_File *ETFile)
}
/*
- * Returns the item of the "displayed list" which have the position 'pos_in_list' in the list (used into CDDB result list).
- * Range for 'pos_in_list' is 1 to ETFileDisplayedList_Length.
- */
-GList *ET_Displayed_File_List_By_Position (gulong pos_in_list)
-{
- GList *etfilelist;
- guint i = 1;
-
- etfilelist = ET_Displayed_File_List_First();
- while (etfilelist)
- {
- if (i == pos_in_list)
- break;
- etfilelist = ET_Displayed_File_List_Next();
- i++;
- }
- ETCore->ETFileDisplayedList = etfilelist; // To "save" the position like in ET_Displayed_File_List_Next... (not very good - FIX ME)
- return etfilelist;
-}
-
-/*
* Just returns the current item of the "main list"
*/
/*GList *ET_Displayed_File_List_Current (void)
@@ -1952,7 +1938,8 @@ GList *ET_Displayed_File_List_By_Position (gulong pos_in_list)
/*
* Renumber the list of displayed files (IndexKey) from 1 to n
*/
-void ET_Displayed_File_List_Number (void)
+static void
+ET_Displayed_File_List_Number (void)
{
GList *list = NULL;
guint i = 1;
@@ -1968,7 +1955,8 @@ void ET_Displayed_File_List_Number (void)
/*
* Returns the length of the list of displayed files
*/
-guint ET_Displayed_File_List_Get_Length (void)
+static guint
+ET_Displayed_File_List_Get_Length (void)
{
GList *list = NULL;
@@ -2104,7 +2092,8 @@ gboolean ET_Free_File_Name_Item (File_Name *FileName)
/*
* Frees the full list: GList *TagList.
*/
-gboolean ET_Free_File_Tag_List (GList *FileTagList)
+static gboolean
+ET_Free_File_Tag_List (GList *FileTagList)
{
GList *list;
@@ -2128,7 +2117,8 @@ gboolean ET_Free_File_Tag_List (GList *FileTagList)
/*
* Frees the list of 'other' field in a File_Tag item (contains attached gchar data).
*/
-gboolean ET_Free_File_Tag_Item_Other_Field (File_Tag *FileTag)
+static gboolean
+ET_Free_File_Tag_Item_Other_Field (File_Tag *FileTag)
{
GList *other = FileTag->other;
@@ -2180,7 +2170,8 @@ gboolean ET_Free_File_Tag_Item (File_Tag *FileTag)
/*
* Frees a File_Info item.
*/
-gboolean ET_Free_File_Info_Item (ET_File_Info *ETFileInfo)
+static gboolean
+ET_Free_File_Info_Item (ET_File_Info *ETFileInfo)
{
if (!ETFileInfo) return FALSE;
@@ -2196,7 +2187,8 @@ gboolean ET_Free_File_Info_Item (ET_File_Info *ETFileInfo)
/*
* History list contains only pointers, so no data to free except the history structure.
*/
-gboolean ET_Free_History_File_List (void)
+static gboolean
+ET_Free_History_File_List (void)
{
GList *list;
@@ -2219,7 +2211,8 @@ gboolean ET_Free_History_File_List (void)
/*
* "Display" list contains only pointers, so NOTHING to free
*/
-gboolean ET_Free_Displayed_File_List (void)
+static gboolean
+ET_Free_Displayed_File_List (void)
{
if (!ETCore || !ETCore->ETFileDisplayedList) return FALSE;
@@ -2233,7 +2226,8 @@ gboolean ET_Free_Displayed_File_List (void)
/*
* ArtistAlbum list contains 3 levels of lists
*/
-gboolean ET_Free_Artist_Album_File_List (void)
+static gboolean
+ET_Free_Artist_Album_File_List (void)
{
GList *ArtistList;
GList *AlbumList;
@@ -2275,7 +2269,8 @@ gboolean ET_Free_Artist_Album_File_List (void)
/*
* Duplicate the 'other' list
*/
-gboolean ET_Copy_File_Tag_Item_Other_Field (ET_File *ETFile, File_Tag *FileTag)
+static gboolean
+ET_Copy_File_Tag_Item_Other_Field (ET_File *ETFile, File_Tag *FileTag)
{
File_Tag *FileTagCur;
GList *list = NULL;
@@ -2466,16 +2461,6 @@ gboolean ET_Copy_File_Tag_Item (ET_File *ETFile, File_Tag *FileTag)
/*
- * Set the value of a field of a FileName item (for ex, value of FileName->value)
- * Must be used only for the 'gchar *' components (Only used for the filename)
- */
-gboolean ET_Set_Field_File_Name_Item (gchar **FileNameField, gchar *value)
-{
- return ET_Set_Field_File_Tag_Item(FileNameField,value);
-}
-
-
-/*
* Fill content of a FileName item according to the filename passed in argument (UTF-8 filename or not)
* Calculate also the collate key.
* It treats numbers intelligently so that "file1" "file10" "file5" is sorted as "file1" "file5" "file10"
@@ -2513,7 +2498,7 @@ gboolean ET_Set_Filename_File_Name_Item (File_Name *FileName, gchar *filename_ut
* Set the value of a field of a FileTag item (for ex, value of FileTag->title)
* Must be used only for the 'gchar *' components
*/
-gboolean ET_Set_Field_File_Tag_Item (gchar **FileTagField, gchar *value)
+gboolean ET_Set_Field_File_Tag_Item (gchar **FileTagField, const gchar *value)
{
if (!FileTagField) return FALSE;
@@ -2705,7 +2690,8 @@ void ET_Display_File_Data_To_UI (ET_File *ETFile)
* Toggle visibility of the small status icon if filename is read-only or not found.
* Show the position of the current file in the list, by using the index and list length.
*/
-void ET_Display_File_And_List_Status_To_UI (ET_File *ETFile)
+static void
+ET_Display_File_And_List_Status_To_UI (ET_File *ETFile)
{
FILE *file;
gchar *text;
@@ -2745,7 +2731,8 @@ void ET_Display_File_And_List_Status_To_UI (ET_File *ETFile)
g_free(text);
}
-void ET_Display_Filename_To_UI (ET_File *ETFile)
+static void
+ET_Display_Filename_To_UI (ET_File *ETFile)
{
gchar *pos;
gchar *new_filename_utf8;
@@ -2790,7 +2777,8 @@ void ET_Display_Filename_To_UI (ET_File *ETFile)
* Display all tag infos (tags fields) into entry boxes of the user interface.
* These data have the same structure for all files.
*/
-gboolean ET_Display_File_Tag_To_UI (ET_File *ETFile)
+static gboolean
+ET_Display_File_Tag_To_UI (ET_File *ETFile)
{
File_Tag *FileTag = NULL;
//GtkTextBuffer *textbuffer;
@@ -2990,7 +2978,8 @@ gboolean ET_Display_File_Tag_To_UI (ET_File *ETFile)
/*
* "Default" way to display File Info to the user interface.
*/
-gboolean ET_Display_File_Info_To_UI(ET_File_Info *ETFileInfo)
+static gboolean
+ET_Display_File_Info_To_UI(ET_File_Info *ETFileInfo)
{
gchar *text;
gchar *time = NULL;
@@ -3130,7 +3119,8 @@ void ET_Save_File_Data_From_UI (ET_File *ETFile)
* Note : it builds new filename (with path) from strings encoded into file system
* encoding, not UTF-8 (it preserves file system encoding of parent directories).
*/
-gboolean ET_Save_File_Name_From_UI (ET_File *ETFile, File_Name *FileName)
+static gboolean
+ET_Save_File_Name_From_UI (ET_File *ETFile, File_Name *FileName)
{
gchar *filename_new = NULL;
gchar *dirname = NULL;
@@ -3218,7 +3208,8 @@ gboolean ET_Save_File_Name_From_UI (ET_File *ETFile, File_Name *FileName)
* Do the same thing of ET_Save_File_Name_From_UI, but without getting the
* data from the UI.
*/
-gboolean ET_Save_File_Name_Internal (ET_File *ETFile, File_Name *FileName)
+static gboolean
+ET_Save_File_Name_Internal (ET_File *ETFile, File_Name *FileName)
{
gchar *filename_new = NULL;
gchar *dirname = NULL;
@@ -3283,7 +3274,8 @@ gboolean ET_Save_File_Name_Internal (ET_File *ETFile, File_Name *FileName)
/*
* Load values, entered into entries of the UI, into a File_Tag structure which had been newly created.
*/
-gboolean ET_Save_File_Tag_From_UI (File_Tag *FileTag)
+static gboolean
+ET_Save_File_Tag_From_UI (File_Tag *FileTag)
{
gchar *buffer = NULL;
//GtkTextBuffer *textbuffer;
@@ -3522,7 +3514,8 @@ gboolean ET_Save_File_Tag_From_UI (File_Tag *FileTag)
/*
* Do the same thing of ET_Save_File_Tag_From_UI without getting the data from the UI.
*/
-gboolean ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
+static gboolean
+ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
{
File_Tag *FileTagCur;
@@ -3953,7 +3946,8 @@ gboolean ET_Manage_Changes_Of_File_Data (ET_File *ETFile, File_Name *FileName, F
* - returns TRUE if there aren't the same
* - else returns FALSE
*/
-gboolean ET_Detect_Changes_Of_File_Name (File_Name *FileName1, File_Name *FileName2)
+static gboolean
+ET_Detect_Changes_Of_File_Name (File_Name *FileName1, File_Name *FileName2)
{
gchar *filename1_ck;
gchar *filename2_ck;
@@ -4118,7 +4112,8 @@ gboolean ET_Detect_Changes_Of_File_Tag (File_Tag *FileTag1, File_Tag *FileTag2)
/*
* Add a FileName item to the history list of ETFile
*/
-gboolean ET_Add_File_Name_To_List (ET_File *ETFile, File_Name *FileName)
+static gboolean
+ET_Add_File_Name_To_List (ET_File *ETFile, File_Name *FileName)
{
GList *cut_list = NULL;
@@ -4150,7 +4145,8 @@ gboolean ET_Add_File_Name_To_List (ET_File *ETFile, File_Name *FileName)
/*
* Add a FileTag item to the history list of ETFile
*/
-gboolean ET_Add_File_Tag_To_List (ET_File *ETFile, File_Tag *FileTag)
+static gboolean
+ET_Add_File_Tag_To_List (ET_File *ETFile, File_Tag *FileTag)
{
GList *cut_list = NULL;
@@ -4178,7 +4174,8 @@ gboolean ET_Add_File_Tag_To_List (ET_File *ETFile, File_Tag *FileTag)
/*
* Add a ETFile item to the main undo list of files
*/
-gboolean ET_Add_File_To_History_List (ET_File *ETFile)
+static gboolean
+ET_Add_File_To_History_List (ET_File *ETFile)
{
ET_History_File *ETHistoryFile;
@@ -4469,7 +4466,8 @@ Set_Saved_Value_Of_File_Tag (File_Tag *FileTag, gboolean saved)
if (FileTag) FileTag->saved = saved;
}
-void ET_Mark_File_Tag_As_Saved (ET_File *ETFile)
+static void
+ET_Mark_File_Tag_As_Saved (ET_File *ETFile)
{
File_Tag *FileTag;
GList *FileTagList;
@@ -4496,7 +4494,8 @@ void ET_Mark_File_Name_As_Saved (ET_File *ETFile)
/*
* Currently, it's a way by default to fill file size into ET_File_Info structure
*/
-gboolean ET_Read_File_Info (gchar *filename, ET_File_Info *ETFileInfo)
+static gboolean
+ET_Read_File_Info (const gchar *filename, ET_File_Info *ETFileInfo)
{
FILE *file;
@@ -4618,7 +4617,8 @@ gchar *ET_File_Name_Generate (ET_File *ETFile, gchar *new_file_name_utf8)
#endif
-gchar *ET_File_Name_Format_Extension (ET_File *ETFile)
+static gchar *
+ET_File_Name_Format_Extension (ET_File *ETFile)
{
// Convert filename extension (lower/upper/no change)
if (FILENAME_EXTENSION_LOWER_CASE)
@@ -4633,48 +4633,6 @@ gchar *ET_File_Name_Format_Extension (ET_File *ETFile)
/*
- * Check if the basename+extension of the file doesn't exceed following limits :
- * - ogg filenames musn't exceed 255-6 characters (because we use mkstemp)
- * - other filenames musn't exceed 255 characters
- * Parameters:
- * - 'filename_utf8' filename without the extension
- */
-void ET_File_Name_Check_Length (ET_File *ETFile, gchar *filename_utf8)
-{
- ET_File_Description *ETFileDescription;
- gchar *basename;
- gint exceed_size;
-
-
- if (!ETFile || !filename_utf8) return;
-
- basename = g_path_get_basename(filename_utf8); // If it contains directories...
-
- ETFileDescription = ETFile->ETFileDescription;
- switch (ETFileDescription->FileType)
- {
-#ifdef ENABLE_OGG
- case OGG_FILE:
- if ( (exceed_size = (strlen(basename) - 245)) > 0 ) // 255 - 4 (extension) - 6 (mkstemp)
- {
- Log_Print(LOG_ERROR,_("The filename '%s' exceeds %d characters and will be truncated"), filename_utf8, 245);
- filename_utf8[strlen(filename_utf8) - exceed_size] = '\0';
- }
- break;
-#endif
- default:
- if ( (exceed_size = (strlen(basename) - 251)) > 0 ) // 255 - 4 (extension)
- {
- Log_Print(LOG_ERROR,_("The filename '%s' exceeds %d characters and will be truncated"), filename_utf8, 251);
- filename_utf8[strlen(filename_utf8) - exceed_size] = '\0';
- }
- break;
- }
- g_free(basename);
-}
-
-
-/*
* Used to replace the illegal characters in the filename
* Paremeter 'filename' musn't contain the path, else directories separators would be replaced!
*/
@@ -4753,189 +4711,3 @@ guint ET_Get_Number_Of_Files_In_Directory (gchar *path_utf8)
return count;
}
-
-
-/***********************
- * Debugging functions *
- ***********************/
-
-void ET_Debug_Print_File (ET_File *ETFile, gchar *file, gint line, gchar *function)
-{
- GList *etfilelist = NULL;
-
- if (ETFile)
- etfilelist = g_list_append(etfilelist,ETFile);
- ET_Debug_Print_File_List(etfilelist,file,line,function);
- g_list_free(etfilelist);
-}
-
-
-/*
- * Functions for DEBUGGING ONLY
- * ET_Print_File_List => show list of filename
- * Parameters: ETFileList : the list of files to display
- * file = __FILE__
- * line = __LINE__
- * function = __FUNCTION__
- */
-void ET_Debug_Print_File_List (GList *ETFileList, gchar *file, gint line, gchar *function)
-{
- gint efl_item = 1;
- gint fnl_item = 1;
- gint ftl_item = 1;
- gint etfilelist_length;
- gint filenamelist_length;
- gint filetaglist_length;
- GList *etfilelist;
- GList *filenamelist;
- GList *filetaglist;
- char str[50];
- struct tm *tms;
-
-
- g_print("\n#### File list from %s:%d - start ####\n",file,line);
- g_print("#### Function : %s ####\n",function);
- if (ETFileList)
- etfilelist = g_list_first(ETFileList);
- else
- etfilelist = g_list_first(ETCore->ETFileList);
- etfilelist_length = g_list_length(etfilelist);
- while (etfilelist)
- {
- time_t time = ((ET_File *)etfilelist->data)->FileModificationTime;
- tms = localtime(&time);
- strftime(str,sizeof(str),"%Y.%m.%d %X",tms); // Time without date in current locale
-
- g_print("#> ETFile %d/%d (%p)\n",efl_item,etfilelist_length,(ET_File *)etfilelist->data);
- g_print("|--- IndexKey : '%d'\n",((ET_File *)etfilelist->data)->IndexKey);
- g_print("|--- time : '%s'\n", (char *)str);
- g_print("|--- file_cur : '%s'\n",((File_Name *)((ET_File *)etfilelist->data)->FileNameCur->data)->value_utf8);
- g_print("|--- file_new : '%s'\n",((File_Name *)((ET_File *)etfilelist->data)->FileNameNew->data)->value_utf8);
- g_print("|--- saved : '%d'\n",((File_Name *)((ET_File *)etfilelist->data)->FileNameNew->data)->saved);
-
- filenamelist = g_list_first( ((ET_File *)etfilelist->data)->FileNameList );
- filenamelist_length = g_list_length(filenamelist);
- fnl_item = 1;
- while (filenamelist)
- {
- g_print("|--> File_Name : %d/%d %s\n",fnl_item,filenamelist_length,(filenamelist==((ET_File *)etfilelist->data)->FileNameNew)?"<<CURRENT>>":"");
- g_print("| |-> key : '%d'\n",((File_Name *)filenamelist->data)->key);
- g_print("| |-> filename: '%s'\n",((File_Name *)filenamelist->data)->value_utf8);
-
- filenamelist = filenamelist->next;
- fnl_item++;
- }
-
- g_print("|\n");
-
- filetaglist = g_list_first( ((ET_File *)etfilelist->data)->FileTagList );
- filetaglist_length = g_list_length(filetaglist);
- ftl_item = 1;
- while (filetaglist)
- {
- g_print("|--> File_Tag : %d/%d %s\n",ftl_item,filetaglist_length,(filetaglist==((ET_File *)etfilelist->data)->FileTag)?"<<CURRENT>>":"");
- g_print("| |-> key : '%d'\n",((File_Tag *)filetaglist->data)->key);
- g_print("| |-> saved : '%d'\n",((File_Tag *)filetaglist->data)->saved);
- g_print("| |-> title : '%s'\n",((File_Tag *)filetaglist->data)->title ? ((File_Tag *)filetaglist->data)->title : "");
- g_print("| |-> artist : '%s'\n",((File_Tag *)filetaglist->data)->artist ? ((File_Tag *)filetaglist->data)->artist : "");
- g_print("| |-> album_artist: '%s'\n",((File_Tag *)filetaglist->data)->album_artist? ((File_Tag *)filetaglist->data)->album_artist : "");
- g_print("| |-> album : '%s'\n",((File_Tag *)filetaglist->data)->album ? ((File_Tag *)filetaglist->data)->album : "");
- g_print("| |-> disc_number : '%s'\n",((File_Tag *)filetaglist->data)->disc_number ? ((File_Tag *)filetaglist->data)->disc_number : "");
- g_print("| |-> year : '%s'\n",((File_Tag *)filetaglist->data)->year ? ((File_Tag *)filetaglist->data)->year : "");
- g_print("| |-> track : '%s'\n",((File_Tag *)filetaglist->data)->track ? ((File_Tag *)filetaglist->data)->track : "");
- g_print("| |-> track_total : '%s'\n",((File_Tag *)filetaglist->data)->track_total ? ((File_Tag *)filetaglist->data)->track_total : "");
- g_print("| |-> genre : '%s'\n",((File_Tag *)filetaglist->data)->genre ? ((File_Tag *)filetaglist->data)->genre : "");
- g_print("| |-> comment : '%s'\n",((File_Tag *)filetaglist->data)->comment ? ((File_Tag *)filetaglist->data)->comment : "");
- g_print("| |-> composer : '%s'\n",((File_Tag *)filetaglist->data)->composer ? ((File_Tag *)filetaglist->data)->composer : "");
- g_print("| |-> orig_artist : '%s'\n",((File_Tag *)filetaglist->data)->orig_artist ? ((File_Tag *)filetaglist->data)->orig_artist : "");
- g_print("| |-> copyright : '%s'\n",((File_Tag *)filetaglist->data)->copyright ? ((File_Tag *)filetaglist->data)->copyright : "");
- g_print("| |-> url : '%s'\n",((File_Tag *)filetaglist->data)->url ? ((File_Tag *)filetaglist->data)->url : "");
- g_print("| |-> encoded_by : '%s'\n",((File_Tag *)filetaglist->data)->encoded_by ? ((File_Tag *)filetaglist->data)->encoded_by : "");
-
- filetaglist = filetaglist->next;
- ftl_item++;
- }
-
- g_print("|\n");
-
- etfilelist = etfilelist->next;
- efl_item++;
- }
- g_print("#### File list from %s:%d - end ####\n",file,line);
-}
-
-// Ex : ET_Debug_Print_Artist_Album_List(__FILE__,__LINE__,__FUNCTION__);
-void ET_Debug_Print_Artist_Album_List (gchar *file, gint line, gchar *function)
-{
- GList *ArtistList;
- GList *AlbumList;
- GList *etfilelist;
- ET_File *etfile;
- gint artist_item;
- gint artist_length;
- gint album_item;
- gint album_length;
- gint etfile_item;
- gint etfile_length;
-
- g_print("\n#### Artist Album list from %s:%d - start ####\n",file,line);
- g_print("#### Function : %s ####\n",function);
- ArtistList = g_list_first(ETCore->ETArtistAlbumFileList);
- artist_length = g_list_length(ArtistList);
- artist_item = 1;
- while (ArtistList)
- {
- g_print("#> Artist %d/%d \n",artist_item,artist_length);
- AlbumList = g_list_first((GList *)ArtistList->data);
- album_length = g_list_length(AlbumList);
- album_item = 1;
- while (AlbumList)
- {
- g_print(" |-> Album %d/%d \n",album_item,album_length);
- etfilelist = g_list_first((GList *)AlbumList->data);
- etfile_length = g_list_length(etfilelist);
- etfile_item = 1;
- while (etfilelist)
- {
- etfile = (ET_File *)etfilelist->data;
- g_print(" | |-> ETFile %d/%d (%p)\n",etfile_item,etfile_length,etfile);
- g_print(" | | |-> file : '%s'\n",((File_Name *)etfile->FileNameCur->data)->value_utf8);
- g_print(" | | |-> artist : '%s'\n",((File_Tag *)etfile->FileTag->data)->artist ? ((File_Tag *)etfile->FileTag->data)->artist : "");
- g_print(" | | |-> album : '%s'\n",((File_Tag *)etfile->FileTag->data)->album ? ((File_Tag *)etfile->FileTag->data)->album : "");
-
- etfilelist = etfilelist->next;
- etfile_item++;
- }
-
- AlbumList = AlbumList->next;
- album_item++;
- }
-
- ArtistList = ArtistList->next;
- artist_item++;
- }
- g_print("#### Artist Album list from %s:%d - end ####\n",file,line);
-}
-
-
-#include "time.h"
-void ET_Debug_Print_Time (gchar *msg)
-{
- struct tm *tms;
- time_t nowtime;
- char str[50];
- //char *pstr = str;
-
- nowtime = time(NULL);
- tms = localtime(&nowtime);
- strftime(str,sizeof(str),"%X",tms); // Time without date in current locale
- //strftime(str,sizeof(str),"%x",ptr); // Date without time in current locale
-
- if (msg)
- {
- g_print("## %s %s ##\n",msg,str);
- }else
- {
- g_print("## %s ##\n",str);
- }
-}
diff --git a/src/et_core.h b/src/et_core.h
index 0f40a3a..563e512 100644
--- a/src/et_core.h
+++ b/src/et_core.h
@@ -362,27 +362,21 @@ GList *ET_Add_File_To_File_List (gchar *filename);
gboolean ET_Remove_File_From_File_List (ET_File *ETFile);
gboolean ET_Create_Artist_Album_File_List (void);
-gboolean ET_Add_File_To_Artist_Album_File_List (ET_File *ETFile);
gboolean ET_Remove_File_From_File_List (ET_File *ETFile);
gboolean ET_Check_If_File_Is_Saved (ET_File *ETFile);
gboolean ET_Check_If_All_Files_Are_Saved (void);
-//gboolean ET_Free_File_List (void);
-gboolean ET_Free_History_File_List (void);
-gboolean ET_Free_Displayed_File_List (void);
-
ET_File *ET_File_Item_New (void);
File_Name *ET_File_Name_Item_New (void);
File_Tag *ET_File_Tag_Item_New (void);
-ET_File_Info *ET_File_Info_Item_New (void);
gboolean ET_Free_File_Tag_Item (File_Tag *FileTag);
gboolean ET_Free_File_List_Item (ET_File *ETFile);
gboolean ET_Copy_File_Tag_Item (ET_File *ETFile, File_Tag *FileTag);
gboolean ET_Set_Field_File_Name_Item (gchar **FileNameField, gchar *value);
gboolean ET_Set_Filename_File_Name_Item (File_Name *FileName, gchar *filename_utf8, gchar *filename);
-gboolean ET_Set_Field_File_Tag_Item (gchar **FileTagField, gchar *value);
+gboolean ET_Set_Field_File_Tag_Item (gchar **FileTagField, const gchar *value);
gboolean ET_Set_Field_File_Tag_Picture (Picture **FileTagField, Picture *pic);
GList *ET_Displayed_File_List_First (void);
@@ -390,9 +384,6 @@ GList *ET_Displayed_File_List_Previous (void);
GList *ET_Displayed_File_List_Next (void);
GList *ET_Displayed_File_List_Last (void);
GList *ET_Displayed_File_List_By_Etfile (ET_File *ETFile);
-GList *ET_Displayed_File_List_By_Position (gulong pos_in_list);
-guint ET_Displayed_File_List_Get_Length (void);
-//GList *ET_Displayed_File_List_Current (void);
gboolean ET_Set_Displayed_File_List (GList *ETFileList);
@@ -414,14 +405,12 @@ gboolean ET_Manage_Changes_Of_File_Data (ET_File *ETFile, File_Name *Fi
void ET_Mark_File_Name_As_Saved (ET_File *ETFile);
void ET_Update_Directory_Name_Into_File_List (gchar* last_path, gchar *new_path);
gboolean ET_File_Name_Convert_Character (gchar *filename_utf8);
-gchar *ET_File_Name_Format_Extension (ET_File *ETFile);
gchar *ET_File_Name_Generate (ET_File *ETFile, gchar *new_file_name);
guint ET_Get_Number_Of_Files_In_Directory (gchar *path_utf8);
gboolean ET_Detect_Changes_Of_File_Tag (File_Tag *FileTag1, File_Tag *FileTag2);
GList *ET_Sort_File_List (GList *ETFileList, ET_Sorting_Type Sorting_Type);
-void ET_Sort_Displayed_File_List (ET_Sorting_Type Sorting_Type);
void ET_Sort_Displayed_File_List_And_Update_UI (ET_Sorting_Type Sorting_Type);
gint ET_Comp_Func_Sort_File_By_Ascending_Filename (ET_File *ETFile1, ET_File *ETFile2);
gint ET_Comp_Func_Sort_File_By_Descending_Filename (ET_File *ETFile1, ET_File *ETFile2);
@@ -466,11 +455,4 @@ gint ET_Comp_Func_Sort_File_By_Ascending_File_Samplerate (ET_File *ETFile1, ET_
gint ET_Comp_Func_Sort_File_By_Descending_File_Samplerate (ET_File *ETFile1, ET_File *ETFile2);
-/* Functions for debugging */
-void ET_Debug_Print_File (ET_File *ETFile, gchar *file, gint line, gchar *function);
-void ET_Debug_Print_File_List (GList *ETFileList, gchar *file, gint line, gchar *function);
-void ET_Debug_Print_Artist_Album_List (gchar *file, gint line, gchar *function);
-void ET_Debug_Print_Time (gchar *msg);
-
-
#endif /* __ET_CORE_H__ */
diff --git a/src/log.c b/src/log.c
index 5e2deda..11f2a3a 100644
--- a/src/log.c
+++ b/src/log.c
@@ -75,11 +75,12 @@ struct _Log_Data
/**************
* Prototypes *
**************/
-gboolean Log_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event);
-void Log_List_Set_Row_Visible (GtkTreeModel *treeModel, GtkTreeIter *rowIter);
-void Log_Print_Tmp_List (void);
-gchar *Log_Format_Date (void);
-gchar *Log_Get_Stock_Id_From_Error_Type (Log_Error_Type error_type);
+static gboolean Log_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event);
+static void Log_List_Set_Row_Visible (GtkTreeModel *treeModel,
+ GtkTreeIter *rowIter);
+static void Log_Print_Tmp_List (void);
+static gchar *Log_Format_Date (void);
+static gchar *Log_Get_Stock_Id_From_Error_Type (Log_Error_Type error_type);
@@ -169,7 +170,8 @@ GtkWidget *Create_Log_Area (void)
/*
* Log_Popup_Menu_Handler : displays the corresponding menu
*/
-gboolean Log_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
+static gboolean
+Log_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
{
if (event && (event->type==GDK_BUTTON_PRESS) && (event->button == 3))
{
@@ -183,7 +185,8 @@ gboolean Log_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
/*
* Set a row visible in the log list (by scrolling the list)
*/
-void Log_List_Set_Row_Visible (GtkTreeModel *treeModel, GtkTreeIter *rowIter)
+static void
+Log_List_Set_Row_Visible (GtkTreeModel *treeModel, GtkTreeIter *rowIter)
{
/*
* TODO: Make this only scroll to the row if it is not visible
@@ -216,7 +219,8 @@ void Log_Clean_Log_List (void)
/*
* Return time in allocated data
*/
-gchar *Log_Format_Date (void)
+static gchar *
+Log_Format_Date (void)
{
struct tm *tms;
time_t nowtime;
@@ -335,7 +339,8 @@ void Log_Print (Log_Error_Type error_type, gchar const *format, ...)
/*
* Display pending messages in the LogList
*/
-void Log_Print_Tmp_List (void)
+static void
+Log_Print_Tmp_List (void)
{
GtkTreeIter iter;
@@ -381,7 +386,8 @@ void Log_Print_Tmp_List (void)
}
-gchar *Log_Get_Stock_Id_From_Error_Type (Log_Error_Type error_type)
+static gchar *
+Log_Get_Stock_Id_From_Error_Type (Log_Error_Type error_type)
{
gchar *stock_id;
diff --git a/src/misc.c b/src/misc.c
index 3e67bd4..b0feb90 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -150,40 +150,49 @@ enum
* Prototypes *
**************/
void Open_Write_Playlist_Window (void);
-gboolean Write_Playlist_Window_Key_Press (GtkWidget *window, GdkEvent *event);
-void Destroy_Write_Playlist_Window (void);
-void Playlist_Write_Button_Pressed (void);
-gboolean Write_Playlist (gchar *play_list_name);
-gboolean Playlist_Check_Content_Mask (GtkWidget *widget_to_show_hide, GtkEntry *widget_source);
-void Playlist_Convert_Forwardslash_Into_Backslash (gchar *string);
+static gboolean Write_Playlist_Window_Key_Press (GtkWidget *window,
+ GdkEvent *event);
+static void Destroy_Write_Playlist_Window (void);
+static void Playlist_Write_Button_Pressed (void);
+static gboolean Write_Playlist (const gchar *play_list_name);
+static gboolean Playlist_Check_Content_Mask (GtkWidget *widget_to_show_hide,
+ GtkEntry *widget_source);
+static void Playlist_Convert_Forwardslash_Into_Backslash (const gchar *string);
void Open_Search_File_Window (void);
-void Destroy_Search_File_Window (void);
-gboolean Search_File_Window_Key_Press (GtkWidget *window, GdkEvent *event);
-void Search_File (GtkWidget *search_button);
-void Add_Row_To_Search_Result_List (ET_File *ETFile,const gchar *string_to_search);
-void Search_Result_List_Row_Selected (GtkTreeSelection* selection, gpointer data);
+static void Destroy_Search_File_Window (void);
+static gboolean Search_File_Window_Key_Press (GtkWidget *window,
+ GdkEvent *event);
+static void Search_File (GtkWidget *search_button);
+static void Add_Row_To_Search_Result_List (ET_File *ETFile,
+ const gchar *string_to_search);
+static void Search_Result_List_Row_Selected (GtkTreeSelection* selection,
+ gpointer data);
void Open_Load_Filename_Window (void);
-void Destroy_Load_Filename_Window (void);
-gboolean Load_Filename_Window_Key_Press (GtkWidget *window, GdkEvent *event);
-void Load_Filename_List_Key_Press (GtkWidget *clist, GdkEvent *event);
-void Load_File_Content (GtkWidget *file_entry);
-void Load_File_List (void);
-void Load_Filename_Select_Row_In_Other_List (GtkWidget *target, gpointer selection_emit);
-void Load_Filename_Set_Filenames (void);
-void Button_Load_Set_Sensivity (GtkWidget *button, GtkWidget *entry);
-GtkWidget *Create_Load_Filename_Popup_Menu (GtkWidget *list);
-void Load_Filename_List_Insert_Blank_Line (GtkWidget *list);
-void Load_Filename_List_Delete_Line (GtkWidget *list);
-void Load_Filename_List_Move_Up (GtkWidget *list);
-void Load_Filename_List_Move_Down (GtkWidget *list);
-void Load_Filename_List_Delete_All_Blank_Lines (GtkWidget *list);
-void Load_Filename_List_Reload (GtkWidget *list);
-void Load_Filename_Update_Text_Line (GtkWidget *entry, GtkWidget *list);
-void Load_Filename_Edit_Text_Line (GtkTreeSelection *selection, gpointer data);
-
-void Create_Xpm_Icon_Factory (const char **xpm_data, const char *name_in_factory);
+static void Destroy_Load_Filename_Window (void);
+static gboolean Load_Filename_Window_Key_Press (GtkWidget *window,
+ GdkEvent *event);
+static void Load_Filename_List_Key_Press (GtkWidget *clist, GdkEvent *event);
+static void Load_File_Content (GtkWidget *file_entry);
+static void Load_File_List (void);
+static void Load_Filename_Select_Row_In_Other_List (GtkWidget *target,
+ gpointer selection_emit);
+static void Load_Filename_Set_Filenames (void);
+static void Button_Load_Set_Sensivity (GtkWidget *button, GtkWidget *entry);
+static GtkWidget *Create_Load_Filename_Popup_Menu (GtkWidget *list);
+static void Load_Filename_List_Insert_Blank_Line (GtkWidget *list);
+static void Load_Filename_List_Delete_Line (GtkWidget *list);
+static void Load_Filename_List_Move_Up (GtkWidget *list);
+static void Load_Filename_List_Move_Down (GtkWidget *list);
+static void Load_Filename_List_Delete_All_Blank_Lines (GtkWidget *list);
+static void Load_Filename_List_Reload (GtkWidget *list);
+static void Load_Filename_Update_Text_Line (GtkWidget *entry, GtkWidget *list);
+static void Load_Filename_Edit_Text_Line (GtkTreeSelection *selection,
+ gpointer data);
+
+static void Create_Xpm_Icon_Factory (const char **xpm_data,
+ const char *name_in_factory);
void Create_Png_Icon_Factory (const char *png_file, const char *name_in_factory);
/* Browser */
@@ -559,7 +568,8 @@ void Init_Mouse_Cursor (void)
MouseCursor = NULL;
}
-void Destroy_Mouse_Cursor (void)
+static void
+Destroy_Mouse_Cursor (void)
{
if (MouseCursor)
{
@@ -637,7 +647,8 @@ void Init_Custom_Icons (void)
* Create an icon factory from the specified pixmap
* Also add it to the GTK stock images
*/
-void Create_Xpm_Icon_Factory (const char **xpm_data, const char *name_in_factory)
+static void
+Create_Xpm_Icon_Factory (const char **xpm_data, const char *name_in_factory)
{
GtkIconSet *icon;
GtkIconFactory *factory;
@@ -823,7 +834,8 @@ static void Open_File_Selection_Window (GtkWidget *entry, gchar *title, GtkFileC
/*
* Run the audio player and load files of the current dir
*/
-void Run_Audio_Player_Using_File_List (GList *etfilelist_init)
+static void
+Run_Audio_Player_Using_File_List (GList *etfilelist_init)
{
gchar **argv;
gint argv_index = 0;
@@ -1178,7 +1190,8 @@ gchar *Convert_Duration (gulong duration)
/*
* Returns the size of a file in bytes
*/
-gulong Get_File_Size(gchar *filename)
+gulong
+Get_File_Size (const gchar *filename)
{
struct stat statbuf;
@@ -1429,7 +1442,8 @@ void Open_Write_Playlist_Window (void)
g_signal_emit_by_name(G_OBJECT(gtk_bin_get_child(GTK_BIN(PlayListContentMaskCombo))),"changed");
}
-void Destroy_Write_Playlist_Window (void)
+static void
+Destroy_Write_Playlist_Window (void)
{
if (WritePlaylistWindow)
{
@@ -1506,7 +1520,8 @@ gboolean Write_Playlist_Window_Key_Press (GtkWidget *window, GdkEvent *event)
return FALSE;
}
-void Playlist_Write_Button_Pressed (void)
+static void
+Playlist_Write_Button_Pressed (void)
{
gchar *playlist_name = NULL;
gchar *playlist_path_utf8; // Path
@@ -1684,7 +1699,9 @@ void Playlist_Write_Button_Pressed (void)
g_free(playlist_name);
}
-gboolean Playlist_Check_Content_Mask (GtkWidget *widget_to_show_hide, GtkEntry *widget_source)
+static gboolean
+Playlist_Check_Content_Mask (GtkWidget *widget_to_show_hide,
+ GtkEntry *widget_source)
{
gchar *tmp = NULL;
gchar *mask = NULL;
@@ -1731,7 +1748,8 @@ gboolean Playlist_Check_Content_Mask (GtkWidget *widget_to_show_hide, GtkEntry *
/*
* Function to replace UNIX ForwardSlash with a DOS BackSlash
*/
-void Playlist_Convert_Forwardslash_Into_Backslash (gchar *string)
+static void
+Playlist_Convert_Forwardslash_Into_Backslash (const gchar *string)
{
gchar *tmp;
@@ -1744,7 +1762,8 @@ void Playlist_Convert_Forwardslash_Into_Backslash (gchar *string)
* Write a playlist
* - 'playlist_name' in file system encoding (not UTF-8)
*/
-gboolean Write_Playlist (gchar *playlist_name)
+static gboolean
+Write_Playlist (const gchar *playlist_name)
{
FILE *file;
ET_File *etfile;
@@ -2229,7 +2248,8 @@ void Open_Search_File_Window (void)
// gtk_window_set_position(GTK_WINDOW(SearchFileWindow), GTK_WIN_POS_CENTER_ON_PARENT); // Must use gtk_window_set_transient_for to work
}
-void Destroy_Search_File_Window (void)
+static void
+Destroy_Search_File_Window (void)
{
if (SearchFileWindow)
{
@@ -2273,7 +2293,8 @@ void Search_File_Window_Apply_Changes (void)
}
}
-gboolean Search_File_Window_Key_Press (GtkWidget *window, GdkEvent *event)
+static gboolean
+Search_File_Window_Key_Press (GtkWidget *window, GdkEvent *event)
{
GdkEventKey *kevent;
@@ -2294,7 +2315,8 @@ gboolean Search_File_Window_Key_Press (GtkWidget *window, GdkEvent *event)
* This function and the one below could do with improving
* as we are looking up tag data twice (once when searching, once when adding to list)
*/
-void Search_File (GtkWidget *search_button)
+static void
+Search_File (GtkWidget *search_button)
{
const gchar *string_to_search = NULL;
GList *etfilelist;
@@ -2461,7 +2483,8 @@ void Search_File (GtkWidget *search_button)
}
}
-void Add_Row_To_Search_Result_List(ET_File *ETFile,const gchar *string_to_search)
+static void
+Add_Row_To_Search_Result_List (ET_File *ETFile, const gchar *string_to_search)
{
gchar *SearchResultList_Text[15]; // Because : 15 columns to display
gint SearchResultList_Weight[15] = {PANGO_WEIGHT_NORMAL, PANGO_WEIGHT_NORMAL,
@@ -2647,7 +2670,8 @@ void Add_Row_To_Search_Result_List(ET_File *ETFile,const gchar *string_to_search
* Callback to select-row event
* Select all results that are selected in the search result list also in the browser list
*/
-void Search_Result_List_Row_Selected(GtkTreeSelection *selection, gpointer data)
+static void
+Search_Result_List_Row_Selected (GtkTreeSelection *selection, gpointer data)
{
GList *selectedRows;
GList *selectedRowsCopy;
@@ -3032,7 +3056,8 @@ void Open_Load_Filename_Window (void)
gtk_window_move(GTK_WINDOW(LoadFilenameWindow),LOAD_FILE_WINDOW_X,LOAD_FILE_WINDOW_Y);
}
-void Destroy_Load_Filename_Window (void)
+static void
+Destroy_Load_Filename_Window (void)
{
if (LoadFilenameWindow)
{
@@ -3074,7 +3099,8 @@ void Load_Filename_Window_Apply_Changes (void)
}
}
-gboolean Load_Filename_Window_Key_Press (GtkWidget *window, GdkEvent *event)
+static gboolean
+Load_Filename_Window_Key_Press (GtkWidget *window, GdkEvent *event)
{
GdkEventKey *kevent;
@@ -3094,7 +3120,8 @@ gboolean Load_Filename_Window_Key_Press (GtkWidget *window, GdkEvent *event)
/*
* To enable/disable sensivity of the button 'Load'
*/
-void Button_Load_Set_Sensivity (GtkWidget *button, GtkWidget *entry)
+static void
+Button_Load_Set_Sensivity (GtkWidget *button, GtkWidget *entry)
{
struct stat statbuf;
gchar *path;
@@ -3111,7 +3138,8 @@ void Button_Load_Set_Sensivity (GtkWidget *button, GtkWidget *entry)
g_free(path);
}
-void Load_Filename_List_Key_Press (GtkWidget *treeview, GdkEvent *event)
+static void
+Load_Filename_List_Key_Press (GtkWidget *treeview, GdkEvent *event)
{
if (event && event->type == GDK_KEY_PRESS)
{
@@ -3133,7 +3161,8 @@ void Load_Filename_List_Key_Press (GtkWidget *treeview, GdkEvent *event)
/*
* Load content of the file into the LoadFileContentList list
*/
-void Load_File_Content (GtkWidget *entry)
+static void
+Load_File_Content (GtkWidget *entry)
{
FILE *file;
gchar *filename;
@@ -3190,7 +3219,8 @@ void Load_File_Content (GtkWidget *entry)
/*
* Load the names of the current list of files
*/
-void Load_File_List (void)
+static void
+Load_File_List (void)
{
GList *etfilelist;
ET_File *etfile;
@@ -3219,7 +3249,8 @@ void Load_File_List (void)
/*
* To select the corresponding row in the other list
*/
-void Load_Filename_Select_Row_In_Other_List(GtkWidget* treeview_target, gpointer origselection)
+static void
+Load_Filename_Select_Row_In_Other_List (GtkWidget* treeview_target, gpointer origselection)
{
GtkAdjustment *ct_adj, *ce_adj;
GtkTreeSelection *selection_orig;
@@ -3292,7 +3323,8 @@ void Load_Filename_Select_Row_In_Other_List(GtkWidget* treeview_target, gpointer
* Set the new file name of each file.
* Associate lines from LoadFileContentList with LoadFileNameList
*/
-void Load_Filename_Set_Filenames (void)
+static void
+Load_Filename_Set_Filenames (void)
{
gint row;
ET_File *ETFile;
@@ -3379,7 +3411,8 @@ Load_Filename_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
return FALSE;
}
-GtkWidget *Create_Load_Filename_Popup_Menu(GtkWidget *list)
+static GtkWidget *
+Create_Load_Filename_Popup_Menu (GtkWidget *list)
{
GtkWidget *BrowserPopupMenu;
GtkWidget *Image;
@@ -3439,7 +3472,8 @@ GtkWidget *Create_Load_Filename_Popup_Menu(GtkWidget *list)
/*
* Insert a blank line before the selected line in the treeview passed as parameter
*/
-void Load_Filename_List_Insert_Blank_Line (GtkWidget *treeview)
+static void
+Load_Filename_List_Insert_Blank_Line (GtkWidget *treeview)
{
GtkTreeSelection *selection;
GtkTreeIter selectedIter;
@@ -3460,7 +3494,8 @@ void Load_Filename_List_Insert_Blank_Line (GtkWidget *treeview)
/*
* Delete all blank lines in the treeview passed as parameter
*/
-void Load_Filename_List_Delete_All_Blank_Lines (GtkWidget *treeview)
+static void
+Load_Filename_List_Delete_All_Blank_Lines (GtkWidget *treeview)
{
gchar *text = NULL;
GtkTreeIter iter;
@@ -3495,7 +3530,8 @@ void Load_Filename_List_Delete_All_Blank_Lines (GtkWidget *treeview)
/*
* Delete the selected line in the treeview passed as parameter
*/
-void Load_Filename_List_Delete_Line (GtkWidget *treeview)
+static void
+Load_Filename_List_Delete_Line (GtkWidget *treeview)
{
GtkTreeSelection *selection;
GtkTreeIter selectedIter, itercopy;
@@ -3525,7 +3561,8 @@ void Load_Filename_List_Delete_Line (GtkWidget *treeview)
/*
* Move up the selected line in the treeview passed as parameter
*/
-void Load_Filename_List_Move_Up (GtkWidget *treeview)
+static void
+Load_Filename_List_Move_Up (GtkWidget *treeview)
{
GtkTreeSelection *selection;
GList *selectedRows;
@@ -3578,7 +3615,8 @@ void Load_Filename_List_Move_Up (GtkWidget *treeview)
/*
* Move down the selected line in the treeview passed as parameter
*/
-void Load_Filename_List_Move_Down (GtkWidget *treeview)
+static void
+Load_Filename_List_Move_Down (GtkWidget *treeview)
{
GtkTreeSelection *selection;
GList *selectedRows;
@@ -3629,7 +3667,8 @@ void Load_Filename_List_Move_Down (GtkWidget *treeview)
* Reload a list of choice
* The list parameter refers to a GtkTreeView (LoadFileNameList or LoadFileContentList)
*/
-void Load_Filename_List_Reload (GtkWidget *treeview)
+static void
+Load_Filename_List_Reload (GtkWidget *treeview)
{
if (!treeview) return;
@@ -3646,7 +3685,8 @@ void Load_Filename_List_Reload (GtkWidget *treeview)
/*
* Update the text of the selected line into the list, with the text entered into the entry
*/
-void Load_Filename_Update_Text_Line(GtkWidget *entry, GtkWidget *list)
+static void
+Load_Filename_Update_Text_Line(GtkWidget *entry, GtkWidget *list)
{
GtkTreeIter SelectedRow;
GtkTreeSelection *selection;
@@ -3667,7 +3707,8 @@ void Load_Filename_Update_Text_Line(GtkWidget *entry, GtkWidget *list)
/*
* Set the text of the selected line of the list into the entry
*/
-void Load_Filename_Edit_Text_Line(GtkTreeSelection *selection, gpointer data)
+static void
+Load_Filename_Edit_Text_Line(GtkTreeSelection *selection, gpointer data)
{
gchar *text;
GtkTreeIter selectedIter;
diff --git a/src/misc.h b/src/misc.h
index d7bfa69..99c7b9d 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -82,12 +82,10 @@ gchar *Check_If_Executable_Exists (const gchar *program);
// Mouse cursor
void Init_Mouse_Cursor (void);
-void Destroy_Mouse_Cursor (void);
void Set_Busy_Cursor (void);
void Set_Unbusy_Cursor (void);
// Run Audio Player
-void Run_Audio_Player_Using_File_List (GList *etfilelist);
void Run_Audio_Player_Using_Directory (void);
void Run_Audio_Player_Using_Selection (void);
void Run_Audio_Player_Using_Browser_Artist_List (void);
@@ -97,7 +95,7 @@ gchar *Convert_Size (gfloat size);
gchar *Convert_Size_1 (gfloat size);
gchar *Convert_Duration (gulong duration);
-gulong Get_File_Size (gchar *filename);
+gulong Get_File_Size (const gchar *filename);
void Strip_String (gchar *string);
gint Combo_Alphabetic_Sort (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data);
diff --git a/src/ogg_tag.c b/src/ogg_tag.c
index 305152d..e11220c 100644
--- a/src/ogg_tag.c
+++ b/src/ogg_tag.c
@@ -108,7 +108,7 @@
/**************
* Prototypes *
**************/
-gboolean Ogg_Tag_Write_File (FILE *file_in, gchar *filename_in, vcedit_state *state);
+static gboolean Ogg_Tag_Write_File (FILE *file_in, gchar *filename_in, vcedit_state *state);
static gboolean Ogg_Write_Delimetered_Tag (vorbis_comment *vc, const gchar *tag_name, gchar *values);
static gboolean Ogg_Write_Tag (vorbis_comment *vc, const gchar *tag_name, gchar *value);
@@ -866,7 +866,8 @@ gboolean Ogg_Tag_Write_File_Tag (ET_File *ETFile)
/*
* Write tag information to a new temporary file, and rename it the the initial name.
*/
-gboolean Ogg_Tag_Write_File (FILE *file_in, gchar *filename_in, vcedit_state *state)
+static gboolean
+Ogg_Tag_Write_File (FILE *file_in, gchar *filename_in, vcedit_state *state)
{
gchar *filename_out;
gint file_mkstemp;
diff --git a/src/picture.c b/src/picture.c
index 36bc033..aa4facc 100644
--- a/src/picture.c
+++ b/src/picture.c
@@ -58,7 +58,7 @@ void Tag_Area_Picture_Drag_Data (GtkWidget *widget, GdkDragContext *dc,
gint x, gint y, GtkSelectionData *selection_data,
guint info, guint t, gpointer data);
void Picture_Selection_Changed_cb (GtkTreeSelection *selection, gpointer data);
-void Picture_Load_Filename (gchar *filename, gpointer user_data);
+static void Picture_Load_Filename (gchar *filename, gpointer user_data);
void Picture_Add_Button_Clicked (GObject *object);
void Picture_Properties_Button_Clicked (GObject *object);
@@ -66,9 +66,9 @@ void Picture_Save_Button_Clicked (GObject *object);
void Picture_Clear_Button_Clicked (GObject *object);
Picture_Format Picture_Format_From_Data (Picture *pic);
-const gchar *Picture_Format_String (Picture_Format format);
-const gchar *Picture_Type_String (Picture_Type type);
-gchar *Picture_Info (Picture *pic);
+static const gchar *Picture_Format_String (Picture_Format format);
+static const gchar *Picture_Type_String (Picture_Type type);
+static gchar *Picture_Info (Picture *pic);
void PictureEntry_Clear (void);
void PictureEntry_Update (Picture *pic, gboolean select_it);
@@ -76,8 +76,9 @@ Picture *Picture_Allocate (void);
Picture *Picture_Copy_One (const Picture *pic);
Picture *Picture_Copy (const Picture *pic);
void Picture_Free (Picture *pic);
-Picture *Picture_Load_File_Data (const gchar *filename);
-gboolean Picture_Save_File_Data (const Picture *pic, const gchar *filename);
+static Picture *Picture_Load_File_Data (const gchar *filename);
+static gboolean Picture_Save_File_Data (const Picture *pic,
+ const gchar *filename);
gboolean Picture_Entry_View_Button_Pressed (GtkTreeView *treeview, GdkEventButton *event, gpointer data);
gboolean Picture_Entry_View_Key_Pressed (GtkTreeView *treeview, GdkEvent *event, gpointer data);
@@ -199,7 +200,8 @@ void Picture_Clear_Button_Clicked (GObject *object)
/*
* - 'filename' : path + filename of picture file
*/
-void Picture_Load_Filename (gchar *filename, gpointer user_data)
+static void
+Picture_Load_Filename (gchar *filename, gpointer user_data)
{
Picture *pic;
gchar *filename_utf8;
@@ -791,7 +793,8 @@ const gchar *Picture_Mime_Type_String (Picture_Format format)
}
-const gchar *Picture_Format_String (Picture_Format format)
+static const gchar *
+Picture_Format_String (Picture_Format format)
{
switch (format)
{
@@ -804,7 +807,8 @@ const gchar *Picture_Format_String (Picture_Format format)
}
}
-const gchar *Picture_Type_String (Picture_Type type)
+static const gchar *
+Picture_Type_String (Picture_Type type)
{
switch (type)
{
@@ -857,7 +861,8 @@ const gchar *Picture_Type_String (Picture_Type type)
}
}
-gchar *Picture_Info (Picture *pic)
+static gchar *
+Picture_Info (Picture *pic)
{
const gchar *format, *desc, *type;
gchar *r, *size_str;
@@ -1090,9 +1095,11 @@ void Picture_Free (Picture *pic)
* file system encoding, not UTF-8)
*/
#ifdef WIN32
-Picture *Picture_Load_File_Data (const gchar *filename_utf8)
+static Picture *
+Picture_Load_File_Data (const gchar *filename_utf8)
#else
-Picture *Picture_Load_File_Data (const gchar *filename)
+static Picture *
+Picture_Load_File_Data (const gchar *filename)
#endif
{
Picture *pic;
@@ -1177,7 +1184,8 @@ Picture *Picture_Load_File_Data (const gchar *filename)
/*
* Save picture data to a file (jpeg, png)
*/
-gboolean Picture_Save_File_Data (const Picture *pic, const gchar *filename)
+static gboolean
+Picture_Save_File_Data (const Picture *pic, const gchar *filename)
{
gint fd;
diff --git a/src/prefs.c b/src/prefs.c
index bf158a9..5a3d12d 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -51,24 +51,24 @@
* Prototypes *
**************/
/* Options window */
-void OptionsWindow_Quit (void);
-void OptionsWindow_Apply_Button (void);
-void OptionsWindow_Save_Button (void);
-void OptionsWindow_Cancel_Button (void);
-gboolean OptionsWindow_Key_Press (GtkWidget *window, GdkEvent *event);
-static gboolean Check_Config (void);
+static void OptionsWindow_Quit (void);
+static void OptionsWindow_Save_Button (void);
+static void OptionsWindow_Cancel_Button (void);
+static gboolean OptionsWindow_Key_Press (GtkWidget *window, GdkEvent *event);
+static gboolean Check_Config (void);
-void Set_Default_Comment_Check_Button_Toggled (void);
-void Number_Track_Formated_Toggled (void);
-void Number_Track_Formated_Spin_Button_Changed (GtkWidget *Label, GtkWidget *SpinButton);
-void Change_Id3_Settings_Toggled (void);
-void File_Writing_Id3v2_Write_Tag_Toggled (void);
-void Use_Non_Standard_Id3_Reading_Character_Set_Toggled (void);
-void Scanner_Convert_Check_Button_Toggled_1 (GtkWidget *object_rec, GtkWidget *object_emi);
-void Cddb_Use_Proxy_Toggled (void);
+static void Set_Default_Comment_Check_Button_Toggled (void);
+static void Number_Track_Formatted_Toggled (void);
+static void Number_Track_Formatted_Spin_Button_Changed (GtkWidget *Label,
+ GtkWidget *SpinButton);
+static void Change_Id3_Settings_Toggled (void);
+static void Use_Non_Standard_Id3_Reading_Character_Set_Toggled (void);
+static void Scanner_Convert_Check_Button_Toggled_1 (GtkWidget *object_rec,
+ GtkWidget *object_emi);
+static void Cddb_Use_Proxy_Toggled (void);
-void DefaultPathToMp3_Combo_Add_String (void);
-void CddbLocalPath_Combo_Add_String (void);
+static void DefaultPathToMp3_Combo_Add_String (void);
+static void CddbLocalPath_Combo_Add_String (void);
@@ -430,9 +430,9 @@ void Open_OptionsWindow (void)
LogMaxLinesSpinButton = gtk_spin_button_new_with_range(10.0,1500.0,10.0);
gtk_box_pack_start(GTK_BOX(hbox),LogMaxLinesSpinButton,FALSE,FALSE,0);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(LogMaxLinesSpinButton),(gfloat)LOG_MAX_LINES);
- //g_signal_connect(G_OBJECT(NumberTrackFormated),"toggled",G_CALLBACK(Number_Track_Formated_Toggled),NULL);
- //g_signal_emit_by_name(G_OBJECT(NumberTrackFormated),"toggled");
-/* gtk_tooltips_set_tip(Tips,GTK_BIN(FilePlayerCombo)->child,_("Enter the program used to "
+ /* g_signal_connect(G_OBJECT(NumberTrackFormated),"toggled",G_CALLBACK(Number_Track_Formatted_Toggled),NULL);
+ * g_signal_emit_by_name(G_OBJECT(NumberTrackFormated),"toggled");
+ gtk_tooltips_set_tip(Tips,GTK_BIN(FilePlayerCombo)->child,_("Enter the program used to "
"play the files. Some arguments can be passed for the program (as 'xmms -p') before "
"to receive files as other arguments."),NULL);
*/
@@ -603,12 +603,12 @@ void Open_OptionsWindow (void)
NumberTrackFormatedSpinButton = gtk_spin_button_new_with_range(2.0,6.0,1.0);
gtk_box_pack_start(GTK_BOX(hbox),NumberTrackFormatedSpinButton,FALSE,FALSE,0);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(NumberTrackFormatedSpinButton),(gfloat)NUMBER_TRACK_FORMATED_SPIN_BUTTON);
- g_signal_connect(G_OBJECT(NumberTrackFormated),"toggled",G_CALLBACK(Number_Track_Formated_Toggled),NULL);
+ g_signal_connect(G_OBJECT(NumberTrackFormated),"toggled",G_CALLBACK(Number_Track_Formatted_Toggled),NULL);
g_signal_emit_by_name(G_OBJECT(NumberTrackFormated),"toggled");
Label = gtk_label_new(""); // Label to show the example
gtk_box_pack_start(GTK_BOX(hbox),Label,FALSE,FALSE,4);
- g_signal_connect_swapped(G_OBJECT(NumberTrackFormatedSpinButton),"changed",G_CALLBACK(Number_Track_Formated_Spin_Button_Changed),G_OBJECT(Label));
+ g_signal_connect_swapped(G_OBJECT(NumberTrackFormatedSpinButton),"changed",G_CALLBACK(Number_Track_Formatted_Spin_Button_Changed),G_OBJECT(Label));
g_signal_emit_by_name(G_OBJECT(NumberTrackFormatedSpinButton),"changed",NULL);
OggTagWriteXmmsComment = gtk_check_button_new_with_label(_("Ogg Vorbis Files: write also the comment in the XMMS format"));
@@ -1464,10 +1464,6 @@ void Open_OptionsWindow (void)
/* Apply Button */
Button = gtk_button_new_from_stock(GTK_STOCK_APPLY);
- // Disable temporarily the apply button
- ////gtk_container_add(GTK_CONTAINER(ButtonBox),Button);
- ////g_signal_connect(G_OBJECT(Button),"clicked",G_CALLBACK(OptionsWindow_Apply_Button),NULL);
- ////GTK_WIDGET_SET_FLAGS(Button, GTK_CAN_DEFAULT);
gtk_widget_set_tooltip_text(Button,_("Apply changes (but don't save) and close this window"));
@@ -1495,19 +1491,21 @@ void Open_OptionsWindow (void)
}
-void Set_Default_Comment_Check_Button_Toggled (void)
+static void Set_Default_Comment_Check_Button_Toggled (void)
{
gtk_widget_set_sensitive(DefaultComment,gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(SetDefaultComment)));
}
-void Number_Track_Formated_Toggled (void)
+void Number_Track_Formatted_Toggled (void)
{
gtk_widget_set_sensitive(NumberTrackFormatedSpinButton,gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(NumberTrackFormated)));
// To update the example...
g_signal_emit_by_name(G_OBJECT(NumberTrackFormatedSpinButton),"changed",NULL);
}
-void Number_Track_Formated_Spin_Button_Changed (GtkWidget *Label, GtkWidget *SpinButton)
+static void
+Number_Track_Formatted_Spin_Button_Changed (GtkWidget *Label,
+ GtkWidget *SpinButton)
{
gchar *tmp;
gint val;
@@ -1524,13 +1522,15 @@ void Number_Track_Formated_Spin_Button_Changed (GtkWidget *Label, GtkWidget *Spi
g_free(tmp);
}
-void Use_Non_Standard_Id3_Reading_Character_Set_Toggled (void)
+static void
+Use_Non_Standard_Id3_Reading_Character_Set_Toggled (void)
{
gtk_widget_set_sensitive(FileReadingId3v1v2CharacterSetCombo,
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(UseNonStandardId3ReadingCharacterSet)));
}
-void Change_Id3_Settings_Toggled (void)
+static void
+Change_Id3_Settings_Toggled (void)
{
int active;
@@ -1630,7 +1630,8 @@ void Change_Id3_Settings_Toggled (void)
gtk_widget_set_sensitive(FileWritingId3v1IconvOptionsIgnore, active);
}
-void Cddb_Use_Proxy_Toggled (void)
+static void
+Cddb_Use_Proxy_Toggled (void)
{
gboolean active;
@@ -1642,7 +1643,8 @@ void Cddb_Use_Proxy_Toggled (void)
}
/* Callback from Open_OptionsWindow */
-gboolean OptionsWindow_Key_Press (GtkWidget *window, GdkEvent *event)
+static gboolean
+OptionsWindow_Key_Press (GtkWidget *window, GdkEvent *event)
{
GdkEventKey *kevent;
@@ -1662,26 +1664,8 @@ gboolean OptionsWindow_Key_Press (GtkWidget *window, GdkEvent *event)
}
/* Callback from Open_OptionsWindow */
-void OptionsWindow_Apply_Button(void)
-{
- if (!Check_Config()) return;
-
-#ifndef WIN32
- /* FIXME : make gtk crash on win32 */
- Add_String_To_Combo_List(DefaultPathModel, gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(DefaultPathToMp3)))));
- Add_String_To_Combo_List(FilePlayerModel, gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(FilePlayerCombo)))));
- Add_String_To_Combo_List(DefaultCommentModel, gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(DefaultComment)))));
- Add_String_To_Combo_List(CddbLocalPathModel, gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(CddbLocalPath)))));
-#endif
-
- Apply_Changes_Of_Preferences_Window();
-
- OptionsWindow_Quit();
- Statusbar_Message(_("Changes applied"),TRUE);
-}
-
-/* Callback from Open_OptionsWindow */
-void OptionsWindow_Save_Button(void)
+static void
+OptionsWindow_Save_Button (void)
{
if (!Check_Config()) return;
@@ -1700,14 +1684,16 @@ void OptionsWindow_Save_Button(void)
}
/* Callback from Open_OptionsWindow */
-void OptionsWindow_Cancel_Button(void)
+static void
+OptionsWindow_Cancel_Button (void)
{
OptionsWindow_Quit();
Statusbar_Message(_("Configuration unchanged"),TRUE);
}
/* Callback from Open_OptionsWindow */
-void OptionsWindow_Quit(void)
+static void
+OptionsWindow_Quit (void)
{
if (OptionsWindow)
{
@@ -1954,16 +1940,18 @@ Check_Config (void)
* Manage Check buttons into Scanner tab: conversion group
* This reproduces "something" like the behaviour of radio buttons with check buttons
*/
-void Scanner_Convert_Check_Button_Toggled_1 (GtkWidget *object_rec, GtkWidget *object_emi)
+static void
+Scanner_Convert_Check_Button_Toggled_1 (GtkWidget *object_rec,
+ GtkWidget *object_emi)
{
if (!object_rec || !object_emi) return;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(object_emi)) == TRUE)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(object_rec),!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(object_emi)));
-
}
-void DefaultPathToMp3_Combo_Add_String (void)
+static void
+DefaultPathToMp3_Combo_Add_String (void)
{
const gchar *path;
@@ -1971,7 +1959,8 @@ void DefaultPathToMp3_Combo_Add_String (void)
Add_String_To_Combo_List(GTK_LIST_STORE(DefaultPathModel), path);
}
-void CddbLocalPath_Combo_Add_String (void)
+static void
+CddbLocalPath_Combo_Add_String (void)
{
const gchar *path;
diff --git a/src/scan.c b/src/scan.c
index 514c7cb..994ab10 100644
--- a/src/scan.c
+++ b/src/scan.c
@@ -220,56 +220,68 @@ struct _Scan_Mask_Item
/**************
* Prototypes *
**************/
-void ScannerWindow_Quit (void);
-gboolean ScannerWindow_Key_Press (GtkWidget *window, GdkEvent *event);
-void Scan_Toggle_Legend_Button (void);
-void Scan_Toggle_Mask_Editor_Button (void);
+static void Scan_Tag_With_Mask (ET_File *ETFile);
+static void ScannerWindow_Quit (void);
+static gboolean ScannerWindow_Key_Press (GtkWidget *window, GdkEvent *event);
+static void Scan_Toggle_Legend_Button (void);
+static void Scan_Toggle_Mask_Editor_Button (void);
gchar *Scan_Replace_String (gchar *string, gchar *last, gchar *new);
-void Scan_Option_Button (void);
-gboolean Scan_Check_Scan_Tag_Mask (GtkWidget *widget_to_show_hide, GtkEntry *widget_source);
+static void Scan_Option_Button (void);
+static gboolean Scan_Check_Scan_Tag_Mask (GtkWidget *widget_to_show_hide,
+ GtkEntry *widget_source);
gboolean Scan_Check_Rename_File_Mask (GtkWidget *widget_to_show_hide, GtkEntry *widget_source);
-gboolean Scan_Check_Editor_Mask (GtkWidget *widget_to_show_hide, GtkEntry *widget_source);
+static gboolean Scan_Check_Editor_Mask (GtkWidget *widget_to_show_hide,
+ GtkEntry *widget_source);
gchar *Scan_Generate_New_Filename_From_Mask (ET_File *ETFile, gchar *mask, gboolean no_dir_check_or_conversion);
-GList *Scan_Generate_New_Tag_From_Mask (ET_File *ETFile, gchar *mask);
+static GList *Scan_Generate_New_Tag_From_Mask (ET_File *ETFile, gchar *mask);
void Scan_Rename_File_Generate_Preview (void);
-void Scan_Rename_File_Prefix_Path (void);
+static void Scan_Rename_File_Prefix_Path (void);
void Scan_Fill_Tag_Generate_Preview (void);
-void Scan_Free_File_Rename_List (GList *list);
-void Scan_Free_File_Fill_Tag_List (GList *list);
+static void Scan_Free_File_Rename_List (GList *list);
+static void Scan_Free_File_Fill_Tag_List (GList *list);
void Scan_Rename_Directory_Generate_Preview (void);
-gchar **Scan_Return_File_Tag_Field_From_Mask_Code (File_Tag *FileTag, gchar code);
-void Scan_Process_Fields_Functions (gchar **string);
+static gchar **Scan_Return_File_Tag_Field_From_Mask_Code (File_Tag *FileTag,
+ gchar code);
+static void Scan_Process_Fields_Functions (gchar **string);
-gint Scan_Word_Is_Roman_Numeral (gchar *text);
+static gint Scan_Word_Is_Roman_Numeral (const gchar *text);
-void Process_Fields_Check_Button_Toggled (GtkWidget *object, GList *list);
-void Process_Fields_Convert_Check_Button_Toggled (GtkWidget *object);
-void Process_Fields_First_Letters_Check_Button_Toggled (GtkWidget *object);
-void Select_Fields_Invert_Selection (void);
-void Select_Fields_Select_Unselect_All (void);
-void Select_Fields_Set_Sensitive (void);
+static void Process_Fields_Check_Button_Toggled (GtkWidget *object,
+ GList *list);
+static void Process_Fields_Convert_Check_Button_Toggled (GtkWidget *object);
+static void Process_Fields_First_Letters_Check_Button_Toggled (GtkWidget *object);
+static void Select_Fields_Invert_Selection (void);
+static void Select_Fields_Select_Unselect_All (void);
+static void Select_Fields_Set_Sensitive (void);
-void Mask_Editor_List_Row_Selected (GtkTreeSelection* selection, gpointer data);
-void Mask_Editor_List_Set_Row_Visible (GtkTreeModel *treeModel, GtkTreeIter *rowIter);
-void Mask_Editor_List_New (void);
-void Mask_Editor_List_Duplicate (void);
-void Mask_Editor_List_Add (void);
-void Mask_Editor_List_Remove (void);
-void Mask_Editor_List_Move_Up (void);
-void Mask_Editor_List_Move_Down (void);
-void Mask_Editor_List_Save_Button (void);
-void Mask_Editor_Entry_Changed (void);
-gboolean Mask_Editor_List_Key_Press (GtkWidget *widget, GdkEvent *event);
+static void Mask_Editor_List_Row_Selected (GtkTreeSelection* selection,
+ gpointer data);
+static void Mask_Editor_List_Set_Row_Visible (GtkTreeModel *treeModel,
+ GtkTreeIter *rowIter);
+static void Mask_Editor_List_New (void);
+static void Mask_Editor_List_Duplicate (void);
+static void Mask_Editor_List_Add (void);
+static void Mask_Editor_List_Remove (void);
+static void Mask_Editor_List_Move_Up (void);
+static void Mask_Editor_List_Move_Down (void);
+static void Mask_Editor_List_Save_Button (void);
+static void Mask_Editor_Entry_Changed (void);
+static gboolean Mask_Editor_List_Key_Press (GtkWidget *widget,
+ GdkEvent *event);
-void Mask_Editor_Clean_Up_Masks_List (void);
+static void Mask_Editor_Clean_Up_Masks_List (void);
-void Scanner_Option_Menu_Activate_Item (GtkWidget *widget, gpointer data);
+static void Scanner_Option_Menu_Activate_Item (GtkWidget *widget, gpointer data);
-int roman2int (const char *str);
-const char * int2roman (int num);
-char * int2roman_r (int num, char * str, size_t len);
+static int roman2int (const char *str);
+static const char *int2roman (int num);
+static char *int2roman_r (int num, char * str, size_t len);
+
+static void Scan_Convert_Character (gchar **string);
+static GList *Scan_Generate_New_Tag_From_Mask (ET_File *ETFile, gchar *mask);
+static void Scan_Set_Scanner_Window_Init_Position (void);
@@ -291,7 +303,8 @@ void Init_ScannerWindow (void)
* Uses the filename and path to fill tag information
* Note: mask and source are read from the right to the left
*/
-void Scan_Tag_With_Mask (ET_File *ETFile)
+static void
+Scan_Tag_With_Mask (ET_File *ETFile)
{
GList *fill_tag_list = NULL;
gchar **dest = NULL;
@@ -365,7 +378,8 @@ void Scan_Tag_With_Mask (ET_File *ETFile)
g_free(filename_utf8);
}
-GList *Scan_Generate_New_Tag_From_Mask (ET_File *ETFile, gchar *mask)
+static GList *
+Scan_Generate_New_Tag_From_Mask (ET_File *ETFile, gchar *mask)
{
GList *fill_tag_list = NULL;
gchar *filename_utf8;
@@ -610,7 +624,8 @@ void Scan_Fill_Tag_Generate_Preview (void)
g_free(preview_text);
}
-void Scan_Free_File_Fill_Tag_List (GList *list)
+static void
+Scan_Free_File_Fill_Tag_List (GList *list)
{
// Free the list
list = g_list_first(list);
@@ -638,7 +653,8 @@ void Scan_Free_File_Fill_Tag_List (GList *list)
* Note: mask and source are read from the right to the left.
* Note1: a mask code may be used severals times...
*/
-void Scan_Rename_File_With_Mask (ET_File *ETFile)
+static void
+Scan_Rename_File_With_Mask (ET_File *ETFile)
{
gchar *filename_generated_utf8 = NULL;
gchar *filename_generated = NULL;
@@ -968,7 +984,8 @@ void Scan_Rename_File_Generate_Preview (void)
}
-void Scan_Free_File_Rename_List (GList *list)
+static void
+Scan_Free_File_Rename_List (GList *list)
{
// Free the list
list = g_list_last(list);
@@ -989,7 +1006,8 @@ void Scan_Free_File_Rename_List (GList *list)
/*
* Adds the current path of the file to the mask on the "Rename File Scanner" entry
*/
-void Scan_Rename_File_Prefix_Path (void)
+static void
+Scan_Rename_File_Prefix_Path (void)
{
gint pos;
gchar *path_tmp;
@@ -1086,7 +1104,8 @@ gchar *Scan_Generate_New_Directory_Name_From_Mask (ET_File *ETFile, gchar *mask,
* Scanner To Process Fields *
*****************************/
/* See also functions : Convert_P20_And_Undescore_Into_Spaces, ... in easytag.c */
-void Scan_Process_Fields (ET_File *ETFile)
+static void
+Scan_Process_Fields (ET_File *ETFile)
{
File_Name *FileName = NULL;
File_Tag *FileTag = NULL;
@@ -1339,7 +1358,8 @@ void Scan_Process_Fields (ET_File *ETFile)
}
-void Scan_Process_Fields_Functions (gchar **string)
+static void
+Scan_Process_Fields_Functions (gchar **string)
{
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessFieldsConvertIntoSpace)))
{
@@ -1762,7 +1782,8 @@ void Scan_Convert_Space_Into_Undescore (gchar *string)
* Replace something with something else ;)
* Currently this only works with one character for each
*/
-void Scan_Convert_Character (gchar **string)
+static void
+Scan_Convert_Character (gchar **string)
{
gchar *from = gtk_editable_get_chars(GTK_EDITABLE(ProcessFieldsConvertFrom),0,-1 );
gchar *to = gtk_editable_get_chars(GTK_EDITABLE(ProcessFieldsConvertTo),0,-1 );
@@ -1838,9 +1859,10 @@ void Scan_Convert_Character (gchar **string)
* D = 500 (five hundred)
* M = 1000 (one thousand)
*/
-gint Scan_Word_Is_Roman_Numeral (gchar *text)
+static gint
+Scan_Word_Is_Roman_Numeral (const gchar *text)
{
- gchar *tmp;
+ const gchar *tmp;
gint len;
gchar *buf = NULL;
gint rn_int;
@@ -1923,7 +1945,8 @@ roman_numeral_found:
* Copyright (c) 2007 David M. Syzdek <roman-project syzdek net>
*/
/* Convert Roman numeral from integer to string */
-const char * int2roman (int num)
+static const char *
+int2roman (int num)
{
#define ROMAN_BUFF_LEN 512
@@ -1937,7 +1960,9 @@ const char * int2roman (int num)
return NULL;
return g_strdup(roman_string);
}
-char * int2roman_r (int num, char * str, size_t len)
+
+static char *
+int2roman_r (int num, char * str, size_t len)
{
// local variables
unsigned pos;
@@ -2084,8 +2109,10 @@ char * int2roman_r (int num, char * str, size_t len)
/* ends function */
return str;
}
+
/* Convert Roman numeral from string to integer */
-int roman2int (const char * str)
+static int
+roman2int (const char *str)
{
// declares local vars
int num;
@@ -2249,7 +2276,8 @@ int roman2int (const char * str)
/*
* Return the field of a 'File_Tag' structure corresponding to the mask code
*/
-gchar **Scan_Return_File_Tag_Field_From_Mask_Code (File_Tag *FileTag, gchar code)
+static gchar
+**Scan_Return_File_Tag_Field_From_Mask_Code (File_Tag *FileTag, gchar code)
{
switch (code)
{
@@ -3019,7 +3047,8 @@ void Open_ScannerWindow (gint scanner_type)
gtk_combo_box_set_active(GTK_COMBO_BOX(ScannerOptionCombo), scanner_type);
}
-gboolean ScannerWindow_Key_Press (GtkWidget *window, GdkEvent *event)
+static gboolean
+ScannerWindow_Key_Press (GtkWidget *window, GdkEvent *event)
{
GdkEventKey *kevent;
@@ -3085,7 +3114,8 @@ void Scan_Use_Process_Fields_Scanner (void)
/* Callback from Open_ScannerWindow */
-void ScannerWindow_Quit (void)
+static void
+ScannerWindow_Quit (void)
{
if (ScannerWindow)
{
@@ -3192,7 +3222,8 @@ void ScannerWindow_Apply_Changes (void)
/* Callback from Option button */
-void Scan_Option_Button (void)
+static void
+Scan_Option_Button (void)
{
Open_OptionsWindow();
gtk_notebook_set_current_page(GTK_NOTEBOOK(OptionsNoteBook), OptionsNoteBook_Scanner_Page_Num);
@@ -3331,7 +3362,9 @@ gboolean Scan_Check_Rename_File_Mask (GtkWidget *widget_to_show_hide, GtkEntry *
/*
* Check if the selected mask in the Mask Editor is valid, else display the mask status icon.
*/
-gboolean Scan_Check_Editor_Mask (GtkWidget *widget_to_show_hide, GtkEntry *widget_source)
+static gboolean
+Scan_Check_Editor_Mask (GtkWidget *widget_to_show_hide,
+ GtkEntry *widget_source)
{
/* Select and get result of check scanner */
if (gtk_combo_box_get_active(GTK_COMBO_BOX(ScannerOptionCombo)) == SCANNER_FILL_TAG)
@@ -3345,7 +3378,8 @@ gboolean Scan_Check_Editor_Mask (GtkWidget *widget_to_show_hide, GtkEntry *widge
}
-void Scan_Toggle_Legend_Button (void)
+static void
+Scan_Toggle_Legend_Button (void)
{
if (!LegendButton || !LegendFrame) return;
@@ -3356,7 +3390,8 @@ void Scan_Toggle_Legend_Button (void)
}
-void Scan_Toggle_Mask_Editor_Button (void)
+static void
+Scan_Toggle_Mask_Editor_Button (void)
{
GtkTreeModel *treemodel;
GtkTreeSelection *selection;
@@ -3390,7 +3425,8 @@ void Scan_Toggle_Mask_Editor_Button (void)
/*
* Manage/Toggle check buttons into 'Process Fields' frame
*/
-void Process_Fields_Check_Button_Toggled (GtkWidget *object, GList *list)
+static void
+Process_Fields_Check_Button_Toggled (GtkWidget *object, GList *list)
{
gint i = 0;
@@ -3408,13 +3444,15 @@ void Process_Fields_Check_Button_Toggled (GtkWidget *object, GList *list)
}
-void Process_Fields_Convert_Check_Button_Toggled (GtkWidget *object)
+static void
+Process_Fields_Convert_Check_Button_Toggled (GtkWidget *object)
{
gtk_widget_set_sensitive(GTK_WIDGET(ProcessFieldsConvertTo),gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(object)));
gtk_widget_set_sensitive(GTK_WIDGET(ProcessFieldsConvertFrom),gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(object)));
}
-void Process_Fields_First_Letters_Check_Button_Toggled (GtkWidget *object)
+static void
+Process_Fields_First_Letters_Check_Button_Toggled (GtkWidget *object)
{
gtk_widget_set_sensitive(GTK_WIDGET(ProcessFieldsDetectRomanNumerals),gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(object)));
}
@@ -3423,7 +3461,8 @@ void Process_Fields_First_Letters_Check_Button_Toggled (GtkWidget *object)
/*
* Small buttons of Process Fields scanner
*/
-void Select_Fields_Invert_Selection (void)
+static void
+Select_Fields_Invert_Selection (void)
{
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFileNameField),
!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessFileNameField)));
@@ -3450,7 +3489,9 @@ void Select_Fields_Invert_Selection (void)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessEncodedByField),
!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessEncodedByField)));
}
-void Select_Fields_Select_Unselect_All (void)
+
+static void
+Select_Fields_Select_Unselect_All (void)
{
static gboolean state = TRUE;
@@ -3472,7 +3513,8 @@ void Select_Fields_Select_Unselect_All (void)
/*
* Set sensitive state of the processing check boxes : if no one is selected => all disabled
*/
-void Select_Fields_Set_Sensitive (void)
+static void
+Select_Fields_Set_Sensitive (void)
{
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessFileNameField))
|| gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ProcessTitleField))
@@ -3532,7 +3574,8 @@ void Select_Fields_Set_Sensitive (void)
* Callback from the mask edit list
* Previously known as Mask_Editor_List_Select_Row
*/
-void Mask_Editor_List_Row_Selected (GtkTreeSelection* selection, gpointer data)
+static void
+Mask_Editor_List_Row_Selected (GtkTreeSelection* selection, gpointer data)
{
GList *selectedRows;
gchar *text = NULL;
@@ -3584,7 +3627,8 @@ void Mask_Editor_List_Row_Selected (GtkTreeSelection* selection, gpointer data)
/*
* Add a new mask to the list
*/
-void Mask_Editor_List_New (void)
+static void
+Mask_Editor_List_New (void)
{
gchar *text = _("New_mask");
GtkTreeIter iter;
@@ -3606,7 +3650,8 @@ void Mask_Editor_List_New (void)
/*
* Duplicate a mask on the list
*/
-void Mask_Editor_List_Duplicate (void)
+static void
+Mask_Editor_List_Duplicate (void)
{
gchar *text = NULL;
GList *selectedRows;
@@ -3671,7 +3716,8 @@ void Mask_Editor_List_Duplicate (void)
g_list_free(toInsert);
}
-void Mask_Editor_List_Add (void)
+static void
+Mask_Editor_List_Add (void)
{
gint i = 0;
GtkTreeIter iter;
@@ -3718,7 +3764,8 @@ void Mask_Editor_List_Add (void)
/*
* Remove the selected rows from the mask editor list
*/
-void Mask_Editor_List_Remove (void)
+static void
+Mask_Editor_List_Remove (void)
{
GtkTreeSelection *selection;
GtkTreeIter iter;
@@ -3758,7 +3805,8 @@ void Mask_Editor_List_Remove (void)
/*
* Move all selected rows up one place in the mask list
*/
-void Mask_Editor_List_Move_Up (void)
+static void
+Mask_Editor_List_Move_Up (void)
{
GtkTreeSelection *selection;
GList *selectedRows;
@@ -3811,7 +3859,8 @@ void Mask_Editor_List_Move_Up (void)
/*
* Move all selected rows down one place in the mask list
*/
-void Mask_Editor_List_Move_Down (void)
+static void
+Mask_Editor_List_Move_Down (void)
{
GtkTreeSelection *selection;
GList *selectedRows;
@@ -3861,7 +3910,8 @@ void Mask_Editor_List_Move_Down (void)
/*
* Set a row visible in the mask editor list (by scrolling the list)
*/
-void Mask_Editor_List_Set_Row_Visible (GtkTreeModel *treeModel, GtkTreeIter *rowIter)
+static void
+Mask_Editor_List_Set_Row_Visible (GtkTreeModel *treeModel, GtkTreeIter *rowIter)
{
/*
* TODO: Make this only scroll to the row if it is not visible
@@ -3880,7 +3930,8 @@ void Mask_Editor_List_Set_Row_Visible (GtkTreeModel *treeModel, GtkTreeIter *row
/*
* Save the currently displayed mask list in the mask editor
*/
-void Mask_Editor_List_Save_Button (void)
+static void
+Mask_Editor_List_Save_Button (void)
{
Mask_Editor_Clean_Up_Masks_List();
@@ -3896,7 +3947,8 @@ void Mask_Editor_List_Save_Button (void)
/*
* Clean up the currently displayed masks lists, ready for saving
*/
-void Mask_Editor_Clean_Up_Masks_List (void)
+static void
+Mask_Editor_Clean_Up_Masks_List (void)
{
gchar *text = NULL;
gchar *text1 = NULL;
@@ -3962,7 +4014,8 @@ void Mask_Editor_Clean_Up_Masks_List (void)
/*
* Update the Mask List with the new value of the entry box
*/
-void Mask_Editor_Entry_Changed (void)
+static void
+Mask_Editor_Entry_Changed (void)
{
GtkTreeSelection *selection;
GtkTreePath *firstSelected;
@@ -3999,7 +4052,8 @@ void Mask_Editor_Entry_Changed (void)
/*
* Actions when the a key is pressed into the masks editor clist
*/
-gboolean Mask_Editor_List_Key_Press (GtkWidget *widget, GdkEvent *event)
+static gboolean
+Mask_Editor_List_Key_Press (GtkWidget *widget, GdkEvent *event)
{
if (event && event->type == GDK_KEY_PRESS) {
GdkEventKey *kevent = (GdkEventKey *)event;
@@ -4023,7 +4077,8 @@ gboolean Mask_Editor_List_Key_Press (GtkWidget *widget, GdkEvent *event)
/*
* Function when you select an item of the option menu
*/
-void Scanner_Option_Menu_Activate_Item (GtkWidget *combo, gpointer data)
+static void
+Scanner_Option_Menu_Activate_Item (GtkWidget *combo, gpointer data)
{
switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)))
{
@@ -4069,7 +4124,8 @@ void Scanner_Option_Menu_Activate_Item (GtkWidget *combo, gpointer data)
/*
* Init the position of the scanner window
*/
-void Scan_Set_Scanner_Window_Init_Position (void)
+static void
+Scan_Set_Scanner_Window_Init_Position (void)
{
if (ScannerWindow && SET_SCANNER_WINDOW_POSITION)
{
diff --git a/src/scan.h b/src/scan.h
index 456704d..07e137f 100644
--- a/src/scan.h
+++ b/src/scan.h
@@ -50,12 +50,8 @@ enum {
* Prototypes *
**************/
-void Scan_Tag_With_Mask (ET_File *ETFile);
-void Scan_Rename_File_With_Mask (ET_File *ETFile);
-void Scan_Process_Fields (ET_File *ETFile);
void Scan_Select_Mode_And_Run_Scanner (ET_File *ETFile);
gchar *Scan_Generate_New_Filename_From_Mask (ET_File *ETFile, gchar *mask, gboolean no_dir_check_or_conversion);
-GList *Scan_Generate_New_Tag_From_Mask (ET_File *ETFile, gchar *mask);
gchar *Scan_Generate_New_Directory_Name_From_Mask (ET_File *ETFile, gchar *mask, gboolean no_dir_check_or_conversion);
void Scan_Rename_File_Generate_Preview (void);
void Scan_Fill_Tag_Generate_Preview (void);
@@ -78,13 +74,10 @@ void Scan_Process_Fields_Keep_One_Space (gchar *string);
void Scan_Convert_Underscore_Into_Space (gchar *string);
void Scan_Convert_P20_Into_Space (gchar *string);
void Scan_Convert_Space_Into_Undescore (gchar *string);
-void Scan_Convert_Character (gchar **string);
void Scan_Remove_Spaces (gchar *string);
void Init_ScannerWindow (void);
void Open_ScannerWindow (gint scanner_type);
void ScannerWindow_Apply_Changes (void);
-void Scan_Set_Scanner_Window_Init_Position (void);
-
#endif /* __SCAN_H__ */
diff --git a/src/setting.c b/src/setting.c
index ddf21c7..8201598 100644
--- a/src/setting.c
+++ b/src/setting.c
@@ -99,6 +99,9 @@ static const gchar CDDB_LOCAL_PATH_HISTORY_FILE[] = "cddb_local_path.history";
* Prototypes *
**************/
+static void Save_Config_To_File (void);
+static gboolean Create_Easytag_Directory (void);
+
/********************
@@ -645,7 +648,8 @@ void Init_Config_Variables (void)
* Save into the config variables the settings of each tab of the Preferences window...
* If settings needs to be "shown/applied" to the corresponding window, we do it
*/
-void Apply_Changes_Of_Preferences_Window (void)
+static void
+Apply_Changes_Of_Preferences_Window (void)
{
gchar *temp;
int active;
@@ -862,7 +866,8 @@ void Apply_Changes_Of_Preferences_Window (void)
* - Position/size of the window
* - Specific options in the window
*/
-void Apply_Changes_Of_UI (void)
+static void
+Apply_Changes_Of_UI (void)
{
/*
* Changes in user interface
@@ -910,7 +915,8 @@ void Save_Changes_Of_Preferences_Window (void)
/*
* Write the config file
*/
-void Save_Config_To_File (void)
+static void
+Save_Config_To_File (void)
{
gchar *file_path = NULL;
FILE *file;
@@ -975,8 +981,6 @@ void Save_Config_To_File (void)
fclose(file);
}
g_free(file_path);
-
- //Display_Config();
}
@@ -1087,60 +1091,6 @@ void Read_Config (void)
/*
- * Display values in config variables
- * For debuging only!
- */
-void Display_Config (void)
-{
- gchar *file_path = NULL;
- FILE *file;
-
- /* The file to write */
- file_path = g_build_filename (g_get_user_config_dir (), PACKAGE_TARNAME,
- CONFIG_FILE, NULL);
-
- if ((file = fopen (file_path, "r")) == 0)
- {
- g_print (_("Cannot open configuration file '%s' (%s)"), file_path,
- g_strerror (errno));
- }else
- {
- gint ConfigVarListLen = sizeof(Config_Variables)/sizeof(tConfigVariable);
- gint i;
-
- g_print("\n## Current Config ##");
- for (i=0; i<ConfigVarListLen; i++)
- {
- switch(Config_Variables[i].type)
- {
- case CV_TYPE_INT:
- case CV_TYPE_BOOL:
- {
- g_print("\n%d: %s=%d",i,Config_Variables[i].name,
- *(int*)Config_Variables[i].pointer);
- break;
- }
- case CV_TYPE_STRING:
- {
- g_print("\n%d: %s=%s",i,Config_Variables[i].name,
- *(char**)Config_Variables[i].pointer);
- break;
- }
- default:
- {
- g_print("NOT IMPLEMENTED (Save_Config)!! \n\a");
- break;
- }
- }
- }
- g_print("\n## End Current Config ##\n");
- fclose(file);
- }
- g_free(file_path);
-}
-
-
-/*
* check_or_create_file:
* @filename: (type filename): the filename to create
*
@@ -1615,7 +1565,8 @@ migrate_config_file_dir (const gchar *old_path, const gchar *new_path)
* Returns: %TRUE if the directory was created, or already exists. %FALSE if
* the directory could not be created.
*/
-gboolean Create_Easytag_Directory (void)
+static gboolean
+Create_Easytag_Directory (void)
{
gchar *easytag_path = NULL;
gint result;
diff --git a/src/setting.h b/src/setting.h
index ea2b070..59d606a 100644
--- a/src/setting.h
+++ b/src/setting.h
@@ -312,15 +312,10 @@ gint OPTIONS_WINDOW_WIDTH;
void Init_Config_Variables (void);
void Read_Config (void);
-void Display_Config (void);
-void Apply_Changes_Of_Preferences_Window (void);
-void Apply_Changes_Of_UI (void);
void Save_Changes_Of_Preferences_Window (void);
void Save_Changes_Of_UI (void);
-void Save_Config_To_File (void);
-gboolean Create_Easytag_Directory (void);
gboolean Setting_Create_Files (void);
diff --git a/src/vcedit.c b/src/vcedit.c
index f92b268..1d4136d 100644
--- a/src/vcedit.c
+++ b/src/vcedit.c
@@ -26,6 +26,10 @@
#define CHUNKSIZE 4096
+static int vcedit_open_callbacks(vcedit_state *state, void *in,
+ vcedit_read_func read_func,
+ vcedit_write_func write_func);
+
vcedit_state *vcedit_new_state(void)
{
vcedit_state *state = malloc(sizeof(vcedit_state));
@@ -252,8 +256,9 @@ int vcedit_open(vcedit_state *state, FILE *in)
(vcedit_read_func)fread, (vcedit_write_func)fwrite);
}
-int vcedit_open_callbacks(vcedit_state *state, void *in,
- vcedit_read_func read_func, vcedit_write_func write_func)
+static int
+vcedit_open_callbacks(vcedit_state *state, void *in,
+ vcedit_read_func read_func, vcedit_write_func write_func)
{
char *buffer;
diff --git a/src/vcedit.h b/src/vcedit.h
index 5bc39dc..3a9e5f9 100644
--- a/src/vcedit.h
+++ b/src/vcedit.h
@@ -62,8 +62,6 @@ extern vcedit_state *vcedit_new_state(void);
extern void vcedit_clear(vcedit_state *state);
extern vorbis_comment *vcedit_comments(vcedit_state *state);
extern int vcedit_open(vcedit_state *state, FILE *in);
-extern int vcedit_open_callbacks(vcedit_state *state, void *in,
- vcedit_read_func read_func, vcedit_write_func write_func);
extern int vcedit_write(vcedit_state *state, void *out);
extern char *vcedit_error(vcedit_state *state);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]