int vorbis_comment_query_count(vorbis_comment *vc, char *tag){ int i,count=0; int taglen = strlen(tag)+1; /* +1 for the = we append */ char *fulltag = (char *)alloca(taglen+1); strcpy(fulltag,tag); strcat(fulltag, "="); for(i=0;i<vc->comments;i++){ if(!tagcompare(vc->user_comments[i], fulltag, taglen)) count++; } return count; }
int theora_comment_query_count(theora_comment *tc, char *tag){ int i,count=0; int taglen = strlen(tag)+1; /* +1 for the = we append */ char *fulltag = _ogg_malloc(taglen+1); strcpy(fulltag,tag); strcat(fulltag, "="); for(i=0;i<tc->comments;i++){ if(!tagcompare(tc->user_comments[i], fulltag, taglen)) count++; } _ogg_free(fulltag); return count; }
int BURGERCALL vorbis_comment_query_count(vorbis_comment *vc, char *tag){ int i,count=0; int taglen = strlen(tag)+1; /* +1 for the = we append */ char *fulltag = static_cast<char *>(AllocAPointer(taglen+1)); strcpy(fulltag,tag); strcat(fulltag, "="); for(i=0;i<vc->comments;i++){ if(!tagcompare(vc->user_comments[i], fulltag, taglen)) { count++; } } DeallocAPointer(fulltag); return count; }
char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count){ long i; int found = 0; int taglen = strlen(tag)+1; /* +1 for the = we append */ char *fulltag = (char *)alloca(taglen+ 1); strcpy(fulltag, tag); strcat(fulltag, "="); for(i=0;i<vc->comments;i++){ if(!tagcompare(vc->user_comments[i], fulltag, taglen)){ if(count == found) /* We return a pointer to the data, not a copy */ return vc->user_comments[i] + taglen; else found++; } } return NULL; /* didn't find anything */ }
char *theora_comment_query(theora_comment *tc, char *tag, int count){ long i; int found = 0; int taglen = strlen(tag)+1; /* +1 for the = we append */ char *fulltag = _ogg_malloc(taglen+ 1); strcpy(fulltag, tag); strcat(fulltag, "="); for(i=0;i<tc->comments;i++){ if(!tagcompare(tc->user_comments[i], fulltag, taglen)){ if(count == found){ _ogg_free(fulltag); /* We return a pointer to the data, not a copy */ return tc->user_comments[i] + taglen; } else found++; } } _ogg_free(fulltag); return NULL; /* didn't find anything */ }
char *BURGERCALL vorbis_comment_query(vorbis_comment *vc, char *tag, int count) { long i; int found = 0; int taglen = strlen(tag)+1; /* +1 for the = we append */ char *fulltag = static_cast<char *>(AllocAPointer(taglen+ 1)); strcpy(fulltag, tag); strcat(fulltag, "="); for(i=0;i<vc->comments;i++){ if(!tagcompare(vc->user_comments[i], fulltag, taglen)){ if(count == found) { /* We return a pointer to the data, not a copy */ DeallocAPointer(fulltag); return vc->user_comments[i] + taglen; } else { found++; } } } DeallocAPointer(fulltag); return NULL; /* didn't find anything */ }