include	clib.inc
include	confirm.inc

ID_DELETE	= 1	; return 1
ID_DELETEALL	= 2	; return 1 + update confirmflag
ID_SKIPFILE	= 3	; return 0
ID_CANCEL	= 0	; return -1

_TEXT	SEGMENT

confirm_delete_sub proc dist pascal public path:dword
	mov ax,1
	.if confirmflag & CFDIRECTORY
	    invoke confirm_delete, path, 1
	    .if ax == ID_DELETEALL
		and confirmflag,not (CFDIRECTORY or CFDELETEALL)
		mov ax,1
	    .elseif ax == ID_SKIPFILE
		mov ax,-1
	    .elseif ax != ID_DELETE
		xor ax,ax
	    .endif
	.endif
	ret
confirm_delete_sub endp

_TEXT	ENDS

	END
