예제 #1
0
PCS_API void pcs_fileinfo_destroy(PcsFileInfo *fi)
{
	if (fi->path) pcs_free(fi->path);
	if (fi->server_filename) pcs_free(fi->server_filename);
	if (fi->md5) pcs_free(fi->md5);
	if (fi->dlink) pcs_free(fi->dlink);
	if (fi->block_list) {
		char **p = fi->block_list;
		while(*p) {
			pcs_free(*p);
			p++;
		}
		pcs_free(fi->block_list);
	}
    if (fi->thumbs) {
        pcs_slist2_destroy(fi->thumbs);
    }
    pcs_free(fi);
}
예제 #2
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;
}