Source

libtaginfo / tests / ctest_read / main.c

Full commit
#include <stdio.h>
#include <stdlib.h>
#include <taginfo_c.h>

int main(void)
{
    TagInfo_Info *info;
    
    char val[200] = TESTDIR "samples/sample_no-tags.flac";
    info = taginfo_info_factory_make(val);
    
    if(info == NULL)
        return 1; //EXIT_FAILURE
    
    taginfo_info_enable_string_management(1);
    
    if(taginfo_info_read(info)) {
        char* name = taginfo_info_get_title(info);
        char* album = taginfo_info_get_album(info);
        /*free(name);*/
        char* comment = taginfo_info_get_comment(info);
        char* composer = taginfo_info_get_composer(info);
        /*free(comment);*/
    }
    else {
        taginfo_info_free(info);
        return 1; //EXIT_FAILURE
    }
    taginfo_info_free_strings();
    taginfo_info_free(info);
    return 0; //EXIT_SUCCESS
}