aboutsummaryrefslogtreecommitdiff
path: root/src/guile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/guile.c')
-rw-r--r--src/guile.c101
1 files changed, 2 insertions, 99 deletions
diff --git a/src/guile.c b/src/guile.c
index 7fe052f..802e053 100644
--- a/src/guile.c
+++ b/src/guile.c
@@ -1,5 +1,5 @@
/* This file is part of Idest.
- Copyright (C) 2009-2011, 2015 Sergey Poznyakoff
+ Copyright (C) 2009-2011, 2015, 2016 Sergey Poznyakoff
Idest is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -129,102 +129,6 @@ idest_guile_error(const char *subr,
SCM_BOOL_F));
}
-
-static SCM
-stringlist_to_scm(union id3_field *field, int genre)
-{
- unsigned i, nstrings = id3_field_getnstrings(field);
- SCM head = SCM_EOL, tail = SCM_EOL;
-
- for (i = 0; i < nstrings; i++) {
- SCM cell;
- id3_ucs4_t const *ucs4;
- char *str;
-
- ucs4 = id3_field_getstrings(field, i);
- if (!ucs4)
- continue;
- if (genre)
- ucs4 = id3_genre_name(ucs4);
- str = idest_ucs4_cvt(ucs4);
- cell = scm_cons(scm_from_locale_string(str),
- SCM_EOL);
- free(str);
- if (head == SCM_EOL)
- head = cell;
- else
- SCM_SETCDR(tail, cell);
- tail = cell;
- }
- return scm_string_append(head);
-}
-
-static SCM
-field_to_scm(union id3_field *field, int genre)
-{
- id3_ucs4_t const *ucs4;
- char *str;
- SCM ret = SCM_EOL;
-
- if (!field)
- return ret;
- switch (id3_field_type(field)) {
- case ID3_FIELD_TYPE_TEXTENCODING:
- case ID3_FIELD_TYPE_INT8:
- case ID3_FIELD_TYPE_INT16:
- case ID3_FIELD_TYPE_INT24:
- case ID3_FIELD_TYPE_INT32:
- case ID3_FIELD_TYPE_INT32PLUS:
- ret = scm_from_long(field->number.value);
- break;
-
- case ID3_FIELD_TYPE_LATIN1:
- case ID3_FIELD_TYPE_LATIN1FULL:
- /* FIXME */
- ret = scm_from_locale_string((char*)id3_field_getlatin1(field));
- break;
-
- case ID3_FIELD_TYPE_LATIN1LIST:
- /* FIXME */
- break;
-
- case ID3_FIELD_TYPE_STRING:
- ucs4 = id3_field_getstring(field);;
- if (ucs4) {
- str = idest_ucs4_cvt(ucs4);
- ret = scm_from_locale_string(str);
- free(str);
- } else
- ret = SCM_BOOL_F;
- break;
-
- case ID3_FIELD_TYPE_STRINGFULL:
- ucs4 = id3_field_getfullstring(field);
- if (ucs4) {
- str = idest_ucs4_cvt(ucs4);
- ret = scm_from_locale_string(str);
- free(str);
- } else
- ret = SCM_BOOL_F;
- break;
-
- case ID3_FIELD_TYPE_STRINGLIST:
- ret = stringlist_to_scm(field, genre);
- break;
-
- case ID3_FIELD_TYPE_LANGUAGE:
- case ID3_FIELD_TYPE_FRAMEID:
- case ID3_FIELD_TYPE_DATE:
- ret = scm_from_locale_string(field->immediate.value);
- break;
-
- case ID3_FIELD_TYPE_BINARYDATA:
- /* FIXME */
- ret = SCM_EOL;
- }
- return ret;
-}
-
static SCM
frame_dump_to_scm(struct id3_frame *frame)
{
@@ -232,7 +136,7 @@ frame_dump_to_scm(struct id3_frame *frame)
union id3_field *field;
SCM head = SCM_EOL, tail = SCM_EOL;
- for (i = 0; field = id3_frame_field(frame, i); i++) {
+ for (i = 0; (field = id3_frame_field(frame, i)); i++) {
SCM cell;
char *s = field_to_string(field, 0);
@@ -403,7 +307,6 @@ scm_to_tag(SCM scm, struct id3_tag *tag)
for (; !scm_is_null(scm) && scm_is_pair(scm); scm = SCM_CDR(scm)) {
int rc;
int rawdata = 0;
- struct id3_frametype const *frametype;
struct id3_frame *frame;
struct ed_item itm;
char *id;

Return to:

Send suggestions and report system problems to the System administrator.