diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-07-18 02:42:15 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-07-18 02:42:15 +0300 |
commit | 094d1c24f08caf70fe7a329e6bf0699f354e0212 (patch) | |
tree | 71b8849e7a5af8e99e5e7fcea3afd58b395b4069 /src/idop.c | |
parent | fc93c8b69998abd65c6abbf35ab4efb8c6d68992 (diff) | |
download | idest-094d1c24f08caf70fe7a329e6bf0699f354e0212.tar.gz idest-094d1c24f08caf70fe7a329e6bf0699f354e0212.tar.bz2 |
Update docs. Accept --filter option with --list-frames.
Diffstat (limited to 'src/idop.c')
-rw-r--r-- | src/idop.c | 46 |
1 files changed, 46 insertions, 0 deletions
@@ -125,6 +125,52 @@ output_list_free() } } +#define DESCR_COLUMN 24 +static int +describe_frame(const struct idest_frametab *ft, void *data) +{ + struct id3_frametype const *frametype; + int n; + + frametype = id3_frametype_lookup(ft->id, 4); + assert(frametype != NULL); + printf("%s", ft->id); + n = 0; + if (ft->qc) { + int i; + for (i = 0; i < ft->qc; i++) + n += printf(":%s", ft->qv[i]); + } + while (++n < DESCR_COLUMN) + putchar(' '); + + printf("%s\n", frametype->description); + return 0; +} + +void +list_supported_frames(void) +{ + if (filter_list) { + gl_list_iterator_t itr; + const void *p; + + itr = gl_list_iterator(filter_list); + + while (gl_list_iterator_next(&itr, &p, NULL)) { + const struct ed_item *item = p; + const struct idest_frametab *ft = + idest_frame_lookup(item->id); + if (!ft) + error(1, 0, "no such frame: %s", + item->id); + describe_frame(ft, NULL); + } + gl_list_iterator_free(&itr); + } else + frametab_enumerate(describe_frame, NULL, 1); +} + void safe_id3_file_update_and_close(struct id3_file *file) { |