TABLE OF CONTENTS

JanusHandler/AddService
JanusHandler/AllocJRemember
JanusHandler/AllocMem
JanusHandler/AllocServiceMem
JanusHandler/AttachJRemember
JanusHandler/CallService
JanusHandler/DeleteService
JanusHandler/FreeJRemember
JanusHandler/FreeMem
JanusHandler/FreeServiceMem
JanusHandler/GetBase
JanusHandler/GetService
JanusHandler/JanusInitLock
JanusHandler/JanusLock
JanusHandler/JanusLockAttempt
JanusHandler/JanusUnlock
JanusHandler/LockServiceData
JanusHandler/ReleaseService
JanusHandler/SetParam
JanusHandler/UnLockServiceData
JanusHandler/AddService                               JanusHandler/AddService

   NAME
	AddService -- Add a service to the system.

   SYNOPSIS
	mov	AH,Function
	mov	DS,ApplicationID_high_word
	mov	SI,ApplicationID_low_word
	mov	CX,LocalID
	mov	BX,Size
	mov	DX,Type
	mov	AL,Flags
	mov	ES,Handler_Segment
	mov	DI,Handler_Offset
	int	0bh

   FUNCTION
	Adds a service to the system.

   INPUTS
	AH = Function

	DS = High word of 32 bit application ID

	SI = Low word of application ID

	CX = Local ID

	BX = Size in bytes of memory to allocate

	DX = Type of memory to allocate (MEMF_BUFFER, MEMF_PARAMETER)

	AL = AddService flags from services.[hi]

	ES = Segment of assembly language routine to call when this service
	     is called or NULL.

	DI = Offset of assembly language routine to call when this service
	     is called or NULL.

   RESULT
	AL = Status (JSERV_OK, JSERV_NOJANUSMEM, JSERV_NOSERVICE,
			JSERV_NOJANUSBASE)

	ES = Segment of ServiceData structure

	DI = Offset of ServiceData structure

   EXAMPLE
	mov	AH,JFUNC_ADDSERVICE
	mov	DS,ApplicationID_high_word
	mov	SI,ApplicationID_low_word
	mov	CX,LocalID
	mov	BX,Size
	mov	DX,MEMF_BUFFER
	mov	AL,ADDS_EXCLUSIVE | ADDS_TOAMIGA_ONLY
	mov	ES,Handler_Segment
	mov	DI,Handler_Offset
;	int	JFUNC_JINT

   NOTES

   BUGS

   SEE ALSO
	CallService(), DeleteService(), GetService(), ReleaseService()

JanusHandler/AllocJRemember                       JanusHandler/AllocJRemember

   NAME   
     	AllocJRemember -- Allocate Janus memory and link into a Remember list

   SYNOPSIS
	mov	AH,Function
	mov	AL,Type
	mov	BX,Size
	mov	ES,JRememberKey_Segment
	mov	DI,JRememberKey_Offset
	int	0bh

   FUNCTION
	Allocates memory from the Janus dual-port RAM, but also adds the 
	details of the allocation into a master list so that you make 
      	just one call the FreeJRemember() routine at a later time to  
      	free all the memory you allocated.

   INPUTS
   	AH = Function

	AL = Type of memory to allocate (MEMF_BUFFER, MEMF_PARAMETER)

	BX = Number of bytes to allocate

	ES = Segment of JRememberKey

	DI = Offset of JRememberKey  
	     ( Before your very first call to AllocJRemember(),	)
	     ( the pointer should be set to NULL. )

   RESULT
	BX = Offset of allocated memory else 0

	AL = Status (JSERV_OK,JSERV_NOJANUSMEM)

   EXAMPLE
	mov	AH,JFUNC_ALLOCJREMEMBER
	mov	AL,MEMF_BUFFER
	mov	BX,200
	mov	ES,JRememberKey_Segment
	mov	DI,JRememberKey_Offset
	int	JFUNC_JINT

   NOTES

   BUGS

   SEE ALSO
     	AllocRemember(), AttachJRemember(), FreeJRemember()

