/* ====================================================================
 * FTD4Linux Software License, Version 1.0
 *
 * Copyright (c) 2000-2004 The FTD4Linux Development Team.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by the
 *        FTD4Linux Development Team (http://www.ftd4linux.2y.net/)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "FTD" and "FTD4Linux" must
 *    not be used to endorse or promote products derived from this
 *    software without prior written permission. For written
 *    permission, please contact alguno@ftd4linux.2y.net.
 *
 * 5. Products derived from this software may not be called "FTD4Linux",
 *    nor may "FTD4Linux" appear in their name, without prior written
 *    permission of the FTD4Linux Development Team.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE FTD4LINUX DEVELOPMENT TEAM OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#include "ftd4linux.h"
#include "ftd_app_core.h"

/**
 * Initialiseert alle tags.
 * Deze functie wordt aangroepen vanuit ::ftd_app_core_init.
 */
void
ftd_tags_init(void)
{
    FtdTag *tag;
    FtdTag *tagParent;

    g_assert(core);
    g_assert(core->tags == NULL);

    /* ==================
        Beeld -> Formaat
       ==================
    */
    tagParent = g_malloc0(sizeof(FtdTag));
    tagParent->cat = 0;
    tagParent->parent = NULL;
    tagParent->code = NULL;
    tagParent->name = ftd_string_new("Formaat");
    core->tags = ftd_list_append(core->tags, tagParent);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a0");
    tag->name = ftd_string_new("DivX");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a1");
    tag->name = ftd_string_new("WMV");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a2");
    tag->name = ftd_string_new("MPG");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a3");
    tag->name = ftd_string_new("DVD");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a4");
    tag->name = ftd_string_new("HDTV");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a5");
    tag->name = ftd_string_new("Afbeeldingen");
    core->tags = ftd_list_append(core->tags, tag);

    /* ==================
        Beeld -> Bron
       ==================
    */
    tagParent = g_malloc0(sizeof(FtdTag));
    tagParent->cat = 0;
    tagParent->parent = NULL;
    tagParent->code = NULL;
    tagParent->name = ftd_string_new("Bron");
    core->tags = ftd_list_append(core->tags, tagParent);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b0");
    tag->name = ftd_string_new("CAM");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b1");
    tag->name = ftd_string_new("(S)VCD");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b2");
    tag->name = ftd_string_new("Promo-DVD");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b3");
    tag->name = ftd_string_new("Retail-DVD");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b4");
    tag->name = ftd_string_new("TV");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b5");
    tag->name = ftd_string_new("Anders");
    core->tags = ftd_list_append(core->tags, tag);

    /* ==================
        Beeld -> Ondertitels
       ==================
    */
    tagParent = g_malloc0(sizeof(FtdTag));
    tagParent->cat = 0;
    tagParent->parent = NULL;
    tagParent->code = NULL;
    tagParent->name = ftd_string_new("Ondertitels");
    core->tags = ftd_list_append(core->tags, tagParent);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c0");
    tag->name = ftd_string_new("Geen");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c1");
    tag->name = ftd_string_new("Nederlands (los)");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c2");
    tag->name = ftd_string_new("Nederlands (ingebakken)");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c3");
    tag->name = ftd_string_new("Engels (los)");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c4");
    tag->name = ftd_string_new("Engels (ingebakken)");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c5");
    tag->name = ftd_string_new("Anders");
    core->tags = ftd_list_append(core->tags, tag);

    /* ==================
        Beeld -> Genre
       ==================
    */
    tagParent = g_malloc0(sizeof(FtdTag));
    tagParent->cat = 0;
    tagParent->parent = NULL;
    tagParent->code = NULL;
    tagParent->name = ftd_string_new("Genre");
    core->tags = ftd_list_append(core->tags, tagParent);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d0");
    tag->name = ftd_string_new("Actie");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d1");
    tag->name = ftd_string_new("Avontuur");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d2");
    tag->name = ftd_string_new("Animatie");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d3");
    tag->name = ftd_string_new("Cabaret");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d4");
    tag->name = ftd_string_new("Komedie");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d5");
    tag->name = ftd_string_new("Misdaad");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d6");
    tag->name = ftd_string_new("Documentaire");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d7");
    tag->name = ftd_string_new("Drama");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d8");
    tag->name = ftd_string_new("Familiefilm");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d9");
    tag->name = ftd_string_new("Fantasiefilm");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d10");
    tag->name = ftd_string_new("Film Noir");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d11");
    tag->name = ftd_string_new("TV Shows/Series");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d12");
    tag->name = ftd_string_new("Horror");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d13");
    tag->name = ftd_string_new("Muziek");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d14");
    tag->name = ftd_string_new("Musical");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d15");
    tag->name = ftd_string_new("Mysterie");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d16");
    tag->name = ftd_string_new("Romantiek");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d17");
    tag->name = ftd_string_new("Science Fiction");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d18");
    tag->name = ftd_string_new("Sport");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d19");
    tag->name = ftd_string_new("Korte film");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d20");
    tag->name = ftd_string_new("Thriller");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d21");
    tag->name = ftd_string_new("Oorlog");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d22");
    tag->name = ftd_string_new("Western");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d23");
    tag->name = ftd_string_new("Erotiek (hetero)");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d24");
    tag->name = ftd_string_new("Erotiek (gay mannen)");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d25");
    tag->name = ftd_string_new("Erotiek (gay vrouwen)");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d26");
    tag->name = ftd_string_new("Erotiek (bi)");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 0;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d27");
    tag->name = ftd_string_new("Anders");
    core->tags = ftd_list_append(core->tags, tag);

    /* ==================
        Geluid -> Formaat
       ==================
    */
    tagParent = g_malloc0(sizeof(FtdTag));
    tagParent->cat = 1;
    tagParent->parent = NULL;
    tagParent->code = NULL;
    tagParent->name = ftd_string_new("Formaat");
    core->tags = ftd_list_append(core->tags, tagParent);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a0");
    tag->name = ftd_string_new("MP3");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a1");
    tag->name = ftd_string_new("WMA");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a2");
    tag->name = ftd_string_new("WAV");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a3");
    tag->name = ftd_string_new("OGG");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a4");
    tag->name = ftd_string_new("Lossless");
    core->tags = ftd_list_append(core->tags, tag);

    /* ==================
        Geluid -> Bron
       ==================
    */
    tagParent = g_malloc0(sizeof(FtdTag));
    tagParent->cat = 1;
    tagParent->parent = NULL;
    tagParent->code = NULL;
    tagParent->name = ftd_string_new("Bron");
    core->tags = ftd_list_append(core->tags, tagParent);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b0");
    tag->name = ftd_string_new("CD");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b1");
    tag->name = ftd_string_new("Radio");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b2");
    tag->name = ftd_string_new("Eigen compilatie");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b3");
    tag->name = ftd_string_new("DVD");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b4");
    tag->name = ftd_string_new("Anders");
    core->tags = ftd_list_append(core->tags, tag);

    /* ==================
        Geluid -> Bitrate
       ==================
    */
    tagParent = g_malloc0(sizeof(FtdTag));
    tagParent->cat = 1;
    tagParent->parent = NULL;
    tagParent->code = NULL;
    tagParent->name = ftd_string_new("Bitrate");
    core->tags = ftd_list_append(core->tags, tagParent);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c0");
    tag->name = ftd_string_new("variabele bitrate");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c1");
    tag->name = ftd_string_new("lager dan 96kbit");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c2");
    tag->name = ftd_string_new("92kbit");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c3");
    tag->name = ftd_string_new("128kbit");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c4");
    tag->name = ftd_string_new("160kbit");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c5");
    tag->name = ftd_string_new("192kbit");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c6");
    tag->name = ftd_string_new("256kbit");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c7");
    tag->name = ftd_string_new("320kbit");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c8");
    tag->name = ftd_string_new("Lossless");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c9");
    tag->name = ftd_string_new("Anders");
    core->tags = ftd_list_append(core->tags, tag);

    /* ==================
        Geluid -> Genre
       ==================
    */
    tagParent = g_malloc0(sizeof(FtdTag));
    tagParent->cat = 1;
    tagParent->parent = NULL;
    tagParent->code = NULL;
    tagParent->name = ftd_string_new("Genre");
    core->tags = ftd_list_append(core->tags, tagParent);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d0");
    tag->name = ftd_string_new("Blues/Folk");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d1");
    tag->name = ftd_string_new("Compilaties/Box sets");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d2");
    tag->name = ftd_string_new("Cabaret");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d3");
    tag->name = ftd_string_new("Dance");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d4");
    tag->name = ftd_string_new("Diversen");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d5");
    tag->name = ftd_string_new("Hardcore/Hardstyle");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d6");
    tag->name = ftd_string_new("Internationaal");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d7");
    tag->name = ftd_string_new("Jazz");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d8");
    tag->name = ftd_string_new("Kinder/Jeugd");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d9");
    tag->name = ftd_string_new("Klassiek");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d10");
    tag->name = ftd_string_new("Kleinkunst");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d11");
    tag->name = ftd_string_new("Nederlands");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d12");
    tag->name = ftd_string_new("New Age");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d13");
    tag->name = ftd_string_new("Pop");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d14");
    tag->name = ftd_string_new("R&B/Soul");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d15");
    tag->name = ftd_string_new("Rap/Hip hop");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d16");
    tag->name = ftd_string_new("Reggae");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d17");
    tag->name = ftd_string_new("Religieus");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d18");
    tag->name = ftd_string_new("Rock");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d19");
    tag->name = ftd_string_new("Soundtracks/Musical");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 1;
    tag->parent = tagParent;
    tag->code = ftd_string_new("d20");
    tag->name = ftd_string_new("Anders");
    core->tags = ftd_list_append(core->tags, tag);

    /* ==================
        Spelletjes -> Platform
       ==================
    */
    tagParent = g_malloc0(sizeof(FtdTag));
    tagParent->cat = 2;
    tagParent->parent = NULL;
    tagParent->code = NULL;
    tagParent->name = ftd_string_new("Platform");
    core->tags = ftd_list_append(core->tags, tagParent);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a0");
    tag->name = ftd_string_new("Windows");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a1");
    tag->name = ftd_string_new("Macintosh");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a2");
    tag->name = ftd_string_new("Linux");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a3");
    tag->name = ftd_string_new("Playstation (PSX)");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a4");
    tag->name = ftd_string_new("Playstation 2 (PS2)");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a5");
    tag->name = ftd_string_new("Playstation Portable (PSP)");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a6");
    tag->name = ftd_string_new("XBox");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a7");
    tag->name = ftd_string_new("Dreamcast");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a8");
    tag->name = ftd_string_new("Gameboy Advance");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a9");
    tag->name = ftd_string_new("Gamecube");
    core->tags = ftd_list_append(core->tags, tag);

    /* ==================
        Spelletjes -> Formaat
       ==================
    */
    tagParent = g_malloc0(sizeof(FtdTag));
    tagParent->cat = 2;
    tagParent->parent = NULL;
    tagParent->code = NULL;
    tagParent->name = ftd_string_new("Formaat");
    core->tags = ftd_list_append(core->tags, tagParent);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b0");
    tag->name = ftd_string_new("ISO");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b1");
    tag->name = ftd_string_new("Rip");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b2");
    tag->name = ftd_string_new("DVD");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b3");
    tag->name = ftd_string_new("Addon");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b4");
    tag->name = ftd_string_new("Anders");
    core->tags = ftd_list_append(core->tags, tag);

    /* ==================
        Spelletjes -> Genre
       ==================
    */
    tagParent = g_malloc0(sizeof(FtdTag));
    tagParent->cat = 2;
    tagParent->parent = NULL;
    tagParent->code = NULL;
    tagParent->name = ftd_string_new("Genre");
    core->tags = ftd_list_append(core->tags, tagParent);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c0");
    tag->name = ftd_string_new("Actie");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c1");
    tag->name = ftd_string_new("Avontuur");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c2");
    tag->name = ftd_string_new("Strategie");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c3");
    tag->name = ftd_string_new("Rollenspel");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c4");
    tag->name = ftd_string_new("Simulatie");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c5");
    tag->name = ftd_string_new("Race");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c6");
    tag->name = ftd_string_new("Sport");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c7");
    tag->name = ftd_string_new("Kinder/Jeugd");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c8");
    tag->name = ftd_string_new("Puzzel");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 2;
    tag->parent = tagParent;
    tag->code = ftd_string_new("c9");
    tag->name = ftd_string_new("Anders");
    core->tags = ftd_list_append(core->tags, tag);

    /* ==================
        Applicaties -> Platform
       ==================
    */
    tagParent = g_malloc0(sizeof(FtdTag));
    tagParent->cat = 3;
    tagParent->parent = NULL;
    tagParent->code = NULL;
    tagParent->name = ftd_string_new("Platform");
    core->tags = ftd_list_append(core->tags, tagParent);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a0");
    tag->name = ftd_string_new("Windows");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a1");
    tag->name = ftd_string_new("Macintosh");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a2");
    tag->name = ftd_string_new("Linux");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a3");
    tag->name = ftd_string_new("OS2");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a4");
    tag->name = ftd_string_new("PDA");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("a5");
    tag->name = ftd_string_new("Navigatiesystemen");
    core->tags = ftd_list_append(core->tags, tag);

    /* ==================
        Applicaties -> Genre
       ==================
    */
    tagParent = g_malloc0(sizeof(FtdTag));
    tagParent->cat = 3;
    tagParent->parent = NULL;
    tagParent->code = NULL;
    tagParent->name = ftd_string_new("Genre");
    core->tags = ftd_list_append(core->tags, tagParent);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b0");
    tag->name = ftd_string_new("Audio bewerking");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b1");
    tag->name = ftd_string_new("Video bewerking");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b2");
    tag->name = ftd_string_new("Grafisch design");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b3");
    tag->name = ftd_string_new("CD/DVD Tools");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b4");
    tag->name = ftd_string_new("Media spelers");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b5");
    tag->name = ftd_string_new("Rippers & Encoders");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b6");
    tag->name = ftd_string_new("Plugins");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b7");
    tag->name = ftd_string_new("Database tools");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b8");
    tag->name = ftd_string_new("Email software");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b9");
    tag->name = ftd_string_new("Fotobewerking");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b10");
    tag->name = ftd_string_new("Screensavers");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b11");
    tag->name = ftd_string_new("Skin software");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b12");
    tag->name = ftd_string_new("Drivers");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b13");
    tag->name = ftd_string_new("Browsers");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b14");
    tag->name = ftd_string_new("Download managers");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b15");
    tag->name = ftd_string_new("File sharing");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b16");
    tag->name = ftd_string_new("Usenet software");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b17");
    tag->name = ftd_string_new("RSS Readers");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b18");
    tag->name = ftd_string_new("FTP software");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b19");
    tag->name = ftd_string_new("Firewalls");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b20");
    tag->name = ftd_string_new("Antivirus software");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b21");
    tag->name = ftd_string_new("Antispyware software");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b22");
    tag->name = ftd_string_new("Optimalisatiesoftware");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b23");
    tag->name = ftd_string_new("Beveiligingssoftware");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b24");
    tag->name = ftd_string_new("Systeemsoftware");
    core->tags = ftd_list_append(core->tags, tag);

    tag = g_malloc0(sizeof(FtdTag));
    tag->cat = 3;
    tag->parent = tagParent;
    tag->code = ftd_string_new("b25");
    tag->name = ftd_string_new("Anders");
    core->tags = ftd_list_append(core->tags, tag);
}

