contrib/ed/d.c
/*
 * This cleans up the LINE structures deleted and no longer accessible
 * to undo. It performs garbage clean-up on the now non-referenced
 * text in the buffer.
 */
This cleans up the LINE structures deleted and no longer accessible
to undo. It performs garbage clean-up on the now non-referenced
text in the buffer.
This cleans up the LINE structures deleted and no longer accessible to undo . It performs garbage clean - up on the now non - referenced text in the buffer .
void
d_do()
{
	struct d_layer *l_temp;
#ifdef DBI
	DBT l_db_key;
#endif
	LINE *l_temp2, *l_temp3;
	int l_flag;
	l_temp = d_stk;
	sigspecial++;
	do {
		l_flag = 0;
		l_temp2 = l_temp->begin;
		do {
			l_temp3 = l_temp2;
#ifdef STDIO
#endif
#ifdef DBI
			l_db_key.size = sizeof(recno_t);
			l_db_key.data = &(l_temp2->handle);
			(dbhtmp->del) (dbhtmp, &l_db_key, (u_int) 0);
#endif
#ifdef MEMORY
			free(l_temp2->handle);
#endif
			if ((l_temp->end) == l_temp2)
				l_flag = 1;
			l_temp2 = l_temp3->below;
			free(l_temp3);
		} while (l_flag == 0);
		d_stk = d_stk->next;
		free(l_temp);
		l_temp = d_stk;
	} while (d_stk);
	d_stk = NULL;		
	sigspecial--;
	if (sigint_flag && (!sigspecial))
		SIGINT_ACTION;
}
void d_do ( ) { struct d_layer * l_temp ; #ifdef DBI DBT l_db_key ; #endif LINE * l_temp2 , * l_temp3 ; int l_flag ; l_temp = d_stk ; sigspecial ++ ; do { l_flag = 0 ; l_temp2 = l_temp -> begin ; do { l_temp3 = l_temp2 ; #ifdef STDIO #endif #ifdef DBI l_db_key . size = sizeof ( recno_t ) ; l_db_key . data = & ( l_temp2 -> handle ) ; ( dbhtmp -> del ) ( dbhtmp , & l_db_key , ( u_int ) 0 ) ; #endif #ifdef MEMORY free ( l_temp2 -> handle ) ; #endif if ( ( l_temp -> end ) == l_temp2 ) l_flag = 1 ; l_temp2 = l_temp3 -> below ; free ( l_temp3 ) ; } while ( l_flag == 0 ) ; d_stk = d_stk -> next ; free ( l_temp ) ; l_temp = d_stk ; } while ( d_stk ) ; d_stk = NULL ; sigspecial -- ; if ( sigint_flag && ( ! sigspecial ) ) SIGINT_ACTION ; }
This cleans up the LINE structures deleted and no longer accessible
 to undo.
This cleans up the LINE structures deleted and no longer accessible to undo .
/* no garbage collection done currently */ /* garbage collection should be done iff the
			 * open was done as btree, not recno.
			 */ /* just to be sure */