summaryrefslogtreecommitdiffabout
path: root/libid3tag
authorSergey Poznyakoff <gray@gnu.org.ua>2011-07-08 10:13:17 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2011-07-08 10:13:17 (GMT)
commitb6d80895594816fcb9f3a7f69a513f985db89272 (patch) (side-by-side diff)
treea14599a1363bf1d9f7496dcc1b293e58207541cb /libid3tag
parent882dea6f58a2283dcdf0fafa0a9272abbece48d0 (diff)
downloadidest-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') (more/less context) (ignore whitespace changes)
-rw-r--r--libid3tag/file.c27
-rw-r--r--libid3tag/file.h11
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
@@ -885,3 +885,30 @@ id3_file_update(struct id3_file *file)
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
@@ -22,4 +22,15 @@
#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

Return to:

Send suggestions and report system problems to the System administrator.