diff options
Diffstat (limited to 'src/idop.c')
-rw-r--r-- | src/idop.c | 29 |
1 files changed, 28 insertions, 1 deletions
@@ -15,6 +15,7 @@ along with Idest. If not, see <http://www.gnu.org/licenses/>. */ #include "idest.h" +#include <file.h> #include <signal.h> void @@ -281,7 +282,33 @@ query_tags(const char *name) id3_file_close(file); } +static int +prinfo(struct id3_tag *tag, unsigned long location, + id3_length_t length, void *data) +{ + unsigned int ver = id3_tag_version(tag); + printf("version: %u.%u\n", + ID3_TAG_VERSION_MAJOR(ver), + ID3_TAG_VERSION_MINOR(ver)); + printf("offset: %lu\n", location); + printf("length: %lu\n", length); + return 0; +} + void -del_id3v2(const char *name) +info_id3(const char *name) { + struct id3_file *file; + unsigned long ntags; + + file = id3_file_open(name, ID3_FILE_MODE_READONLY); + if (!file) + error(1, errno, "cannot open file %s", name); + ntags = id3_file_struct_ntags(file); + printf("file: %s\n", name); + printf("ntags: %lu\n", ntags); + id3_file_struct_iterate(file, prinfo, NULL); + id3_file_close(file); } + + |