diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-07-08 13:13:17 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-07-08 13:13:17 +0300 |
commit | b6d80895594816fcb9f3a7f69a513f985db89272 (patch) | |
tree | a14599a1363bf1d9f7496dcc1b293e58207541cb /libid3tag | |
parent | 882dea6f58a2283dcdf0fafa0a9272abbece48d0 (diff) | |
download | idest-b6d80895594816fcb9f3a7f69a513f985db89272.tar.gz idest-b6d80895594816fcb9f3a7f69a513f985db89272.tar.bz2 |
Implement the --info option.
* NEWS: Update.
* configure.ac: Version 1.2.90
* doc/idest.texi: Document the --info option.
* libid3tag/file.c (id3_file_struct_ntags)
(id3_file_struct_iterate): New functions.
* libid3tag/file.h (id3_file_struct_ntags)
(id3_file_struct_iterate): New protos.
(id3_file_struct_iterator_t): New data type.
* src/cmdline.opt: New option --info.
* src/idest.h (info_id3): New proto.
(del_id3v2): Remove.
* src/idop.c (info_id3): New function.
* src/main.c (id3_mode): Add info_id3.
Diffstat (limited to 'libid3tag')
-rw-r--r-- | libid3tag/file.c | 27 | ||||
-rw-r--r-- | libid3tag/file.h | 11 |
2 files changed, 38 insertions, 0 deletions
diff --git a/libid3tag/file.c b/libid3tag/file.c index 1feb504..7c483ef 100644 --- a/libid3tag/file.c +++ b/libid3tag/file.c @@ -882,6 +882,33 @@ id3_file_update(struct id3_file *file) free(id3v2); id3_tag_options(file->primary, ~0, options); return result; } + +unsigned int +id3_file_struct_ntags(struct id3_file *file) +{ + assert(file); + return file->ntags; +} + +int +id3_file_struct_iterate(struct id3_file *file, + id3_file_struct_iterator_t fun, + void *data) +{ + int i; + int rc = 0; + + assert(file); + + for (i = 0; i < file->ntags; i++) { + struct filetag *tag = file->tags + i; + + rc = fun(tag->tag, tag->location, tag->length, data); + if (rc) + break; + } + return 0; +} diff --git a/libid3tag/file.h b/libid3tag/file.h index c948b84..304b654 100644 --- a/libid3tag/file.h +++ b/libid3tag/file.h @@ -19,7 +19,18 @@ * $Id: file.h,v 1.8 2004/01/23 09:41:32 rob Exp $ */ #ifndef LIBID3TAG_FILE_H # define LIBID3TAG_FILE_H +unsigned int id3_file_struct_ntags(struct id3_file *file); + +typedef int (*id3_file_struct_iterator_t)(struct id3_tag *tag, + unsigned long location, + id3_length_t length, + void *data); +int id3_file_struct_iterate(struct id3_file *file, + id3_file_struct_iterator_t fun, + void *data); + + #endif |