JanusHandler/AllocMem                                   JanusHandler/AllocMem

   NAME
	AllocMem -- Allocate Janus memory

   SYNOPSIS
	mov	AH,Function
	mov	AL,Type
	mov	BX,Size
	int	0bh

   FUNCTION
	Allocates memory from the Janus dual-port RAM.

   INPUTS
	AH = Function

	AL = Type of memory to allocate (MEMF_BUFFER, MEMF_PARAMETER)

	BX = Number of bytes to allocate

   RESULT
	BX = Offset of allocated memory else 0

	AL = Status (JSERV_OK,JSERV_NOJANUSMEM)

   EXAMPLE
	mov	AH,JFUNC_ALLOCMEM
	mov	AL,MEMF_BUFFER
	mov	BX,200
	int	JFUNC_JINT

   NOTES

   BUGS

   SEE ALSO
	FreeMem()

JanusHandler/AllocServiceMem                     JanusHandler/AllocServiceMem

   NAME   
	AllocServiceMem -- Allocate Janus memory linked to a ServiceData struct

   SYNOPSIS
	mov	AH,Function
	mov	AL,Type
	mov	BX,Size
	mov	DI,ServiceData_Offset
	int	0bh

  FUNCTION
     	This routine allocates memory for you and records the details of 
     	the allocation in the specified ServiceData structure. This memory,
     	unless you free it explicitly with a call to FreeServiceMem(), 
     	will be automatically freed when the service is deleted and 
     	removed from the system.  

   INPUTS
   	AH = Function

	AL = Type of memory to allocate (MEMF_BUFFER, MEMF_PARAMETER)

	BX = Number of bytes to allocate

	DI = Offset of ServiceData structure  

   RESULT
	BX = Offset of allocated memory else 0

	AL = Status (JSERV_OK,JSERV_NOJANUSMEM)

   EXAMPLE

   NOTES

   BUGS

   SEE ALSO
	FreeServiceMem()

