Пример #1
0
PCS_API PcsSList2 *pcs_fileinfo_add_thumb(PcsFileInfo *fi, const char *name, const char *url)
{
    PcsSList2 *n;
    if (fi->thumbs) {
        n = pcs_slist2_add_ex(fi->thumbs, name, strlen(name), url, strlen(url));
    }
    else {
        n = fi->thumbs = pcs_slist2_create_ex(name, strlen(name), url, strlen(url));
    }
    return n;
}
Пример #2
0
PCS_API PcsSList2 *pcs_slist2_add_ex(PcsSList2 *slist, const char *src1, int len1, const char *src2, int len2)
{
	PcsSList2 *p = pcs_slist2_create_ex(src1, len1, src2, len2);
	if (p) {
		while(slist->next) {
			slist = slist->next;
		}
		slist->next = p;
		p->next = 0;
	}
	return p;
}
Пример #3
0
PCS_API PcsSList2 *pcs_slist2_clone(PcsSList2 *slist)
{
	PcsSList2 *newlist = 0, *p = slist, *n = 0;
    while (p) {
        if (n) {
            n = pcs_slist2_add_ex(n, p->string1, strlen(p->string1), p->string2, strlen(p->string2));
        }
        else {
            n = newlist = pcs_slist2_create_ex(p->string1, strlen(p->string1), p->string2, strlen(p->string2));
        }
        if (!n) {
            pcs_slist2_destroy(newlist);
            newlist = 0;
            break;
        }
        p = p->next;
    }
    return newlist;
}