aboutsummaryrefslogtreecommitdiff
path: root/src/idop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/idop.c')
-rw-r--r--src/idop.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/idop.c b/src/idop.c
index f7d9d4e..7b7f978 100644
--- a/src/idop.c
+++ b/src/idop.c
@@ -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);
}
+
+

Return to:

Send suggestions and report system problems to the System administrator.