JanusHandler/AttachJRemember                     JanusHandler/AttachJRemember

   NAME   
     	AttachJRemember -- Attach the list of one Janus memory key to another

   SYNOPSIS
	mov	AH,Function
	mov	ES,To_JRememberKey_Segment
	mov	DI,To_JRememberKey_Offset
	mov	DS,From_JRememberKey_Segment
	mov	SI,From_JRememberKey_Offset
	int	0bh

   FUNCTION
	This routine accepts two Janus RememberKeys created by calls to 
     	AllocJRemember() and attaches the contents of the FromKey to 
     	the ToKey.  In the process, FromKey is set equal to NULL.  

   INPUTS
	ES = Segment of To_JRememberKey

	DI = Offset of To_JRememberKey  
	     ( address of a pointer to JanusRemember structures, which ) 
	     ( pointer is going to receive the list pointed to by FromKey )

	DS = Segment of From_JRememberKey

	SI = Offset of From_JRememberKey  
	     ( address of a pointer to JanusRemember structures, which ) 
	     ( pointer has the list that's going to be attached ToKey, )
            ( after which the FromKey variable will be set to NULL. )
	
   RESULT
     	None

   EXAMPLE

   NOTES

   BUGS

   SEE ALSO
     	AllocRemember(), AllocJRemember(), FreeJRemember()

JanusHandler/CallService                             JanusHandler/CallService

   NAME
	CallService -- Signal all other users of a service.

   SYNOPSIS
	mov	AH,Function
	mov	DI,ServiceData_Offset
	int	0bh

   FUNCTION
	To signal all users of a service except the one that called
	CallService.

   INPUTS
	AH = Function

	DI = Offset of the services ServiceData structure.

   RESULT
	AL = Status (JSERV_OK, JSERV_NOJANUSMEM, JSERV_NOJANUSBASE)

   EXAMPLE
	mov	AH,JFUNC_CALLSERVICE
	mov	DI,ServiceData_Offset
	int	JFUNC_JINT

   NOTES

   BUGS

   SEE ALSO
	AddService(), DeleteService(), GetService(), ReleaseService()

JanusHandler/DeleteService                         JanusHandler/DeleteService

   NAME
	DeleteService -- Delete a service previously added with AddService

   SYNOPSIS
	mov	AH,Function
	mov	DI,ServiceData_Offset
	int	0bh

   FUNCTION
	To Delete a service previously added with AddService

   INPUTS
	AH = Function

	DI = Offset of ServiceData structure

   RESULT
	AL = Status (JSERV_OK, JSERV_NOJANUSBASE)

   EXAMPLE
	mov	AH,JFUNC_DELETESERVICE
	mov	DI,ServiceData_Offset
	int	JFUNC_JINT

   NOTES

   BUGS

   SEE ALSO
	AddService(), CallService(), GetService(), ReleaseService()

JanusHandler/FreeJRemember                         JanusHandler/FreeJRemember

   NAME   
     	FreeJRemember -- Free memory allocated by calls to AllocJRemember()

   SYNOPSIS
	mov	AH,Function
	mov	AL,ReallyForget
	mov	ES,JRememberKey_Segment
	mov	DI,JRememberKey_Offset
	int	0bh

   FUNCTION
	This function frees up Janus memory allocated by the AllocJRemember() 
     	function.  It will either free up just the JanusRemember structures
	(ReallyForget = FALSE),  which supply the link nodes that tie your
	allocations together, or it will deallocate both the link nodes AND
     	your memory buffers too (ReallyForget = TRUE).

   INPUTS
   	AH = Function

	AL = ReallyForget (BOOL)
	     ( a BOOL FALSE or TRUE describing, respectively, whether you )
	     ( want to free up only the Remember nodes or if you want this ) 
	     ( procedure to really forget about all of the memory, including ) 
	     ( both the nodes and the memory buffers pointed to by the nodes. )

	ES = Segment of JRememberKey

	DI = Offset of JRememberKey  
	     ( the address of a pointer to struct JanusRemember. This pointer )
	     ( should either be NULL or set to some value (possibly NULL) by )
	     ( a call to AllocRemember()

   RESULT
     	None

   EXAMPLE

   NOTES

   BUGS

   SEE ALSO
     	AllocJRemember(), FreeRemember(), AttachJRemember()

JanusHandler/FreeMem                                     JanusHandler/FreeMem

   NAME
	FreeMem -- Free Janus memory previously allocated with AllocMem.

   SYNOPSIS
	mov	AH,Function
	mov	AL,Type
	mov	BX,Offset
	int	0bh

   FUNCTION
	Frees Janus dual-port memory previously allocated with AllocMem.

   INPUTS
	AH = Function

	AL = Type of memory to free (MEMF_BUFFER, MEMF_PARAMETER)

	BX = Offset of memory to free. (same value returned by AllocMem)

   RESULT
	AL = Status (JSERV_OK, JSERV_NOJANUSMEM)

   EXAMPLE
	mov	AH,JFUNC_FREEMEM
	mov	AL,MEMF_BUFFER
	mov	BX,Offset
	int	JFUNC_JINT

   NOTES
	Crashes if Type/Offset not valid!

   BUGS

   SEE ALSO
	AllocMem()

JanusHandler/FreeServiceMem                       JanusHandler/FreeServiceMem

   NAME   
	FreeServiceMem -- Free mem added to a ServiceData by AllocServiceMem()

   SYNOPSIS
	mov	AH,Function
	mov	AL,Type
	mov	BX,ServiceMem_Offset
	mov	DI,ServiceData_Offset
	int	0bh

   FUNCTION
   	This routine frees memory that had been allocated with a call 
     	to AllocServiceMem().  You can choose to free a single block of 
     	memory or all the memory of the ServiceData structure.  

   INPUTS
   	AH = Function

	AL = Type of memory to allocate (MEMF_BUFFER, MEMF_PARAMETER)

	BX = Offset of prior allocated memory or NULL if you want to delete
	     all of the ServiceData's memory

	DI = Offset of ServiceData structure  

   RESULT
     	None

   EXAMPLE

   NOTES

   BUGS

   SEE ALSO
	AllocServiceMem()

JanusHandler/GetBase                                     JanusHandler/GetBase

   NAME
	GetBase -- Get the segment addresses and offsets for an old
		   style service.

   SYNOPSIS
	mov	AH,Function
	mov	AL,Service_number
	int	0bh

   FUNCTION
	Returns the segment address for buffer and parameter memory.
	Also returns the parameter memory offset for the old style
	service if defined.

   INPUTS
	AH = Function

	AL = Janus Service Number

   RESULT
	ES = Parameter memory segment

	DI = Parameter offset if defined, else -1

	DX = Buffer memory segment

	AL = Status return (JSERV_OK)

   EXAMPLE
	mov	AH,JFUNC_GETBASE
	mov	AL,JSERV_AMIGASERVICE
	int	JFUNC_JINT

   NOTES

   BUGS

   SEE ALSO

JanusHandler/GetService                               JanusHandler/GetService

   NAME
	GetService -- Get a service and its ServiceData pointer

   SYNOPSIS
	mov	AH,Function
	mov	DS,ApplicationID_high_word
	mov	SI,ApplicationID_low_word
	mov	CX,LocalID
	mov	AL,Flags
	mov	ES,Handler_Segment
	mov	DI,Handler_Offset
	int	0bh

   FUNCTION
	Gets a pointer to a Services ServiceData structure if the Service
	exists.

   INPUTS
	AH = Function

	DS = High word of 32bit application ID

	SI = Low word of 32bit application ID

	CX = Local ID

	AL = Flags
	
	ES = Segment of assembly language handler to be called whenever this
	     service is called or NULL.

	DI = Offset of assembly language handler to be called whenever this
	     service is called or NULL.

   RESULT
	AL = Status (JSERV_OK, JSERV_NOSERVICE)

	ES = Segment of ServiceData structure

	DI = Offset of ServiceData structure

   EXAMPLE
	mov	ax,ApplicationID_high_word
	mov	DS,ax
	mov	SI,ApplicationID_low_word
	mov	CX,LocalID
	mov	ax,Handler_Segment
	mov	ES,ax
	mov	DI,Handler_Offset
	mov	AH,JFUNC_GETSERVICE
	mov	AL,GETS_WAIT
	int	JFUNC_JINT

   NOTES

   BUGS

   SEE ALSO
	AddService(), CallService(), DeleteService(), ReleaseService()

JanusHandler/JanusInitLock                         JanusHandler/JanusInitLock

   NAME
	JanusInitLock -- Initialize a byte for use as a lock byte.

   SYNOPSIS
	mov	AH,Function
	mov	ES,Segment
	mov	DI,Offset
	int	0bh

   FUNCTION
	Performs the necessary steps to Initialize a Janus Lock byte

   INPUTS
	AH = Function
	
	ES = Segment of lock byte

	DI = Offset of lock byte

   RESULT
	The Lock byte is initialized.

   EXAMPLE
	mov	AH,JFUNC_INITLOCK
	mov	ES,Segment
	mov	DI,Offset
	int	JFUNC_JINT

   NOTES

   BUGS

   SEE ALSO
	JanusLockAttempt(), JanusLock(), JanusUnlock()

JanusHandler/JanusLock                                 JanusHandler/JanusLock

   NAME
	JanusLock -- Obtain a Lock

   SYNOPSIS
	mov	AH,Function
	mov	ES,Segment
	mov	DI,Offset
	int	0bh

   FUNCTION
	Get a lock.

   INPUTS
	AH = Function
	
	ES = Segment of lock byte

	DI = Offset of lock byte

   RESULT
	Returns when the lock is gotten.

   EXAMPLE
	mov	AH,JFUNC_LOCK
	mov	ES,Segment
	mov	DI,Offset
	int	JFUNC_JINT

   NOTES

   BUGS

   SEE ALSO
	JanusInitLock(), JanusLockAttempt(), JanusUnlock();

JanusHandler/JanusLockAttempt                   JanusHandler/JanusLockAttempt

   NAME
	JanusLockAttempt -- Try once to obtain a Lock

   SYNOPSIS
	mov	AH,Function
	mov	ES,Segment
	mov	DI,Offset
	int	0bh

   FUNCTION
	Attempts once to gain a Lock.

   INPUTS
	AH = Function
	
	ES = Segment of lock byte

	DI = Offset of lock byte

   RESULT
	AL = TRUE if lock is gotten FALSE otherwise.

   EXAMPLE
	mov	AH,JFUNC_LOCKATTEMPT
	mov	ES,Segment
	mov	DI,Offset
	int	JFUNC_JINT

   NOTES

   BUGS

   SEE ALSO
	JanusInitLock(), JanusLock(), JanusUnlock()

JanusHandler/JanusUnlock                             JanusHandler/JanusUnlock

   NAME
	JanusUnlock -- Release a Lock

   SYNOPSIS
	mov	AH,Function
	mov	ES,Segment
	mov	DI,Offset
	int	0bh

   FUNCTION
	Release a lock.

   INPUTS
	AH = Function
	
	ES = Segment of lock byte

	DI = Offset of lock byte

   RESULT
	Returns when the lock is released.

   EXAMPLE
	mov	AH,JFUNC_UNLOCK
	mov	ES,Segment
	mov	DI,Offset
	int	JFUNC_JINT

   NOTES

   BUGS

   SEE ALSO
	JanusInitLock(), JanusLockAttempt(), JanusLock()

JanusHandler/LockServiceData                     JanusHandler/LockServiceData

   NAME
	LockServiceData -- Perform the steps necessary to Lock a ServiceData
			   structure.

   SYNOPSIS
	mov	AH,Function
	mov	DI,ServiceData_Offset
	int	0bh

   FUNCTION
	Performs the necessary steps to Lock a ServiceData structure for
	exclusive access.

   INPUTS
	AH = Function
	
	DI = Offset of ServiceData structure

   RESULT
	AL = Status (JSERV_OK)

   EXAMPLE
	mov	AH,JFUNC_LOCKSERVICEDATA
	mov	DI,ServiceData_Offset
	int	JFUNC_JINT

   NOTES

   BUGS

   SEE ALSO
	UnlockServiceData()

JanusHandler/ReleaseService                       JanusHandler/ReleaseService

   NAME
	ReleaseService -- Release a service previously obtained with 
			  GetService

   SYNOPSIS
	mov	AH,Function
	mov	DI,ServiceData_Offset
	int	0bh

   FUNCTION
	To Release use of a service previously gotten via GetService

   INPUTS
	AH = Function

	DI = Offset of ServiceData structure

   RESULT
	AL = Status (JSERV_OK, JSERV_NOJANUSBASE)

   EXAMPLE
	mov	AH,JFUNC_RELEASESERVICE
	mov	DI,ServiceData_Offset
	int	JFUNC_JINT

   NOTES

   BUGS

   SEE ALSO
	AddService(), CallService, DeleteService(), GetService()

JanusHandler/SetParam                                   JanusHandler/SetParam

   NAME
	SetParam -- Set the parameter memory offset for an old style
		    service.

   SYNOPSIS
	mov	AH,Function
	mov	AL,ServiceNumber
	mov	BX,Offset
	int	0bh

   FUNCTION
	Sets the parameter memory pointer for the old style service to
	the offset given.

   INPUTS
	AH = Function

	AL = Janus Service Number

	BX = Offset of parameter memory for this service

   RESULT
	AL = Status (JSERV_OK)

   EXAMPLE
	mov	AH,JFUNC_SETPARAM
	mov	AL,JSERV_AMIGASERVICE
	mov	BX,Offset
	int	JFUNC_JINT

   NOTES
	This is a low level Janus call retained for compatibility with
	V1.0. Service programmers should NOT use this function.

   BUGS

   SEE ALSO

JanusHandler/UnLockServiceData                 JanusHandler/UnLockServiceData

   NAME
	UnLockServiceData -- Perform the steps necessary to UnLock a 
			     ServiceData structure.

   SYNOPSIS
	mov	AH,Function
	mov	DI,ServiceData_Offset
	int	0bh

   FUNCTION
	Performs the necessary steps to UnLock a ServiceData structure

   INPUTS
	AH = Function
	
	DI = Offset of ServiceData structure

   RESULT
	AL = Status (JSERV_OK)

   EXAMPLE
	mov	AH,JFUNC_UNLOCKSERVICEDATA
	mov	DI,ServiceData_Offset
	int	JFUNC_JINT

   NOTES

   BUGS

   SEE ALSO
	LockServiceData()

