[easytag] Mark some strings as const in tagging functions



commit 821273008d1684632b0b1e2c3aee32642d6792b7
Author: David King <amigadave amigadave com>
Date:   Thu Sep 18 17:27:04 2014 +0100

    Mark some strings as const in tagging functions

 src/tags/ape_tag.c             |   34 +++++++++++++-------------
 src/tags/ape_tag.h             |   51 +++++++++++++++++----------------------
 src/tags/flac_header.c         |    5 ++-
 src/tags/flac_header.h         |   11 ++++----
 src/tags/flac_tag.c            |    3 +-
 src/tags/flac_tag.h            |    2 +-
 src/tags/id3_tag.c             |    3 +-
 src/tags/id3_tag.h             |   49 ++++++++++++++++----------------------
 src/tags/id3v24_tag.c          |    4 ++-
 src/tags/libapetag/apetaglib.c |    4 +-
 src/tags/libapetag/apetaglib.h |    4 +-
 src/tags/monkeyaudio_header.c  |   37 +++++++++++++++--------------
 src/tags/monkeyaudio_header.h  |   10 ++++----
 src/tags/mp4_header.cc         |    5 ++-
 src/tags/mp4_header.h          |   37 +++++++++++++---------------
 src/tags/mp4_tag.cc            |    3 +-
 src/tags/mp4_tag.h             |   33 ++++++++++++-------------
 src/tags/mpeg_header.c         |    4 +-
 src/tags/mpeg_header.h         |    5 +--
 src/tags/musepack_header.c     |    5 ++-
 src/tags/musepack_header.h     |   10 ++++----
 src/tags/ogg_header.c          |    5 ++-
 src/tags/ogg_header.h          |    9 +++----
 src/tags/ogg_tag.c             |    2 +-
 src/tags/ogg_tag.h             |    2 +-
 src/tags/wavpack_header.c      |    6 +++-
 src/tags/wavpack_header.h      |    8 +----
 src/tags/wavpack_tag.c         |    4 ++-
 src/tags/wavpack_tag.h         |   49 +++++++++++++++----------------------
 29 files changed, 192 insertions(+), 212 deletions(-)
---
diff --git a/src/tags/ape_tag.c b/src/tags/ape_tag.c
index c944725..c251d9b 100644
--- a/src/tags/ape_tag.c
+++ b/src/tags/ape_tag.c
@@ -1,22 +1,21 @@
-/* ape_tag.c */
-/*
- *  EasyTAG - Tag editor for MP3, Ogg Vorbis and MPC files
- *  Copyright (C) 2001-2003  Jerome Couderc <easytag gmail com>
- *  Copyright (C) 2002-2003  Artur Polaczyñski <artii o2 pl>
+/* EasyTAG - Tag editor for audio files
+ * Copyright (C) 2014  David King <amigadave amigadave com>
+ * Copyright (C) 2001-2003  Jerome Couderc <easytag gmail com>
+ * Copyright (C) 2002-2003  Artur Polaczyñski <artii o2 pl>
  *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
 #include <config.h>
@@ -46,7 +45,8 @@
  * Note:
  *  - if field is found but contains no info (strlen(str)==0), we don't read it
  */
