include	clib.inc
include	io.inc
include	dir.inc
include	string.inc
include	errno.inc
include	wsub.inc

PPROC	wsopenarch, wsub:dword
local	arcname[WMAXPATH]:byte
	lea	ax,arcname
	push	ss
	push	ax
	les	bx,wsub
	pushm	es:[bx.ws_path]
	pushm	es:[bx.ws_file]
	call	strfcat
	push	dx
	push	ax
	push	_A_ARCH
	push	M_RDONLY
	push	A_OPEN
	call	osopen
	cmp	ax,-1
	jne	wsopenarch_end
	mov	dx,ss
	lea	ax,arcname
	call	eropen
    wsopenarch_end:
	ret
PEND	wsopenarch

	END
