rem: fprintf(stdout, "Deleting %s\n", fn);
add: fprintf(stdout, "Status: Deleting: %s\n", fn);
context: db_remove_file_xfer_using_keys(int softdel, char *key_files){	FILE	*fp;	DB		*dbp = db_syms[PAF_CROSS_REF];	DB		*dbp_by = db_syms[PAF_CROSS_REF_BY];	DBT		key;	DBT		by_key;	DBT		data;	LongString key_to;	LongString key_by;	LongString file_del_key;	LongString data_buf;	char	last_del_fname[MAXPATHLEN];	int flag;	char *pfn;	char *fn;	char *ref_type;	void *key_buf;	int key_len;	int line_cou = 1;	int delete_file = TRUE;		LongStringInit(&key_to,0);	LongStringInit(&data_buf,0);	LongStringInit(&key_by,0);	LongStringInit(&file_del_key,0);	if (!key_files || *key_files == '\0' || (fp = fopen(key_files, "r")) == NULL)		return;	/* Should never happen. */	if (!dbp)	{		dbp = create_table(PAF_CROSS_REF,O_RDWR,			db_cross_cachesize);		/* Open the table ! */		if (!dbp)			return;	}	if (!dbp_by)	{		dbp_by = create_table(PAF_CROSS_REF_BY,O_RDWR,			db_cross_cachesize);		/* Open the table ! */	}	for (last_del_fname[0] = '\0', line_cou = 1; file_del_key.fgets(&file_del_key, fp); line_cou++)	{		if (file_del_key.split(&file_del_key,			file_del_key.buf,			file_del_key.len,			TRUE,			(int)';',			-1) != 5)		{			continue;		}		fn = file_del_key.field_value[3];		if (strcmp(last_del_fname, fn) != 0)		{			fprintf(stdout, "Deleting %s\n", fn);			fflush(stdout);			strcpy(last_del_fname, fn);		}		ref_type = file_del_key.field_value[2];		/*		 * Remove references in the bodies of "md" | "mi" | "fu" | "su" !		 */		if ((ref_type[0] == 'm' && (ref_type[1] == 'd' || ref_type[1] == 'i')) ||			((ref_type[0] == 'f' || ref_type[0] == 's') && ref_type[1] == 'u'))		{			key_to.copystrings(&key_to,				file_del_key.field_value[0], DB_FLDSEP_STR,				file_del_key.field_value[1], DB_FLDSEP_STR,				file_del_key.field_value[2], DB_FLDSEP_STR,				NULL);						key.data = (void *)key_to.buf;			key.size = key_to.len;			key_buf = key_to.buf;			key_len = key_to.len;			for (flag = R_CURSOR; dbp->seq(dbp,&key,&data,flag) == 0; flag = R_NEXT)			{				if ((int)key.size < key_len || memcmp(key_buf, key.data, key_len) != 0)				{					break;				}				/* The filename starts after the last separator in the key. */				for (pfn = (char *)key.data + key.size - 1; pfn > (char*)key.data && *pfn != DB_FLDSEP_CHR; pfn--);				if (strcmp(pfn + 1, fn) != 0)				{					continue;		/* An other file, don't delete the record! */				}				/* Create the key for the "by" record !*/				data_buf.split(&data_buf,					key.data, key.size - 1, FALSE, DB_FLDSEP_CHR, -1);				ref_type = data_buf.field_value[5];								/*				 * There is no xref "by" info for local variables. !				 */				if (dbp_by && (ref_type[0] != 'l' || ref_type[1] != 'v'))				{					key_by.copy(&key_by,						data_buf.field_value[3],						data_buf.field_size[3] + data_buf.field_size[4] + data_buf.field_size[5] + 3);					key_by.append(&key_by,						data_buf.field_value[0],						data_buf.field_size[0] + data_buf.field_size[1] + data_buf.field_size[2] + 3);					key_by.append(&key_by,						data_buf.field_value[6],						data_buf.field_size[6] + data_buf.field_size[7] + data_buf.field_size[8] + 2);					by_key.data = (void *)key_by.buf;					by_key.size = key_by.len + 1;					if (dbp_by->del(dbp_by,&by_key,0) != 0)					{						fprintf(stderr,"Delete (BY) not found <%s>\n",(char *)by_key.data);					}				}				dbp->del(dbp,&key,DEL_SEQ_VALUE);			}		}	}	fclose(fp);	file_del_key.free(&file_del_key);	key_to.free(&key_to);	data_buf.free(&data_buf);	key_by.free(&key_by);	/* Delete the file only if its contains was ok, otherwise we need a chance	 * too be able to look. */	if (delete_file)		unlink(key_files);}