/**
 * Geeft alle tags vrij.
 * Deze functie wordt aangeroepen vanuit ::ftd_app_core_cleanup.
 */
void
ftd_tags_free(void)
{
    FtdList *list;

    g_assert(core);

    list = core->tags;
    while (list) {
        FtdTag *tag = ftd_list_value(list);

        if (tag->code) {
            ftd_string_free(tag->code);
        }

        if (tag->name) {
            ftd_string_free(tag->name);
        }

        g_free(tag);

        list = ftd_list_next(list);
    }

    ftd_list_free(core->tags);
    core->tags = NULL;
}

/**
 * Geeft de lijst van tags terug.
 * Geef het resultaat niet vrij!
 *
 * @return  Een lijst met ::FtdTag pointers naar alle tags.
 */
const FtdList *
ftd_get_tags(void)
{
    return core->tags;
}

/**
 * Geeft de tag behorende bij een tag-code weer.
 * Geef het resultaat niet vrij!
 *
 * @arg     code        De tag-code die gezocht wordt.
 * @arg     cat         De FTD-categorie binnen welke gezocht wordt.
 *
 * @return  De tag met code als tag-code en cat als FTD-categorie.
 */
const FtdTag *
ftd_tag_find(FtdString *code, int cat)
{
    FtdList *list;

    g_assert(core);

    list = core->tags;
    while (list) {
        FtdTag *tag = ftd_list_value(list);

        if (tag->code) {
            if (strcmp(ftd_string_value(tag->code), ftd_string_value(code)) == 0 && tag->cat == cat) {
                return tag;
            }
        }

        list = ftd_list_next(list);
    }

    return NULL;
}

/**
 * Geeft een lijst met alle tags voor een FTD-categorie.
 * Geef van het resultaat alleen de lijst zelf vrij en niet de tags!
 *
 * @arg     cat     De FTD-categorie waarbinnen gezocht wordt.
 *
 * @return  Een lijst met ::FtdTag pointers naar de alle tags binnen FTD-categorie cat.
 */
FtdList *
ftd_tag_get_tags_in_cat(int cat)
{
    FtdList *ret = NULL;
    FtdList *list;

    list = core->tags;
    while (list) {
        FtdTag *tag = ftd_list_value(list);

        if (tag->cat == cat) {
            ret = ftd_list_append(ret, tag);
        }

        list = ftd_list_next(list);
    }

    return ret;
}
