diff options
Diffstat (limited to 'apps/codecs/Tremor/info.c')
-rw-r--r-- | apps/codecs/Tremor/info.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/apps/codecs/Tremor/info.c b/apps/codecs/Tremor/info.c index c8d9651bd4..c0bd0ae990 100644 --- a/apps/codecs/Tremor/info.c +++ b/apps/codecs/Tremor/info.c | |||
@@ -41,54 +41,6 @@ void vorbis_comment_init(vorbis_comment *vc){ | |||
41 | memset(vc,0,sizeof(*vc)); | 41 | memset(vc,0,sizeof(*vc)); |
42 | } | 42 | } |
43 | 43 | ||
44 | /* This is more or less the same as strncasecmp - but that doesn't exist | ||
45 | * everywhere, and this is a fairly trivial function, so we include it */ | ||
46 | static int tagcompare(const char *s1, const char *s2, int n){ | ||
47 | int c=0; | ||
48 | while(c < n){ | ||
49 | if(toupper(s1[c]) != toupper(s2[c])) | ||
50 | return !0; | ||
51 | c++; | ||
52 | } | ||
53 | return 0; | ||
54 | } | ||
55 | |||
56 | char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count){ | ||
57 | long i; | ||
58 | int found = 0; | ||
59 | int taglen = strlen(tag)+1; /* +1 for the = we append */ | ||
60 | char *fulltag = (char *)alloca(taglen+ 1); | ||
61 | |||
62 | strcpy(fulltag, tag); | ||
63 | strcat(fulltag, "="); | ||
64 | |||
65 | for(i=0;i<vc->comments;i++){ | ||
66 | if(!tagcompare(vc->user_comments[i], fulltag, taglen)){ | ||
67 | if(count == found) | ||
68 | /* We return a pointer to the data, not a copy */ | ||
69 | return vc->user_comments[i] + taglen; | ||
70 | else | ||
71 | found++; | ||
72 | } | ||
73 | } | ||
74 | return NULL; /* didn't find anything */ | ||
75 | } | ||
76 | |||
77 | int vorbis_comment_query_count(vorbis_comment *vc, char *tag){ | ||
78 | int i,count=0; | ||
79 | int taglen = strlen(tag)+1; /* +1 for the = we append */ | ||
80 | char *fulltag = (char *)alloca(taglen+1); | ||
81 | strcpy(fulltag,tag); | ||
82 | strcat(fulltag, "="); | ||
83 | |||
84 | for(i=0;i<vc->comments;i++){ | ||
85 | if(!tagcompare(vc->user_comments[i], fulltag, taglen)) | ||
86 | count++; | ||
87 | } | ||
88 | |||
89 | return count; | ||
90 | } | ||
91 | |||
92 | void vorbis_comment_clear(vorbis_comment *vc){ | 44 | void vorbis_comment_clear(vorbis_comment *vc){ |
93 | if(vc){ | 45 | if(vc){ |
94 | long i; | 46 | long i; |