-gboolean Ape_Tag_Read_File_Tag (gchar *filename, File_Tag *FileTag)
+gboolean
+Ape_Tag_Read_File_Tag (const gchar *filename, File_Tag *FileTag)
 {
     FILE *file;
     gchar *string = NULL;
diff --git a/src/tags/ape_tag.h b/src/tags/ape_tag.h
index 9c4dc2d..45ee30e 100644
--- a/src/tags/ape_tag.h
+++ b/src/tags/ape_tag.h
@@ -1,40 +1,33 @@
-/* ape_tag.h - 2001/11/08 */
-/*
- *  EasyTAG - Tag editor for MP3, Ogg Vorbis and MPC files
- *  Copyright (C) 2001-2003  Jerome Couderc <easytag gmail com>
- *  Copyright (C) 2002-2003  Artur Polaczy�ski <artii o2 pl>
+/* EasyTAG - Tag editor for audio files
+ * Copyright (C) 2014  David King <amigadave amigadave com>
+ * Copyright (C) 2001-2003  Jerome Couderc <easytag gmail com>
+ * Copyright (C) 2002-2003  Artur Polaczyñski <artii o2 pl>
  *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-
-#ifndef __APE_TAG_H__
-#define __APE_TAG_H__
-
+#ifndef ET_APE_TAG_H_
+#define ET_APE_TAG_H_
 
 #include "et_core.h"
 
-/***************
- * Declaration *
- ***************/
+G_BEGIN_DECLS
 
-
-/**************
- * Prototypes *
- **************/
-gboolean Ape_Tag_Read_File_Tag  (gchar *filename, File_Tag *FileTag);
+gboolean Ape_Tag_Read_File_Tag (const gchar *filename, File_Tag *FileTag);
 gboolean Ape_Tag_Write_File_Tag (ET_File *ETFile);
 
-#endif /* __APE_TAG_H__ */
+G_END_DECLS
+
+#endif /* ET_APE_TAG_H_ */
diff --git a/src/tags/flac_header.c b/src/tags/flac_header.c
index 2efb1e8..a850617 100644
--- a/src/tags/flac_header.c
+++ b/src/tags/flac_header.c
@@ -77,7 +77,8 @@ static void error_callback_   (const FLAC__StreamDecoder *decoder, FLAC__StreamD
  * Header info of FLAC file *
  ****************************/
 
-gboolean Flac_Header_Read_File_Info (gchar *filename, ET_File_Info *ETFileInfo)
+gboolean
+Flac_Header_Read_File_Info (const gchar *filename, ET_File_Info *ETFileInfo)
 {
     gint duration = 0;
     gulong filesize;
@@ -185,7 +186,7 @@ void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErro
 }
 
 EtFileHeaderFields *
-Flac_Header_Display_File_Info_To_UI (gchar *filename_utf8,
+Flac_Header_Display_File_Info_To_UI (const gchar *filename_utf8,
                                      ET_File *ETFile)
 {
     EtFileHeaderFields *fields;
diff --git a/src/tags/flac_header.h b/src/tags/flac_header.h
index 40ffaee..2ecc680 100644
--- a/src/tags/flac_header.h
+++ b/src/tags/flac_header.h
@@ -17,18 +17,17 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-
 #ifndef ET_FLAC_HEADER_H_
 #define ET_FLAC_HEADER_H_
 
 #include "et_core.h"
 
-/**************
- * Prototypes *
- **************/
+G_BEGIN_DECLS
 
-gboolean Flac_Header_Read_File_Info          (gchar *filename, ET_File_Info *ETFileInfo);
-EtFileHeaderFields * Flac_Header_Display_File_Info_To_UI (gchar *filename, ET_File *ETFile);
+gboolean Flac_Header_Read_File_Info (const gchar *filename, ET_File_Info *ETFileInfo);
+EtFileHeaderFields * Flac_Header_Display_File_Info_To_UI (const gchar *filename, ET_File *ETFile);
 void et_flac_file_header_fields_free (EtFileHeaderFields *fields);
 
+G_END_DECLS
+
 #endif /* ET_FLAC_HEADER_H_ */
diff --git a/src/tags/flac_tag.c b/src/tags/flac_tag.c
index c2a3b8f..ec0ccb2 100644
--- a/src/tags/flac_tag.c
+++ b/src/tags/flac_tag.c
@@ -98,7 +98,8 @@ static gboolean Flac_Set_Tag (FLAC__StreamMetadata *vc_block, const gchar *tag_n
  * Note:
  *  - if field is found but contains no info (strlen(str)==0), we don't read it
  */
-gboolean Flac_Tag_Read_File_Tag (gchar *filename, File_Tag *FileTag)
+gboolean
+Flac_Tag_Read_File_Tag (const gchar *filename, File_Tag *FileTag)
 {
     FLAC__Metadata_SimpleIterator *iter;
     gchar *string = NULL;
diff --git a/src/tags/flac_tag.h b/src/tags/flac_tag.h
index bc6506e..9762aea 100644
--- a/src/tags/flac_tag.h
+++ b/src/tags/flac_tag.h
@@ -36,7 +36,7 @@ const gchar *flac_error_msg;
 /**************
  * Prototypes *
  **************/
-gboolean Flac_Tag_Read_File_Tag  (gchar *filename, File_Tag *FileTag);
+gboolean Flac_Tag_Read_File_Tag  (const gchar *filename, File_Tag *FileTag);
 gboolean Flac_Tag_Write_File_Tag (ET_File *ETFile);
 
 
diff --git a/src/tags/id3_tag.c b/src/tags/id3_tag.c
index b4e071c..c4d00b9 100644
--- a/src/tags/id3_tag.c
+++ b/src/tags/id3_tag.c
@@ -1567,7 +1567,8 @@ gboolean Id3tag_Write_File_Tag (ET_File *ETFile)
  * Returns the corresponding genre value of the input string (for ID3v1.x),
  * else returns 0xFF (unknown genre, but not invalid).
  */
-guchar Id3tag_String_To_Genre (gchar *genre)
+guchar
+Id3tag_String_To_Genre (const gchar *genre)
 {
     guint i;
 
diff --git a/src/tags/id3_tag.h b/src/tags/id3_tag.h
index ecaf717..a167ca5 100644
--- a/src/tags/id3_tag.h
+++ b/src/tags/id3_tag.h
@@ -1,48 +1,41 @@
-/* id3tag.h - 2001/02/16 */
-/*
- *  EasyTAG - Tag editor for MP3 and Ogg Vorbis files
- *  Copyright (C) 2001-2003  Jerome Couderc <easytag gmail com>
+/* EasyTAG - Tag editor for audio files
+ * Copyright (C) 2014  David King <amigadave amigadave com>
+ * Copyright (C) 2001-2003  Jerome Couderc <easytag gmail com>
  *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-
-#ifndef __ID3TAG_H__
-#define __ID3TAG_H__
-
+#ifndef ET_ID3TAG_H_
+#define ET_ID3TAG_H_
 
 #include <glib.h>
 #include "et_core.h"
 
+G_BEGIN_DECLS
 
-/****************
- * Declarations *
- ****************/
 #define ID3_INVALID_GENRE 255
 
-
-/**************
- * Prototypes *
- **************/
 gboolean Id3tag_Read_File_Tag (const gchar *filename, File_Tag *FileTag);
 gboolean Id3tag_Write_File_v24Tag (ET_File *ETFile);
 gboolean Id3tag_Write_File_Tag    (ET_File *ETFile);
 
 const gchar * Id3tag_Genre_To_String (unsigned char genre_code);
-guchar   Id3tag_String_To_Genre (gchar *genre);
+guchar Id3tag_String_To_Genre (const gchar *genre);
 
 gchar *et_id3tag_get_tpos_from_file_tag (File_Tag *file_tag);
 
-#endif /* __ID3TAG_H__ */
+G_END_DECLS
+
+#endif /* ET_ID3TAG_H_ */
diff --git a/src/tags/id3v24_tag.c b/src/tags/id3v24_tag.c
index 064a821..1c59ff9 100644
--- a/src/tags/id3v24_tag.c
+++ b/src/tags/id3v24_tag.c
@@ -90,7 +90,9 @@ static int etag_write_tags (const gchar *filename, struct id3_tag const *v1tag,
  * Returns TRUE on success, else FALSE.
  * If a tag entry exists (ex: title), we allocate memory, else value stays to NULL
  */
-gboolean Id3tag_Read_File_Tag (const gchar *filename, File_Tag *FileTag)
+gboolean
+Id3tag_Read_File_Tag (const gchar *filename,
+                      File_Tag *FileTag)
 {
     int tmpfile;
     struct id3_file *file;
diff --git a/src/tags/libapetag/apetaglib.c b/src/tags/libapetag/apetaglib.c
index 7a7f772..3bcf83e 100644
--- a/src/tags/libapetag/apetaglib.c
+++ b/src/tags/libapetag/apetaglib.c
@@ -694,7 +694,7 @@ make_id3v1_tag(apetag *mem_cnt, struct _id3v1Tag *m)
     \return 0 - OK else check #atl_return
 */
 int
-apetag_read_fp(apetag *mem_cnt, FILE * fp, char *filename, int flag)
+apetag_read_fp(apetag *mem_cnt, FILE * fp, const char *filename, int flag)
 {
     int id3v1 = 0;
     int apeTag2 = 0;
@@ -810,7 +810,7 @@ apetag_read_fp(apetag *mem_cnt, FILE * fp, char *filename, int flag)
     \return 0 - OK else check #atl_return
 */
 int
-apetag_read (apetag *mem_cnt, char *filename,int flag)
+apetag_read (apetag *mem_cnt, const char *filename, int flag)
 {
     FILE *fp;
     
diff --git a/src/tags/libapetag/apetaglib.h b/src/tags/libapetag/apetaglib.h
index f22cec3..3bc97d3 100644
--- a/src/tags/libapetag/apetaglib.h
+++ b/src/tags/libapetag/apetaglib.h
@@ -191,11 +191,11 @@ typedef struct _ape_mem_cnt  apetag;
 
 /* read file and add frames */
 int
-apetag_read (apetag *mem_cnt, char *filename, int flag) ;
+apetag_read (apetag *mem_cnt, const char *filename, int flag) ;
 
 /* read file and add frames */
 int 
-apetag_read_fp (apetag *mem_cnt, FILE * fp, char *filename, int flag) ;
+apetag_read_fp (apetag *mem_cnt, FILE * fp, const char *filename, int flag) ;
 
 /* initialise new object #apetag and return */
 apetag * 
diff --git a/src/tags/monkeyaudio_header.c b/src/tags/monkeyaudio_header.c
index 9952725..cb38872 100644
--- a/src/tags/monkeyaudio_header.c
+++ b/src/tags/monkeyaudio_header.c
@@ -1,22 +1,21 @@
-/* monkeyaudio_header.c */
-/*
- *  EasyTAG - Tag editor for MP3, Ogg Vorbis and MPC files
- *  Copyright (C) 2001-2003  Jerome Couderc <easytag gmail com>
- *  Copyright (C) 2002-2003  Artur Polaczy�ski <artii o2 pl>
+/* EasyTAG - Tag editor for audio files
+ * Copyright (C) 2014  David King <amigadave amigadave com>
+ * Copyright (C) 2001-2003  Jerome Couderc <easytag gmail com>
+ * Copyright (C) 2002-2003  Artur Polaczy�ski <artii o2 pl>
  *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
 #include <config.h>
@@ -42,7 +41,9 @@
  * Header info *
  ***************/
 
-gboolean Mac_Header_Read_File_Info(gchar *filename, ET_File_Info *ETFileInfo)
+gboolean
+Mac_Header_Read_File_Info (const gchar *filename,
+                           ET_File_Info *ETFileInfo)
 {
     StreamInfoMac Info;
 
@@ -65,7 +66,7 @@ gboolean Mac_Header_Read_File_Info(gchar *filename, ET_File_Info *ETFileInfo)
 }
 
 EtFileHeaderFields *
-Mac_Header_Display_File_Info_To_UI (gchar *filename_utf8,
+Mac_Header_Display_File_Info_To_UI (const gchar *filename_utf8,
                                     ET_File *ETFile)
 {
     EtFileHeaderFields *fields;
diff --git a/src/tags/monkeyaudio_header.h b/src/tags/monkeyaudio_header.h
index 714621c..e1f904d 100644
--- a/src/tags/monkeyaudio_header.h
+++ b/src/tags/monkeyaudio_header.h
@@ -23,12 +23,12 @@
 
 #include "et_core.h"
 
-/**************
- * Prototypes *
- **************/
+G_BEGIN_DECLS
 
-gboolean Mac_Header_Read_File_Info(gchar *filename, ET_File_Info *ETFileInfo);
-EtFileHeaderFields * Mac_Header_Display_File_Info_To_UI (gchar *filename, ET_File *ETFile);
+gboolean Mac_Header_Read_File_Info (const gchar *filename, ET_File_Info *ETFileInfo);
+EtFileHeaderFields * Mac_Header_Display_File_Info_To_UI (const gchar *filename, ET_File *ETFile);
 void et_mac_file_header_fields_free (EtFileHeaderFields *fields);
 
+G_END_DECLS
+
 #endif /* ET_MONKAYAUDIO_HEADER_H_ */
diff --git a/src/tags/mp4_header.cc b/src/tags/mp4_header.cc
index 73af747..cdcf1b4 100644
--- a/src/tags/mp4_header.cc
+++ b/src/tags/mp4_header.cc
@@ -26,7 +26,8 @@
  *
  * Get header info into the ETFileInfo structure
  */
-gboolean Mp4_Header_Read_File_Info (gchar *filename, ET_File_Info *ETFileInfo)
+gboolean
+Mp4_Header_Read_File_Info (const gchar *filename, ET_File_Info *ETFileInfo)
 {
     const TagLib::MP4::Properties *properties;
 
@@ -110,7 +111,7 @@ gboolean Mp4_Header_Read_File_Info (gchar *filename, ET_File_Info *ETFileInfo)
  * Display header info in the main window
  */
 EtFileHeaderFields *
-Mp4_Header_Display_File_Info_To_UI (gchar *filename, 
+Mp4_Header_Display_File_Info_To_UI (const gchar *filename, 
                                     ET_File *ETFile)
 {
     EtFileHeaderFields *fields;
diff --git a/src/tags/mp4_header.h b/src/tags/mp4_header.h
index 451eb3b..35d04f0 100644
--- a/src/tags/mp4_header.h
+++ b/src/tags/mp4_header.h
@@ -1,35 +1,32 @@
-/*
- *  EasyTAG - Tag editor for audio files
- *  Copyright (C) 2012-2014  David King <amigadave amigadave com>
- *  Copyright (C) 2000-2005  Jerome Couderc <easytag gmail com>
- *  Copyright (C) 2005  Stewart Whitman <swhitman cox net>
+/* EasyTAG - Tag editor for audio files
+ * Copyright (C) 2012-2014  David King <amigadave amigadave com>
+ * Copyright (C) 2000-2005  Jerome Couderc <easytag gmail com>
+ * Copyright (C) 2005  Stewart Whitman <swhitman cox net>
  *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-
 #ifndef ET_MP4_HEADER_H_
 #define ET_MP4_HEADER_H_
 
-
 #include "et_core.h"
 
 G_BEGIN_DECLS
 
-gboolean Mp4_Header_Read_File_Info (gchar *filename, ET_File_Info *ETFileInfo);
-EtFileHeaderFields * Mp4_Header_Display_File_Info_To_UI (gchar *filename, ET_File *ETFile);
+gboolean Mp4_Header_Read_File_Info (const gchar *filename, ET_File_Info *ETFileInfo);
+EtFileHeaderFields * Mp4_Header_Display_File_Info_To_UI (const gchar *filename, ET_File *ETFile);
 void et_mp4_file_header_fields_free (EtFileHeaderFields *fields);
 
 G_END_DECLS
diff --git a/src/tags/mp4_tag.cc b/src/tags/mp4_tag.cc
index 00b5b9f..2316a2b 100644
--- a/src/tags/mp4_tag.cc
+++ b/src/tags/mp4_tag.cc
@@ -51,7 +51,8 @@
  *
  * Read tag data into an Mp4 file.
  */
-gboolean Mp4tag_Read_File_Tag (gchar *filename, File_Tag *FileTag)
+gboolean
+Mp4tag_Read_File_Tag (const gchar *filename, File_Tag *FileTag)
 {
     TagLib::MP4::Tag *tag;
     guint year;
diff --git a/src/tags/mp4_tag.h b/src/tags/mp4_tag.h
index 64d7f54..82e1bd5 100644
--- a/src/tags/mp4_tag.h
+++ b/src/tags/mp4_tag.h
@@ -1,22 +1,21 @@
-/*
- *  EasyTAG - Tag editor for MP3 and Ogg Vorbis files
- *  Copyright (C) 2012-1014  David King <amigadave amigadave com>
- *  Copyright (C) 2001-2005  Jerome Couderc <easytag gmail com>
- *  Copyright (C) 2005  Michael Ihde <mike ihde randomwalking com>
+/* EasyTAG - Tag editor for audio files
+ * Copyright (C) 2012-1014  David King <amigadave amigadave com>
+ * Copyright (C) 2001-2005  Jerome Couderc <easytag gmail com>
+ * Copyright (C) 2005  Michael Ihde <mike ihde randomwalking com>
  *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
 #ifndef ET_MP4_TAG_H_
@@ -26,7 +25,7 @@
 
 G_BEGIN_DECLS
 
-gboolean Mp4tag_Read_File_Tag (gchar *filename, File_Tag *FileTag);
+gboolean Mp4tag_Read_File_Tag (const gchar *filename, File_Tag *FileTag);
 gboolean Mp4tag_Write_File_Tag (ET_File *ETFile);
 
 G_END_DECLS
diff --git a/src/tags/mpeg_header.c b/src/tags/mpeg_header.c
index cb31e9a..ea60154 100644
--- a/src/tags/mpeg_header.c
+++ b/src/tags/mpeg_header.c
@@ -69,7 +69,7 @@ channel_mode_name (int mode)
  * Read infos into header of first frame
  */
 gboolean
-Mpeg_Header_Read_File_Info (gchar *filename, ET_File_Info *ETFileInfo)
+Mpeg_Header_Read_File_Info (const gchar *filename, ET_File_Info *ETFileInfo)
 {
     /*
      * With id3lib, the header frame couldn't be read if the file contains an ID3v2 tag with an APIC frame
@@ -169,7 +169,7 @@ Mpeg_Header_Read_File_Info (gchar *filename, ET_File_Info *ETFileInfo)
 
 /* For displaying header information in the main window. */
 EtFileHeaderFields *
-Mpeg_Header_Display_File_Info_To_UI (gchar *filename_utf8,
+Mpeg_Header_Display_File_Info_To_UI (const gchar *filename_utf8,
                                      ET_File *ETFile)
 {
     EtFileHeaderFields *fields;
diff --git a/src/tags/mpeg_header.h b/src/tags/mpeg_header.h
index 25e6a1c..f73abf3 100644
--- a/src/tags/mpeg_header.h
+++ b/src/tags/mpeg_header.h
@@ -17,7 +17,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-
 #ifndef ET_MPEG_HEADER_H_
 #define ET_MPEG_HEADER_H_
 
@@ -25,8 +24,8 @@
 
 G_BEGIN_DECLS
 
-gboolean Mpeg_Header_Read_File_Info (gchar *filename, ET_File_Info *ETFileInfo);
-EtFileHeaderFields * Mpeg_Header_Display_File_Info_To_UI (gchar *filename, ET_File *ETFile);
+gboolean Mpeg_Header_Read_File_Info (const gchar *filename, ET_File_Info *ETFileInfo);
+EtFileHeaderFields * Mpeg_Header_Display_File_Info_To_UI (const gchar *filename, ET_File *ETFile);
 void et_mpeg_file_header_fields_free (EtFileHeaderFields *fields);
 
 G_END_DECLS
diff --git a/src/tags/musepack_header.c b/src/tags/musepack_header.c
index f80650d..05e2279 100644
--- a/src/tags/musepack_header.c
+++ b/src/tags/musepack_header.c
@@ -41,7 +41,8 @@
  * Header info *
  ***************/
 
-gboolean Mpc_Header_Read_File_Info (gchar *filename, ET_File_Info *ETFileInfo)
+gboolean
+Mpc_Header_Read_File_Info (const gchar *filename, ET_File_Info *ETFileInfo)
 {
     StreamInfoMpc Info;
 
@@ -66,7 +67,7 @@ gboolean Mpc_Header_Read_File_Info (gchar *filename, ET_File_Info *ETFileInfo)
 }
 
 EtFileHeaderFields *
-Mpc_Header_Display_File_Info_To_UI (gchar *filename_utf8,
+Mpc_Header_Display_File_Info_To_UI (const gchar *filename_utf8,
                                     ET_File *ETFile)
 {
     EtFileHeaderFields *fields;
diff --git a/src/tags/musepack_header.h b/src/tags/musepack_header.h
index 505d43b..40ad0f7 100644
--- a/src/tags/musepack_header.h
+++ b/src/tags/musepack_header.h
@@ -23,12 +23,12 @@
 
 #include "et_core.h"
 
-/**************
- * Prototypes *
- **************/
+G_BEGIN_DECLS
 
-gboolean Mpc_Header_Read_File_Info          (gchar *filename, ET_File_Info *ETFileInfo);
-EtFileHeaderFields * Mpc_Header_Display_File_Info_To_UI (gchar *filename, ET_File *ETFile);
+gboolean Mpc_Header_Read_File_Info (const gchar *filename, ET_File_Info *ETFileInfo);
+EtFileHeaderFields * Mpc_Header_Display_File_Info_To_UI (const gchar *filename, ET_File *ETFile);
 void et_mpc_file_header_fields_free (EtFileHeaderFields *fields);
 
+G_END_DECLS
+
 #endif /* ET_MUSEPACK_HEADER_H_ */
diff --git a/src/tags/ogg_header.c b/src/tags/ogg_header.c
index c13ee7c..ece2ede 100644
--- a/src/tags/ogg_header.c
+++ b/src/tags/ogg_header.c
@@ -322,7 +322,8 @@ Ogg_Header_Read_File_Info (const gchar *filename, ET_File_Info *ETFileInfo)
 
 #ifdef ENABLE_SPEEX
 
-gboolean Speex_Header_Read_File_Info (gchar *filename, ET_File_Info *ETFileInfo)
+gboolean
+Speex_Header_Read_File_Info (const gchar *filename, ET_File_Info *ETFileInfo)
 {
     vcedit_state *state;
     SpeexHeader  *si;
@@ -389,7 +390,7 @@ gboolean Speex_Header_Read_File_Info (gchar *filename, ET_File_Info *ETFileInfo)
 #endif
 
 EtFileHeaderFields *
-Ogg_Header_Display_File_Info_To_UI (gchar *filename, ET_File *ETFile)
+Ogg_Header_Display_File_Info_To_UI (const gchar *filename, ET_File *ETFile)
 {
     EtFileHeaderFields *fields;
     ET_File_Info *info;
diff --git a/src/tags/ogg_header.h b/src/tags/ogg_header.h
index 89ceece..f7be2e3 100644
--- a/src/tags/ogg_header.h
+++ b/src/tags/ogg_header.h
@@ -25,9 +25,7 @@
 #include <glib.h>
 #include "et_core.h"
 
-/****************
- * Declarations *
- ****************/
+G_BEGIN_DECLS
 
 /*
  * Error domain and codes for errors while reading/writing OGG files
@@ -77,10 +75,11 @@ typedef enum
 
 gboolean Ogg_Header_Read_File_Info (const gchar *filename,
                                     ET_File_Info *ETFileInfo);
-EtFileHeaderFields * Ogg_Header_Display_File_Info_To_UI (gchar *filename, ET_File *ETFile);
+EtFileHeaderFields * Ogg_Header_Display_File_Info_To_UI (const gchar *filename, ET_File *ETFile);
 void et_ogg_file_header_fields_free (EtFileHeaderFields *fields);
 
-gboolean Speex_Header_Read_File_Info        (gchar *filename, ET_File_Info *ETFileInfo);
+gboolean Speex_Header_Read_File_Info (const gchar *filename, ET_File_Info *ETFileInfo);
 
+G_END_DECLS
 
 #endif /* ET_OGG_HEADER_H_ */
diff --git a/src/tags/ogg_tag.c b/src/tags/ogg_tag.c
index 54ee33e..384605f 100644
--- a/src/tags/ogg_tag.c
+++ b/src/tags/ogg_tag.c
@@ -648,7 +648,7 @@ et_add_file_tags_from_vorbis_comments (vorbis_comment *vc, File_Tag *FileTag,
  *  - if field is found but contains no info (strlen(str)==0), we don't read it
  */
 gboolean
-ogg_tag_read_file_tag (gchar *filename, File_Tag *FileTag, GError **error)
+ogg_tag_read_file_tag (const gchar *filename, File_Tag *FileTag, GError **error)
 {
     GFile *file;
     GFileInputStream *istream;
diff --git a/src/tags/ogg_tag.h b/src/tags/ogg_tag.h
index d2099a5..055d852 100644
--- a/src/tags/ogg_tag.h
+++ b/src/tags/ogg_tag.h
@@ -35,7 +35,7 @@
 /**************
  * Prototypes *
  **************/
-gboolean ogg_tag_read_file_tag (gchar *filename, File_Tag *FileTag,
+gboolean ogg_tag_read_file_tag (const gchar *filename, File_Tag *FileTag,
                                 GError **error);
 gboolean ogg_tag_write_file_tag (ET_File *ETFile, GError **error);
 
diff --git a/src/tags/wavpack_header.c b/src/tags/wavpack_header.c
index 6055c14..d6ecf73 100644
--- a/src/tags/wavpack_header.c
+++ b/src/tags/wavpack_header.c
@@ -36,7 +36,9 @@
 #include "wavpack_header.h"
 
 
-gboolean Wavpack_Header_Read_File_Info(gchar *filename, ET_File_Info *ETFileInfo)
+gboolean
+Wavpack_Header_Read_File_Info (const gchar *filename,
+                               ET_File_Info *ETFileInfo)
 {
     WavpackContext *wpc;
 
@@ -61,7 +63,7 @@ gboolean Wavpack_Header_Read_File_Info(gchar *filename, ET_File_Info *ETFileInfo
 
 
 EtFileHeaderFields *
-Wavpack_Header_Display_File_Info_To_UI (gchar *filename_utf8,
+Wavpack_Header_Display_File_Info_To_UI (const gchar *filename_utf8,
                                         ET_File *ETFile)
 {
     EtFileHeaderFields *fields;
diff --git a/src/tags/wavpack_header.h b/src/tags/wavpack_header.h
index 6ff5c09..0b5f77a 100644
--- a/src/tags/wavpack_header.h
+++ b/src/tags/wavpack_header.h
@@ -23,12 +23,8 @@
 
 #include "et_core.h"
 
-/**************
- * Prototypes *
- **************/
-
-gboolean Wavpack_Header_Read_File_Info          (gchar *filename, ET_File_Info *ETFileInfo);
-EtFileHeaderFields * Wavpack_Header_Display_File_Info_To_UI (gchar *filename_utf8, ET_File *ETFile);
+gboolean Wavpack_Header_Read_File_Info (const gchar *filename, ET_File_Info *ETFileInfo);
+EtFileHeaderFields * Wavpack_Header_Display_File_Info_To_UI (const gchar *filename_utf8, ET_File *ETFile);
 void et_wavpack_file_header_fields_free (EtFileHeaderFields *fields);
 
 #endif /* ET_WAVPACK_HEADER_H_ */
diff --git a/src/tags/wavpack_tag.c b/src/tags/wavpack_tag.c
index cc2a4c2..472ee24 100644
--- a/src/tags/wavpack_tag.c
+++ b/src/tags/wavpack_tag.c
@@ -38,6 +38,7 @@
 #include "misc.h"
 #include "wavpack_tag.h"
 
+#define MAXLEN 1024
 
 /*
  * For the APEv2 tags, the following field names are officially supported and
@@ -63,7 +64,8 @@
 /*
  * Read tag data from a Wavpack file.
  */
-gboolean Wavpack_Tag_Read_File_Tag (gchar *filename, File_Tag *FileTag)
+gboolean
+Wavpack_Tag_Read_File_Tag (const gchar *filename, File_Tag *FileTag)
 {
     WavpackContext *wpc;
     gchar *field, *field2;
diff --git a/src/tags/wavpack_tag.h b/src/tags/wavpack_tag.h
index 70d3aec..0f02154 100644
--- a/src/tags/wavpack_tag.h
+++ b/src/tags/wavpack_tag.h
@@ -1,42 +1,33 @@
-/* wavpack_tag.c - 2007/02/15 */
-/*
- *  EasyTAG - Tag editor for many file types
- *  Copyright (C) 2007 Maarten Maathuis (madman2003 gmail com)
+/* EasyTAG - Tag editor for audio files
+ * Copyright (C) 2014  David King <amigadave amigadave com>
+ * Copyright (C) 2007 Maarten Maathuis (madman2003 gmail com)
  *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-
-#ifndef __WAVPACK_TAG_H__
-#define __WAVPACK_TAG_H__
-
+#ifndef ET_WAVPACK_TAG_H_
+#define ET_WAVPACK_TAG_H_
 
 #include <glib.h>
 #include "et_core.h"
 
-/***************
- * Declaration *
- ***************/
-
-#define MAXLEN 1024
+G_BEGIN_DECLS
 
-/**************
- * Prototypes *
- **************/
-gboolean Wavpack_Tag_Read_File_Tag  (gchar *filename, File_Tag *FileTag);
+gboolean Wavpack_Tag_Read_File_Tag (const gchar *filename, File_Tag *FileTag);
 gboolean Wavpack_Tag_Write_File_Tag (ET_File *ETFile);
 
+G_END_DECLS
 
-#endif /* __WAVPACK_TAG_H__ */
+#endif /* ET_WAVPACK_TAG_H_ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]