diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/flac/local_string_utils.c | 1 | ||||
-rw-r--r-- | src/libFLAC/metadata_iterators.c | 4 | ||||
-rw-r--r-- | src/metaflac/operations.c | 1 | ||||
-rw-r--r-- | src/metaflac/operations_shorthand.h | 25 | ||||
-rw-r--r-- | src/metaflac/operations_shorthand_cuesheet.c | 1 | ||||
-rw-r--r-- | src/metaflac/operations_shorthand_picture.c | 2 | ||||
-rw-r--r-- | src/metaflac/operations_shorthand_seektable.c | 1 | ||||
-rw-r--r-- | src/metaflac/operations_shorthand_streaminfo.c | 1 | ||||
-rw-r--r-- | src/metaflac/operations_shorthand_vorbiscomment.c | 1 | ||||
-rw-r--r-- | src/share/utf8/iconvert.c | 2 | ||||
-rw-r--r-- | src/share/utf8/iconvert.h | 49 | ||||
-rw-r--r-- | src/share/utf8/utf8.c | 4 | ||||
-rw-r--r-- | src/test_libFLAC/bitwriter.c | 1 | ||||
-rw-r--r-- | src/test_libFLAC/format.c | 1 | ||||
-rw-r--r-- | src/test_libFLAC/metadata.h | 2 | ||||
-rw-r--r-- | src/test_libFLAC/metadata_manip.c | 11 | ||||
-rw-r--r-- | src/test_libFLAC/metadata_object.c | 1 |
17 files changed, 98 insertions, 10 deletions
diff --git a/src/flac/local_string_utils.c b/src/flac/local_string_utils.c index 1d78d18e..d0f8ed34 100644 --- a/src/flac/local_string_utils.c +++ b/src/flac/local_string_utils.c @@ -8,6 +8,7 @@ #include <string.h> #include "utils.h" +#include "local_string_utils.h" /* $OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp $ * diff --git a/src/libFLAC/metadata_iterators.c b/src/libFLAC/metadata_iterators.c index ecead503..7a9ca7c0 100644 --- a/src/libFLAC/metadata_iterators.c +++ b/src/libFLAC/metadata_iterators.c @@ -1198,7 +1198,7 @@ static FLAC__bool chain_read_cb_(FLAC__Metadata_Chain *chain, FLAC__IOHandle han return true; } -FLAC__StreamDecoderReadStatus chain_read_ogg_read_cb_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) +static FLAC__StreamDecoderReadStatus chain_read_ogg_read_cb_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) { FLAC__Metadata_Chain *chain = (FLAC__Metadata_Chain*)client_data; (void)decoder; @@ -2318,7 +2318,7 @@ FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_cuesheet_cb_(FLAC__ return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; } -FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_picture_cstring_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__byte **data, FLAC__uint32 *length, FLAC__uint32 length_len) +static FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_picture_cstring_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__byte **data, FLAC__uint32 *length, FLAC__uint32 length_len) { FLAC__byte buffer[sizeof(FLAC__uint32)]; diff --git a/src/metaflac/operations.c b/src/metaflac/operations.c index d2f2165a..204d2a4c 100644 --- a/src/metaflac/operations.c +++ b/src/metaflac/operations.c @@ -29,6 +29,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include "operations_shorthand.h" static void show_version(void); static FLAC__bool do_major_operation(const CommandLineOptions *options); diff --git a/src/metaflac/operations_shorthand.h b/src/metaflac/operations_shorthand.h new file mode 100644 index 00000000..112c079b --- /dev/null +++ b/src/metaflac/operations_shorthand.h @@ -0,0 +1,25 @@ +/* metaflac - Command-line FLAC metadata editor + * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * 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. + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "options.h" + +FLAC__bool do_shorthand_operation__picture(const char *filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write); +FLAC__bool do_shorthand_operation__cuesheet(const char *filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write); +FLAC__bool do_shorthand_operation__add_seekpoints(const char *filename, FLAC__Metadata_Chain *chain, const char *specification, FLAC__bool *needs_write); +FLAC__bool do_shorthand_operation__streaminfo(const char *filename, FLAC__bool prefix_with_filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write); +FLAC__bool do_shorthand_operation__vorbis_comment(const char *filename, FLAC__bool prefix_with_filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write, FLAC__bool raw); diff --git a/src/metaflac/operations_shorthand_cuesheet.c b/src/metaflac/operations_shorthand_cuesheet.c index 1f7e9501..14912c11 100644 --- a/src/metaflac/operations_shorthand_cuesheet.c +++ b/src/metaflac/operations_shorthand_cuesheet.c @@ -27,6 +27,7 @@ #include "utils.h" #include "FLAC/assert.h" #include "share/grabbag.h" +#include "operations_shorthand.h" static FLAC__bool import_cs_from(const char *filename, FLAC__StreamMetadata **cuesheet, const char *cs_filename, FLAC__bool *needs_write, FLAC__uint64 lead_out_offset, FLAC__bool is_cdda, Argument_AddSeekpoint *add_seekpoint_link); static FLAC__bool export_cs_to(const char *filename, const FLAC__StreamMetadata *cuesheet, const char *cs_filename); diff --git a/src/metaflac/operations_shorthand_picture.c b/src/metaflac/operations_shorthand_picture.c index 01461875..9045aaeb 100644 --- a/src/metaflac/operations_shorthand_picture.c +++ b/src/metaflac/operations_shorthand_picture.c @@ -27,6 +27,8 @@ #include "FLAC/assert.h" #include "share/grabbag.h" /* for grabbag__picture_parse_specification() etc */ +#include "operations_shorthand.h" + static FLAC__bool import_pic_from(const char *filename, FLAC__StreamMetadata **picture, const char *specification, FLAC__bool *needs_write); static FLAC__bool export_pic_to(const char *filename, const FLAC__StreamMetadata *picture, const char *pic_filename); diff --git a/src/metaflac/operations_shorthand_seektable.c b/src/metaflac/operations_shorthand_seektable.c index 9b6a1d8b..4f4fb5d9 100644 --- a/src/metaflac/operations_shorthand_seektable.c +++ b/src/metaflac/operations_shorthand_seektable.c @@ -25,6 +25,7 @@ #include "FLAC/stream_decoder.h" #include "FLAC/metadata.h" #include "share/grabbag.h" +#include "operations_shorthand.h" static FLAC__bool populate_seekpoint_values(const char *filename, FLAC__StreamMetadata *block, FLAC__bool *needs_write); diff --git a/src/metaflac/operations_shorthand_streaminfo.c b/src/metaflac/operations_shorthand_streaminfo.c index ab8e5d47..b4593f50 100644 --- a/src/metaflac/operations_shorthand_streaminfo.c +++ b/src/metaflac/operations_shorthand_streaminfo.c @@ -25,6 +25,7 @@ #include "FLAC/assert.h" #include "FLAC/metadata.h" #include <string.h> +#include "operations_shorthand.h" FLAC__bool do_shorthand_operation__streaminfo(const char *filename, FLAC__bool prefix_with_filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write) { diff --git a/src/metaflac/operations_shorthand_vorbiscomment.c b/src/metaflac/operations_shorthand_vorbiscomment.c index ec1ec6c8..ba00859b 100644 --- a/src/metaflac/operations_shorthand_vorbiscomment.c +++ b/src/metaflac/operations_shorthand_vorbiscomment.c @@ -28,6 +28,7 @@ #include <errno.h> #include <stdlib.h> #include <string.h> +#include "operations_shorthand.h" static FLAC__bool remove_vc_all(const char *filename, FLAC__StreamMetadata *block, FLAC__bool *needs_write); static FLAC__bool remove_vc_field(const char *filename, FLAC__StreamMetadata *block, const char *field_name, FLAC__bool *needs_write); diff --git a/src/share/utf8/iconvert.c b/src/share/utf8/iconvert.c index b72ad863..37f16a89 100644 --- a/src/share/utf8/iconvert.c +++ b/src/share/utf8/iconvert.c @@ -28,6 +28,8 @@ #include <stdlib.h> #include <string.h> +#include "iconvert.h" + /* * Convert data from one encoding to another. Return: * diff --git a/src/share/utf8/iconvert.h b/src/share/utf8/iconvert.h new file mode 100644 index 00000000..1a1a06a1 --- /dev/null +++ b/src/share/utf8/iconvert.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2001 Edmund Grimley Evans <edmundo@rano.org> + * + * 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. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#if HAVE_CONFIG_H +# include <config.h> +#endif + +#ifdef HAVE_ICONV + +/* + * Convert data from one encoding to another. Return: + * + * -2 : memory allocation failed + * -1 : unknown encoding + * 0 : data was converted exactly + * 1 : data was converted inexactly + * 2 : data was invalid (but still converted) + * + * We convert in two steps, via UTF-8, as this is the only + * reliable way of distinguishing between invalid input + * and valid input which iconv refuses to transliterate. + * We convert from UTF-8 twice, because we have no way of + * knowing whether the conversion was exact if iconv returns + * E2BIG (due to a bug in the specification of iconv). + * An alternative approach is to assume that the output of + * iconv is never more than 4 times as long as the input, + * but I prefer to avoid that assumption if possible. + */ + +int iconvert(const char *fromcode, const char *tocode, + const char *from, size_t fromlen, + char **to, size_t *tolen) ; + +#endif /* HAVE_ICONV */ diff --git a/src/share/utf8/utf8.c b/src/share/utf8/utf8.c index fc2c69bc..f2bf5704 100644 --- a/src/share/utf8/utf8.c +++ b/src/share/utf8/utf8.c @@ -227,9 +227,7 @@ int utf8_decode(const char *from, char **to) #include <langinfo.h> #endif -int iconvert(const char *fromcode, const char *tocode, - const char *from, size_t fromlen, - char **to, size_t *tolen); +#include "iconvert.h" static const char *current_charset(void) { diff --git a/src/test_libFLAC/bitwriter.c b/src/test_libFLAC/bitwriter.c index 31fecf36..7bc23a87 100644 --- a/src/test_libFLAC/bitwriter.c +++ b/src/test_libFLAC/bitwriter.c @@ -22,6 +22,7 @@ #include "FLAC/assert.h" #include "private/bitwriter.h" /* from the libFLAC private include area */ +#include "bitwriter.h" #include <stdio.h> #include <string.h> /* for memcmp() */ diff --git a/src/test_libFLAC/format.c b/src/test_libFLAC/format.c index 5d68d03a..7ac115d0 100644 --- a/src/test_libFLAC/format.c +++ b/src/test_libFLAC/format.c @@ -22,6 +22,7 @@ #include "FLAC/assert.h" #include "FLAC/format.h" +#include "format.h" #include <stdio.h> static const char *true_false_string_[2] = { "false", "true" }; diff --git a/src/test_libFLAC/metadata.h b/src/test_libFLAC/metadata.h index e6baac7b..05515640 100644 --- a/src/test_libFLAC/metadata.h +++ b/src/test_libFLAC/metadata.h @@ -22,5 +22,7 @@ #include "FLAC/ordinals.h" FLAC__bool test_metadata(void); +FLAC__bool test_metadata_file_manipulation(void); +FLAC__bool test_metadata_object(void); #endif diff --git a/src/test_libFLAC/metadata_manip.c b/src/test_libFLAC/metadata_manip.c index 08c00ae1..5f00b8cc 100644 --- a/src/test_libFLAC/metadata_manip.c +++ b/src/test_libFLAC/metadata_manip.c @@ -42,6 +42,7 @@ #include "share/grabbag.h" #include "test_libs_common/file_utils_flac.h" #include "test_libs_common/metadata_utils.h" +#include "metadata.h" /****************************************************************************** @@ -184,7 +185,7 @@ static void delete_from_our_metadata_(unsigned position) * This wad of functions supports filename- and callback-based chain reading/writing. * Everything up to set_file_stats_() is copied from libFLAC/metadata_iterators.c */ -FLAC__bool open_tempfile_(const char *filename, FILE **tempfile, char **tempfilename) +static FLAC__bool open_tempfile_(const char *filename, FILE **tempfile, char **tempfilename) { static const char *tempfile_suffix = ".metadata_edit"; @@ -199,7 +200,7 @@ FLAC__bool open_tempfile_(const char *filename, FILE **tempfile, char **tempfile return true; } -void cleanup_tempfile_(FILE **tempfile, char **tempfilename) +static void cleanup_tempfile_(FILE **tempfile, char **tempfilename) { if(0 != *tempfile) { (void)fclose(*tempfile); @@ -213,7 +214,7 @@ void cleanup_tempfile_(FILE **tempfile, char **tempfilename) } } -FLAC__bool transport_tempfile_(const char *filename, FILE **tempfile, char **tempfilename) +static FLAC__bool transport_tempfile_(const char *filename, FILE **tempfile, char **tempfilename) { FLAC__ASSERT(0 != filename); FLAC__ASSERT(0 != tempfile); @@ -243,14 +244,14 @@ FLAC__bool transport_tempfile_(const char *filename, FILE **tempfile, char **tem return true; } -FLAC__bool get_file_stats_(const char *filename, struct stat *stats) +static FLAC__bool get_file_stats_(const char *filename, struct stat *stats) { FLAC__ASSERT(0 != filename); FLAC__ASSERT(0 != stats); return (0 == stat(filename, stats)); } -void set_file_stats_(const char *filename, struct stat *stats) +static void set_file_stats_(const char *filename, struct stat *stats) { struct utimbuf srctime; diff --git a/src/test_libFLAC/metadata_object.c b/src/test_libFLAC/metadata_object.c index 153f79ce..617248fb 100644 --- a/src/test_libFLAC/metadata_object.c +++ b/src/test_libFLAC/metadata_object.c @@ -23,6 +23,7 @@ #include "FLAC/assert.h" #include "FLAC/metadata.h" #include "test_libs_common/metadata_utils.h" +#include "metadata.h" #include <stdio.h> #include <stdlib.h> /* for malloc() */ #include <string.h> /* for memcmp() */ |