; @(#)cookiefs.dos/dinter.s
; Copyright (c) Julian F. Reschke, 28. November 1995
; All rights reserved
	
	.globl	FunctionTable, DriverName, ShowBanner
	.globl	InitDevice, DiskFree, SearchFirst, SearchNext
	.globl	OpenFile, CloseFile, DateAndTime, WriteFile
	.globl	ReadFile, FileAttributes, CreateFile, SeekFile, FCntl
	.globl	DPathConf, FXAttr, DOpenDir, DReadDir, DXReadDir
	.globl	DCloseDir, DRewindDir, DReadLabel, FDelete

	.globl	initfun, wrapdfree, wrapfsfirst, wrapfsnext, wrapfopen
	.globl	wrapfclose, wrapfdatime, wrapfwrite, wrapfread
	.globl	wrapfattrib, wrapfcreate, wrapfseek, wrapfcntl
	.globl	wrapdpathconf, wrapfxattr, wrapdopendir, wrapdreaddir
	.globl	wrapdclosedir, wrapdxreaddir, wrapdrewinddir
	.globl	wrapdreadlabel, wrapfdelete

	.text
	
	bsr		ShowBanner
	move.l	#FunctionTable+12,d0
	move.l	#DriverName,d1
	rts

initfun:
	movem.l	a0-a6/d1-d7,-(sp)
	move.w	d1,-(sp)
	move.w	d0,-(sp)
	bsr		InitDevice
	addq	#4,sp
	movem.l	(sp)+,a0-a6/d1-d7
; d1: filename conversion
; Bit 0: 0 = force upper case
; Bit 1: 0 = fully expand
; Bit 2: 0 = critical error handler reports EWRPRO
	moveq	#5,d1
	rts

wrapdfree:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		DiskFree
	lea		12(sp),sp
	rts

wrapfsfirst:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		SearchFirst
	lea		12(sp),sp
	rts

wrapfsnext:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		SearchNext
	lea		12(sp),sp
	rts

wrapfopen:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		OpenFile
	lea		12(sp),sp
	rts

wrapfclose:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		CloseFile
	lea		12(sp),sp
	rts

wrapfdatime:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		DateAndTime
	lea		12(sp),sp
	rts

wrapfwrite:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		WriteFile
	lea		12(sp),sp
	rts

wrapfread:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		ReadFile
	lea		12(sp),sp
	rts

wrapfattrib:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		FileAttributes
	lea		12(sp),sp
	rts

wrapfcreate:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		CreateFile
	lea		12(sp),sp
	rts

wrapfseek:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		SeekFile
	lea		12(sp),sp
	rts

wrapfcntl:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		FCntl
	lea		12(sp),sp
	rts

wrapfdelete:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		FDelete
	lea		12(sp),sp
	rts

wrapdpathconf:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		DPathConf
	lea		12(sp),sp
	rts

wrapfxattr:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		FXAttr
	lea		12(sp),sp
	rts

wrapdopendir:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		DOpenDir
	lea		12(sp),sp
	rts

wrapdreaddir:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		DReadDir
	lea		12(sp),sp
	rts

wrapdxreaddir:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		DXReadDir
	lea		12(sp),sp
	rts

wrapdclosedir:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		DCloseDir
	lea		12(sp),sp
	rts

wrapdrewinddir:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		DRewindDir
	lea		12(sp),sp
	rts

wrapdreadlabel:
	move.l	a5,-(sp)
	move.l	a4,-(sp)
	move.l	a3,-(sp)
	bsr		DReadLabel
	lea		12(sp),sp
	rts
