1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

some import functionality

This commit is contained in:
Werner Koch 1998-02-16 20:05:02 +00:00
parent f477447d9a
commit 82464369f6
45 changed files with 1299 additions and 324 deletions

View file

@ -61,7 +61,7 @@ release_kbnode( KBNODE n )
* Note: This does only work with walk_kbnode!!
*/
void
delete_kbnode( KBNODE root, KBNODE node )
delete_kbnode( KBNODE node )
{
node->private_flag |= 1;
}
@ -196,3 +196,29 @@ clear_kbnode_flags( KBNODE n )
}
}
/****************
* Commit changes made to the kblist at ROOT. Note that ROOT my change,
* and it is therefor passed by reference.
* The function has the effect of removing all nodes marked as deleted.
* returns true, if any node has been changed
*/
int
commit_kbnode( KBNODE *root )
{
KBNODE n, n2;
int changed = 0;
for(n=*root; n; n = n2 ) {
n2 = n->next;
if( (n->private_flag & 1) ) {
if( n == *root )
*root = n2;
free_packet( n->pkt );
m_free( n );
changed = 1;
}
}
return changed;
}