Subversion Repositories Kolibri OS

Rev

Rev 5725 | Rev 5727 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5725 Rev 5726
Line 27... Line 27...
27
        pkg->name = strdup(xmlpkg->Attribute(key_name));
27
        pkg->name = strdup(xmlpkg->Attribute(key_name));
28
        pkg->version = strdup(xmlpkg->Attribute(key_version));
28
        pkg->version = strdup(xmlpkg->Attribute(key_version));
Line 29... Line 29...
29
 
29
 
30
        xmle = xmlpkg->FirstChildElement(key_description);
30
        xmle = xmlpkg->FirstChildElement(key_description);
31
        pkg->description = strdup(xmle->Attribute(key_title));
-
 
Line -... Line 31...
-
 
31
        pkg->description = strdup(xmle->Attribute(key_title));
32
        xmle = xmlpkg->FirstChildElement(key_release);
32
 
-
 
33
        xmle = xmlpkg->FirstChildElement(key_release);
33
 
34
        pkg->filename = strdup(xmle->Attribute(key_file));
34
        pkg->filename = strdup(xmle->Attribute(key_file));
35
 
35
		list_add_tail(&pkg->list, &gr->packages);
36
        list_add_tail(&pkg->list, &gr->packages);
36
		xmlpkg = xmlpkg->NextSiblingElement();
37
		xmlpkg = xmlpkg->NextSiblingElement();
Line 67... Line 68...
67
	};
68
	};
Line 68... Line 69...
68
 
69
 
69
	return collection;
70
	return collection;
Line 70... Line -...
70
}
-
 
71
 
-
 
72
collection_t* load_collection_buffer(const char *buffer)
-
 
73
{
-
 
74
    TiXmlDocument doc;
-
 
75
    TiXmlElement *col;
-
 
76
    collection_t *collection = NULL;
-
 
77
 
-
 
78
    doc.Parse(buffer);
-
 
79
    col = doc.FirstChildElement(key_collection);
-
 
80
    if (col)
-
 
81
    {
-
 
82
        collection = (collection_t*)malloc(sizeof(collection_t));
-
 
83
        INIT_LIST_HEAD(&collection->groups);
-
 
84
 
-
 
85
        TiXmlElement* xmlgroup = col->FirstChildElement();
-
 
86
        if (xmlgroup)
-
 
87
        {
-
 
88
            pkg_group_t *gr;
-
 
89
 
-
 
90
            gr = (pkg_group_t*)malloc(sizeof(pkg_group_t));
-
 
Line 91... Line -...
91
            INIT_LIST_HEAD(&gr->list);
-
 
92
            INIT_LIST_HEAD(&gr->packages);
-
 
93
 
-
 
94
            gr->name = strdup(xmlgroup->Value());
-
 
95
            list_add_tail(&gr->list, &collection->groups);
-
 
96
            parse_group(gr, xmlgroup);
-
 
97
        };
-
 
98
    };
-