Logo Search packages:      
Sourcecode: libtheora version File versions

char* theora_comment_query ( theora_comment tc,
char *  tag,
int  count 

look up a comment value by tag

tc an initialized theora_comment structure
tag the tag to look up
count the instance of the tag. The same tag can appear multiple times, each with a distinct and ordered value, so an index is required to retrieve them all. Use theora_comment_query_count() to get the legal range for the count parameter
a pointer to the queried tag's value
Return values:
NULL if no matching tag is found

Definition at line 60 of file comment.c.

References theora_comment::comments, theora_comment_query(), and theora_comment::user_comments.

Referenced by theora_comment_query().

  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, "=");

    if(!tagcompare(tc->user_comments[i], fulltag, taglen)){
      if(count == found){
        /* We return a pointer to the data, not a copy */
        return tc->user_comments[i] + taglen;
  return NULL; /* didn't find anything */

Generated by  Doxygen 1.6.0   Back to index