
; $VER:FAMEPublicStructs.i v0.23

	IFND	FAME_FAMEPUBLICSTRUCTS_I
FAME_FAMEPUBLICSTRUCTS_I	SET	1


; FAMEDoorMsg:
;
; Note:
;	The FAMEDoorMessage structure *must* be allocated via FAME.library
;	(Simplified example):
;
; AllocDoorMsg:
;		move.l	FAMEBase,a6
;		moveq	#AFO_FAMEDoorMsg,d0
;		jsr	_LVOFAMEAllocObject(a6)
;		move.l	d0,MyDoorMessage
;		beq	OutOfMemory
;
; FreeDoorMsg:
;		move.l	FAMEBase,a6
;		tst.l	MyDoorMessage
;		beq	DoorMessageFreed
;		move.l	MyDoorMessage,a1
;		jsr	_LVOFAMEFreeObject(a6)


; DoorPort Structure (FIM) Fame Interface Module Type, version 1.


	STRUCTURE	FAMEDoorMsg,0
	STRUCT	fdom_Msg,MN_SIZE	; MessagePort Structure (System)
	STRUCT	fdom_IOString,202	; In/OutPut String
	APTR	fdom_StringPtr		; string pointer
	LONG	fdom_Command		; Command Node<->Door
	LONG	fdom_Data1		; Data 1 to transfer data
	LONG	fdom_Data2		; Data 2 to transfer data
	ULONG	fdom_Data3		; Data 3 to transfer data
	LONG	fdom_ReturnCode		; Returncode
	ULONG	fdom_Node		; NodeNumber
	ULONG	fdom_InternalBits	; FAME internal data bit flags
	APTR	fdom_StructDummy1	; APTR 1 for SystemStructs
	APTR	fdom_StructDummy2	; APTR 2 for SystemStructs
	APTR	fdom_StructDummy3	; APTR 3 for SystemStructs
	APTR	fdom_StringPtr2		; A second string pointer
	ULONG	fdom_Data4		; Data 4 to transfer data (future use)
	ULONG	fdom_BitFlags		; A bit mask to give the door infos
	APTR	fdom_ExternalPort	; External AbortIO port
	LABEL	fdom_SIZEOF

; Version(s):	0 - The old struct FAMEDoorMsg
;		1 - The latest struct FAMEDoorMsg


; Usage of fdom_BitFlags:
;
;byte 0:
;	bit0:	FBF_OLMSAVAIL				; New olm(s) available
;	bit1:
;	bit2:
;	bit3:
;	bit4:
;	bit5:
;	bit6:
;	bit7:
;byte 1:
;	bit0:
;	bit1:
;	bit2:
;	bit3:
;	bit4:
;	bit5:
;	bit6:
;	bit7:
;byte 2:
;	bit0:
;	bit1:
;	bit2:
;	bit3:
;	bit4:
;	bit5:
;	bit6:
;	bit7:
;byte 3:
;	bit0:
;	bit1:
;	bit2:
;	bit3:
;	bit4:
;	bit5:
;	bit6:
;	bit7:


;Usage of fdom_InternalBits:
;
;byte 0:
;	bit0:	FIBF_NODOORDROP				; Forbid the Drop Door possibility
;	bit1:
;	bit2:
;	bit3:
;	bit4:
;	bit5:
;	bit6:
;	bit7:
;byte 1:
;	bit0:
;	bit1:
;	bit2:
;	bit3:
;	bit4:
;	bit5:
;	bit6:
;	bit7:
;byte 2:
;	bit0:
;	bit1:
;	bit2:
;	bit3:
;	bit4:
;	bit5:
;	bit6:
;	bit7:
;byte 3:
;	bit0:
;	bit1:
;	bit2:
;	bit3:
;	bit4:
;	bit5:
;	bit6:
;	bit7:


; Definition of the ReturnCode:
;
;ReturnCode=5		Comand aborted
;ReturnCode=4		Comand not implemented untill now
;ReturnCode=3		Comand denied
;ReturnCode=2		Comand doesn't exists
;ReturnCode=1		Comand not successfull executed
;ReturnCode=0		Comand successfull executed
;ReturnCode=-1	 Abort of the Door requested	 -> Door must end now!
;ReturnCode=-2	 Carrier lost					-> Door must end now!
;ReturnCode=-3	 Unknown error				 -> Door must end now!
;
;On negative Returncodes the Door *MUST* close *IMMEDIATELY* with the last
;command: MC_ShutDown !!!
;
;ReturnCode -1 means the SysOp or an internal procedure of FAME demands an
;abort of the Door.
;The SysOp can do this with the IconifyWindow for example. If he clicks on
;the upper left closegadget on the nodescreen this IconifyWindow appears.
;If he now clicks on "DropUser or Exit Node/Door" the Doors receives at the
;first time the ReturnCode -1 and has to call MC_ShutDown and must close down.
;If the Door doesn't note this, maybe it's a wrong Interface Module Type
;(XIM/REXX/...) and the SysOp clicks the second time on this gadget the
;Door will be kicked and the Node goes back to the Menu or previous Door.
;The same can also be done under FAME on XIM/REXXDOOR/REXXEXEC and Paragon
;Doors! (FIM/XIM/AIM/CIM/TIM)


; External CoProcess Message Structure, version 0.

	STRUCTURE	FAMECoProcessMsg,0
	STRUCT	fcpm_Msg,MN_SIZE	; MessagePort Structure (System)
	ULONG	fcpm_Registration	; To identify this structure
	APTR	fcpm_CoProcName		; The name of the CoProc
					; (NewBroker like)
	APTR	fcpm_CoProcTilte	; The title of the CoProc
					; (NewBroker like)
	APTR	fcpm_CoProcDesc		; The description of the CoProc
					; (NewBroker like)
	APTR	fcpm_CoProcAction	; Text msg showen on Server
	LONG	fcpm_Command		; The command to the Server
	LONG	fcpm_Data1		; long based datafield 1
	LONG	fcpm_Data2		; long based datafield 2
	ULONG	fcpm_Node		; NodeNummer for CoProc usage (ident.)
	LONG	fcpm_ReturnCode		; Returncode from Server
	ULONG	fcpm_CoProNum		; CoProcessNummer
	ULONG	fcpm_Data3		; unsigned long based datafield 3
	ULONG	fcpm_Data4		; unsigned long based datafield 4
	ULONG	fcpm_UnUsed
	ULONG	fcpm_BitFlags		; A bit mask for future use
	ULONG	fcpm_IdentifyCode	; To identify the CoProcess
	APTR	fcpm_StringPtr		; string pointer
	APTR	fcpm_StructDummy1	; typeless ptr for structs and more
	LABEL	fcpm_SIZEOF


; Structure for a list of nodes for some Doorcommands and more

	STRUCTURE	FAMEDestNodes,0
	APTR	fdnd_Next
	ULONG	fdnd_NodeNum
	LABEL	fdnd_SIZEOF


; FAME Info List structure for FAMESemaphore.


	STRUCTURE	FAMEInfoList,0
	APTR	fili_Next	; Ptr. to next struct FAMEInfoList
	APTR	fili_Prev	; Ptr. to prev struct FAMEInfoList
	APTR	fili_NodeRUser	; Ptr. to Nodes read user datas
	APTR	fili_NodeWUser	; Ptr. to Nodes write user datas
	APTR	fili_ConfStamm	; Origin ptr. of the conf. list
	APTR	fili_FAMECnfLst	; Ptr. to the current conf. datas
	APTR	fili_SVUserName	; UserName (Server string)
				; Note: Max. 22 bytes in size !
	APTR	fili_SVLocation	; UserLocation (Server string)
				; Note: Max. 22 bytes in size !
	APTR	fili_SVAction	; Node action string (Server str)
				; Note: Max. 22 bytes in size !
	APTR	fili_VerStr	; Node version string
				; Note: Max. 32 bytes in size !
	APTR	fili_VersionStr	; Complete Node version string
				 ; Note: Max. 62 bytes in size !
	APTR	fili_ComputerType ; Computer type as string
				 ; Note: Max. 36 bytes in size !
	APTR	fili_ModemType	; Modem type as string
				; Note: Max. 36 bytes in size !
	APTR	fili_Extension	; Extension for text files
				; Note: Max. 12 bytes in size !
	APTR	fili_Language	; Users selected language
				; Note: Max. 32 bytes in size !
	APTR	fili_ConnectMsg	; Connect message string
				; Note: Max. 82 bytes in size !
	APTR	fili_XferProt	; Transfer protocol name
				; Note: Max. 32 bytes in size !
	APTR	fili_FileUpload	; Name of file uploading/ed
				 ; Note: Max. 32 bytes in size !
	APTR	fili_FileDownload ; Name if file downloading/ed
				  ; Note: Max. 32 bytes in size !
	APTR	fili_SerialDriver ; Serial device driver name
				 ; Note: Max. 102 bytes in size !
	APTR	fili_PubScrName	; Node PublicScreen name
				; Note: Max. 22 bytes in size !
	APTR	fili_FiFoName	; Node FiFo name
				 ; Note: Max. 22 bytes in size !
	APTR	fili_ReservedUser ; Name of reserved user
				 ; Note: Max. 32 bytes in size !
	APTR	fili_ASLDlPath	; ASL requester download path
				; Note: Max. 102 bytes in size !
	APTR	fili_ASLULPath	; ASL requester upload path
				; Note: Max. 102 bytes in size !
	APTR	fili_ASLTxtViewP; ASL requester text view path
				; Note: Max. 102 bytes in size !
	APTR	fili_WhatLogon	; Logon type (defined)       (ptr)
	APTR	fili_InitBaud	; Baud rate on initializing  (ptr)
	APTR	fili_BaudRate	; Baud rate with no CPS      (ptr)
	APTR	fili_UploadCPS	; Upload CPS rate            (ptr)
	APTR	fili_DownloadCPS; Download CPS rate          (ptr)
	APTR	fili_TimeConnect; Time connected to the Node (ptr)
	APTR	fili_NumConfs	; Number of conferences      (ptr)
	APTR	fili_RelativCnfs; 0 = real else relative     (ptr)
	APTR	fili_ChatFlag	 ; 0 = not available else available
	LONG	fili_SVNodeNumber ; The number of this Node
	LONG	fili_SVBaudCps	 ; BaudRate or CPS (Transfer)
	LONG	fili_SVActionCmd; Defined action number
	LONG	fili_DataFileVer; Data file version
	LONG	fili_DataFileRev; Data file revision
	LONG	fili_Version	; Nodes version
	LONG	fili_Revision	; Nodes revision
	LONG	fili_StartedTime ; Nodes start time
	WORD	fili_SVNodeOnline ; 0 = not started else online
	WORD	fili_UserOnline	 ; 0=Await, 1=Connect, 2=Valid, 3=Reset
	ULONG	fili_BitFlags	; Bit flags for different things
	ULONG	fili_Reserved,20; Reserved fileds for future usage
	LABEL	fili_SIZEOF

; Note: The STRPTR sizes are including the zero-byte!
;	Most sizes are two bytes longer as the real used text string,
;	because of the zero-byte we need one byte more, but to align the
;	sizes to word size there will always calculated with one byte more.
;	This has the result that because of the zero-byte two bytes more
;	are allocated instead only one byte. FAME mostly uses not the second
;	byte, but it's ok if you fill the string completely up.
;
;	Example: fili_Extension has 12 bytes, 10 bytes max. string size
;		 the 11th byte is for the zero-byte and the 12th is not used,
;		 but it's not dangerous if the 12th byte is the zero-byte
;		 and the other 11 are used for the string.


; Usage of fili_BitFlags:
;
;byte 0:
;  bit0:	FILI_USERSAVELOCK	; Lock user data saving on logout
;  bit1:
;  bit2:
;  bit3:
;  bit4:
;  bit5:
;  bit6:
;  bit7:
;byte 1:
;  bit0:
;  bit1:
;  bit2:
;  bit3:
;  bit4:
;  bit5:
;  bit6:
;  bit7:
;byte 2:
;  bit0:
;  bit1:
;  bit2:
;  bit3:
;  bit4:
;  bit5:
;  bit6:
;  bit7:
;byte 3:
;  bit0:
;  bit1:
;  bit2:
;  bit3:
;  bit4:
;  bit5:
;  bit6:
;  bit7:


; Note: fili_SV kinds are equal to the Server datas used to show informations
;       on and/or about the Server.
;
; Note: This is a information structure, please do not write into the data
;       elements! This is all READ-ONLY, else you might confuse or crash
;       the system. In some cases it's possible to write into the dats,
;       but please use for strings/string pointers (here STRPTR) Forbid()
;       and Permit() around the string copy, else you can overwrite a
;       zero-byte while the node or an other tool reads the same string.
;       If you write please do not write more than the in the comment given
;       string sizes - 1 byte for the zero-byte!!!
;       Normally tools can't read/write strings at the same time as others
;       do because of the Semaphore, but door commands and MainPart can.
;       The STRPTRs are string pointers to MainPart's config data structure
;       and this structure is not in a Semaphore!
;       Because of this use also Forbid() and Permit() to read from a
;       string/string pointer (STRPTR) or read only the in the comment given
;       size limit (strncpy) and set the zero-byte on using strncpy!
;
; Note: fili_NodeRUser, fili_NodeWUser and fili_BitFlags are exceptions
;       from the next note above. fili_NodeRUser and fili_NodeWUser are
;       pointers to the both Node's user data structures of an online user.
;       They are valid as long as a node is running, also if no user is
;       online. You may ask why two structures. The first fili_NodeRUser
;       is the read data structure and the other the structure which will
;       be written back to disk if a user is loging off. MainPart reads
;       and uses all datas out of fili_NodeRUser and writes datas into both
;       structures, so if you use the pointers to change online user datas
;       please do it in the same way:
;
;       fili_NodeRUser: To read and write datas.
;       fili_NodeWUser: To write datas only.
;
;       Read example : If you want to know the username or level for
;                      validations use ONLY "fili_NodeRUser" !
;
;       Write example: If you want to change the username or level of the
;                      user use both "fili_NodeRUser" and "fili_NodeWUser" !
;
;       The reason for handling this in the above explained way is the
;       internal user edior which allows "SysOp Access" what means the
;       SysOp is able to give any online user a higher access which is
;       only available as long as the user is actual online or the Sysop
;       removes it before he is logging off.
;       To realize this fili_NodeRUser is used to save the temporär changed
;       datas on "SysOp access". fili_NodeWUser contains at this point not
;       complete equal datas to fili_NodeRUser. fili_NodeRUser won't be
;       saved on logoff, but the everytime "real" fili_NodeWUser.
;
; Note: Please read or change string contends in fili_NodeRUser and
;       fili_NodeWUser only between Forbid() and Permit() !!!
;
; Note: fili_BitFlags first bit is used with "FILI_USERSAVELOCK".
;       FILI_USERSAVELOCK is used to lock the back writings of the
;       fili_NodeWUser user datas to disk. If you need to change user datas
;       of an online user please use FILI_USERSAVELOCK to lock the
;       user data to disk back writings of the node. But only lock it
;       as short as you can, else it will disturb the node.
;       The locking is needed, because if you change he datas while a
;       user is logging off it can be that your changings will be made to
;       late and they get lost.
;       The node checks every second if it wants to write the user datas
;       to disk if the bit is clear. After 60 tries (1 minute) it will
;       clear the bit and writes the datas back to have no endless hanging
;       nodes.
;
;       Please don't lock to long!!!
;
; Note: You also need to be sure that the node is online, else
;       fili_NodeRUser and fili_NodeWUser are NULL !
;       Use fili_SVNodeOnline for this.
;
; Note: You also need to be sure that a user is online, else your changing
;       will take no effect. Use fili_SVUserOnline for this.
;
; Example for using fili_NodeRUser and fili_NodeWUser:
;
;	void ChangeDatas(struct FAMEInfoList *MyFAMEInfoList)
;	{
;	  /* Pointer valid ?
;	   */
;
;	  if(MyFAMEInfoList) {
;
;	    /* Is the Node online ?
;	     */
;
;	    if(MyFAMEInfoList -> fili_SVNodeOnline) {
;
;	      /* Is a user online ?
;	      */
;
;	      if(MyFAMEInfoList -> fili_SVUserOnline == 2) {
;
;		/* Lock Node's user data savings:
;		 *
;		 * "|=" is in asm: "BSET"
;		 */
;
;		MyFAMEInfoList -> fili_BitFlags |= FILI_USERSAVELOCK;
;
;		if(MyFAMEInfoList -> fili_NodeRUser && MyFAMEInfoList -> fili_NodeWUser) {
;
;		  char		UserName[32];
;		  short int	Userlevel;
;
;		  /* Read datas:
;		  */
;
;		  Forbid();
;		  strcpy(UserName,MyFAMEInfoList -> fili_NodeRUser . UserName);
;		  Permit();
;
;		  Userlevel = MyFAMEInfoList -> fili_NodeRUser . Userlevel;
;
;		  /* Change datas:
;		  */
;
;		  Forbid();
;		  strcpy(MyFAMEInfoList -> fili_NodeRUser . UserName,UserName);
;		  strcpy(MyFAMEInfoList -> fili_NodeWUser . UserName,UserName);
;		  Permit();
;
;		  MyFAMEInfoList -> fili_NodeRUser . Userlevel = Userlevel;
;		  MyFAMEInfoList -> fili_NodeWUser . Userlevel = Userlevel;
;
;		}
;
;		/* Unlock Node's user data savings:
;		 *
;		 * "&= ~" is in asm: "BCLR"
;		 */
;
;		MyFAMEInfoList -> fili_BitFlags &= ~FILI_USERSAVELOCK;
;
;	      }
;	    }
;	  }
;	}
;
;  Source Note: It is also good to use Forbid and Permit around the check
;		for a online node + user and locking with FILI_USERSAVELOCK.
;		I have left this out here to keep the source small.
;		Watch out for a complete example source also with
;		getting the semaphore i will include to the FAME
;		developer stuff.
;
;  Source Note: If you do any action like prompting for inputs or everything
;		else between readings and writings please try to unlock
;		and re-lock later. This could cause that the node writes
;		and logges of a user. That's of course a problem if you
;		want to write something back... you can do two things:
;
;		First : Check before lock and write if the user is still
;			online and lock! If the user is no longer online
;			load his account directly from the user datas and
;			change the datas and write them directly back.
;		Second:	The best way is to prompt first and after that
;			to read, change and write the datas back.


; FAMESemaphore with info datas for everyones usage.

	STRUCT	FAMESemaphore,0
	STRUCT	fsem_Semaphore,SS_SIZE	; The Signal Semaphore
	APTR	fsem_FirstNode		; Ptr. to first FAMEInfoList
					; entry, in every case Node 0
	APTR	fsem_SVBBSLocPath	; BBS Location Path
	APTR	fsem_SVBBSName		; BBS Name
	APTR	fsem_SVBBSOrigin	; BBS Origin/Group
	APTR	fsem_SVSysOpName	; SysOp Name
	LONG	fsem_SVNumOfNodes	; The number of nodes in list
	LONG	fsem_SVVersion		; Servers version
	LONG	fsem_SVRevision		; Servers revision
	LONG	fsem_SVStartedTime	; Servers start time
	ULONG	fsem_Reserved,20	; Reserved fileds for future
	LABEL	fsem_SIZEOF

; Note: fsem_SV kinds are equal to the Server datas used to show informations
;	on and/or about the Server.


; External editor structure, version 1.

	STRUCTURE	FAMEExternEditor,0
	APTR	feed_EdMailHeader	; Pointer to filled structure
	APTR	feed_MsgListStamm	; Replylist
	APTR	feed_FilePath		; MsgBasePath
	LONG	feed_MsgType		; 0 External file, 1 Enter new
					; Msg, 2 Reply Msg, 3 Part Msg,
					; 4 OLM, 5 Edit Msg, 6 Script Mode
	LONG	feed_Data		; Dummy Max lines on MsgType=4
	LONG	feed_StartLine		; StartLine, if 0 then no reply lines !
	LONG	feed_EndLine		; EndLine, if 0 then no reply lines !
	LABEL	feed_SIZEOF


; Messagebase mail header structure, version 0.

	STRUCTURE	FAMEMailHeader,0
	STRUCT	fmah_ToName,32		; To user name	Name/ALL/EALL/UEALL
	STRUCT	fmah_FromName,32	; From user name
	STRUCT	fmah_Subject,32		; Subject
	STRUCT	fmah_ToNet,12		; From Net
	STRUCT	fmah_FromNet,12		; To Net
	STRUCT	fmah_CryptPW,12		; KryptPW
	STRUCT	fmah_StrNotUsed1,12
	STRUCT	fmah_StrNotUsed2,12
	STRUCT	fmah_StrNotUsed3,12
	LONG	fmah_MsgNum		; Message number
	LONG	fmah_MsgDate		; Message date
	LONG	fmah_Crypt		; Crypted Y/N 0=no
	LONG	fmah_UFromLevel		; Level from writer
	LONG	fmah_Lines		; Number of lines for read testing
					; if more than 100 lines...
	LONG	fmah_AktMsgNum		; Needed for SYSCMD: MAILHEADER
	LONG	fmah_LongNotUsed2
	LONG	fmah_Prioity		; Priority
	LONG	fmah_DeleteInDays	; Delete in days
	LONG	fmah_Recived		; Times read
	ULONG	fmah_ULongNotUsed1
	ULONG	fmah_ULongNotUsed2
	ULONG	fmah_ULongNotUsed3
	ULONG	fmah_ULongNotUsed4
	WORD	fmah_MsgStatus		; State: deleted? 1=valid 0=deleted
	WORD	fmah_AFileStat		; Attached file(s)?
	WORD	fmah_NotUsed
	WORD	fmah_Private		; Private msg?
	WORD	fmah_ToNameRec		; Received by fmah_ToName?
	WORD	fmah_HeadNumLines	; Number of lines skipping
					; because of header
	WORD	fmah_ShortNotUsed2
	WORD	fmah_ShortNotUsed3
	WORD	fmah_ShortNotUsed4
	WORD	fmah_ShortNotUsed5
	LABEL	fmah_SIZEOF


; Messagebase mail status structure, version 0.

	STRUCTURE	FAMEMailStat,0
	LONG	fmas_HighMsgNum
	LABEL	fmas_SIZEOF


; CoProcess structure. This one is needed to tell the Server of your
; CoProcess requests.

	STRUCTURE	FAMECoProcess,0
	STRUCT	fcop_CoPrStartPath,32	; (Path)/Name for the CoProcess
	STRUCT	fcop_CoPrArgs,32	; Args for CoProcess
	LONG	fcop_StartDate1		; Start at 1. Date
	LONG	fcop_StartDate2		; Start at 2. Date
	LONG	fcop_StartDate3		; Start at 3. Date
	LONG	fcop_StartDate4		; Start at 4. Date
	LONG	fcop_StartDate5		; Start at 5. Date
	LONG	fcop_StartDate6		; Start at 6. Date
	LONG	fcop_StartDate7		; Start at 7. Date
	LONG	fcop_StartDate8		; Start at 8. Date
	LONG	fcop_StartDate9		; Start at 9. Date
	LONG	fcop_StartDate10	; Start at 10. Date
	ULONG	fcop_Flag1		; Flags 1
	ULONG	fcop_Reserved		; Reserved!
	LABEL	fcop_SIZEOF

;Usage of Flag1:			 (Flag1 is unused!)
;
;byte 0:
;	bit0:	 ; Activated y/n
;	bit1:
;	bit2:
;	bit3:
;	bit4:
;	bit5:
;	bit6:
;	bit7:
;byte 1:
;	bit0:
;	bit1:
;	bit2:
;	bit3:
;	bit4:
;	bit5:
;	bit6:
;	bit7:
;byte 2:
;	bit0:
;	bit1:
;	bit2:
;	bit3:
;	bit4:
;	bit5:
;	bit6:
;	bit7:
;byte 3:
;	bit0:
;	bit1:
;	bit2:
;	bit3:
;	bit4:
;	bit5:
;	bit6:
;	bit7:


; ToolPort message structure to let the Server receive requests from tools,
; version 0.

	STRUCTURE	FAMEToolPortMsg,0
	STRUCT	ftpm_Msg,MN_SIZE	; MessagePort Structure (System)
	ULONG	ftpm_Registration	; To identify this structure
	APTR	ftpm_ToolName		; The name of the Tool
					; (NewBroker like)
	APTR	ftpm_ToolTilte		; The title of the Tool
					; (NewBroker like)
	APTR	ftpm_ToolDesc		; The description of the Tool
					; (NewBroker like)
	APTR	ftpm_ToolAction		; Text msg showen on Server
	LONG	ftpm_Command		; The command to the Server Tool Port
	LONG	ftpm_Data1		; long based datafield 1
	LONG	ftpm_Data2		; long based datafield 2
	LONG	ftpm_ReturnCode		; Returncode from Server
	ULONG	ftpm_Node		; NodeNummer for Tool usage (identify)
	ULONG	ftpm_Data3		; unsigned long based datafield 3
	ULONG	ftpm_Data4		; unsigned long based datafield 4
	ULONG	ftpm_UnUsed
	ULONG	ftpm_BitFlags		; A bit mask for future use
	ULONG	ftpm_BitRequests1	; A bit mask for requests 1
	ULONG	ftpm_BitRequests2	; A bit mask for requests 2
	ULONG	ftpm_BitRequests3	; A bit mask for requests 3
	ULONG	ftpm_BitRequests4	; A bit mask for requests 4
	ULONG	ftpm_IdentifyCode	; To identify the Tool
	APTR	ftpm_StringPtr1		; string pointer 1
	APTR	ftpm_StringPtr2		; string pointer 2
	APTR	ftpm_StructDummy1	; typeless ptr for structs and more 1
	APTR	ftpm_StructDummy2	; typeless ptr for structs and more 2
	LABEL	ftpm_SIZEOF

; Returncodes:
;				 8 You have to use ftpm_Register first
;				 7 ftpm_IdentifyCode not valid
;				 6 ftpm_ToolName not given
;				 5 Comand aborted
;				 4 Comand not implemented untill now
;				 3 Comand denied
;				 2 Comand doesn't exists
;				 1 Comand not successfull executed
;				 0 Comand successfull executed
;				-1 Fatal error. Remove your tool immediately
;				-2 You are not the Tool you are trying to be
;				-3 Unknown error

; General words for the usage of the ToolPort.
;
; First every new Tool must register before it can do anything.
; To register the fields ftpm_ToolName, ftpm_ToolTilte and ftpm_ToolDesc
; have to be filled (point to strings defined in your tool space).
; ftpm_ToolName is a *must*, without no entry is allowed. If ftpm_ToolTilte
; and ftpm_ToolDesc are not set the Server will point them to ftpm_ToolName.
; Now you have to set the ftpm_Command to ftpm_Register (define = 0), later
; if you no longer need the ToolPort you have to use ftpm_EndRegister define.
; You also have to fill ftpm_Node if your Tool may run multiple at one time
; if you fill it out you will get this number back over the ToolNotifyPort
; you have to apply. You have always to allocate the structure via
; AllocFAMEObject from FAME.library. Now you can send this message to the
; Server and if everything went ok you will get in ftpm_IdentifyCode
; your code for identifying which you *must* use from now on everytime
; you send any request over this ToolPort to the Server. The Server
; will also give this code to you if you receive a message over your
; ToolNotifyPort. Also if you use ftpm_EndRegister to end your tool
; you have to set ftpm_IdentifyCode to your received code, but the best is
; to let the field ftpm_IdentifyCode like it is.
;
; Note: Be sure that all the time you use the ToolPort you *must* leave
;		 ftpm_ToolName and ftpm_IdentifyCode untouched!!!
;
; ftpm_ToolName is the simple name of the tool, no version, no coder name
; and no other stuff here! Add only the Node number or your process
; adress or something similar if your tool can be started multiple.
;	 (max. 40 chars long, try to use only 20 chars, because of displaying)
; ftpm_ToolTilte is the title like tool name, version and coder name.
;	 (max. 40 chars long, try to use only 20 chars, because of displaying)
; ftpm_ToolDesc is the description fo the tool, means what it does.
;	 (max. 40 chars long, try to use only 20 chars, because of displaying)
; ftpm_ToolAction is the actual action/state of the tool similar
; to Servers Action field on display.
;	 (max. 40 chars long, try to use only 20 chars, because of displaying)


FAMETP_Register		EQU	0
FAMETP_EndRegister	EQU	1
FAMETP_InfoStructs	EQU	2


; Tool notify message structure to tell the tools using ToolPort of actions

	STRUCTURE	FAMEToolNotifyMsg,0
	STRUCT	ftnm_Msg,MN_SIZE	; MessagePort Structure (System)
	LONG	ftnm_Notify		; The notify define
	LONG	ftnm_Data1		; long based datafield 1
	LONG	ftnm_ReturnCode		; Returncode from Tool
	ULONG	ftnm_Node		; NodeNummer for Tool usage (identify)
	ULONG	ftnm_Data2		; unsigned long based datafield 2
	ULONG	ftnm_UnUsed
	ULONG	ftnm_BitFlags		; A bit mask for future use
	ULONG	ftnm_BitRequests1	; A bit mask for requests 1
	ULONG	ftnm_BitRequests2	; A bit mask for requests 2
	ULONG	ftnm_BitRequests3	; A bit mask for requests 3
	ULONG	ftnm_BitRequests4	; A bit mask for requests 4
	ULONG	ftnm_IdentifyCode	; To identify the Tool
	APTR	ftnm_StringPtr		; string pointer
	APTR	ftnm_StructDummy1	; typeless ptr for structs and more
	LABEL	ftnm_SIZEOF

; Returncodes you can set for the Server:
; 0 Everything ok, delete request
; 1 Everything ok, hold request


; OLM structure of dynamic allocated list entries to be as result the
; complete OLM text.
;
; Note: You must free fols_OLMessage with FreeVec first before you
;		 free any list entry!!!
;
; Why a dynamic allocation? Because after the guide lines noone should
; send more than 1kb and ideally no more than 256 characters per write
; to the console. So you can have more shorter strings. MainPart needs
; this also because of lists from editors used to write olms.

	STRUCTURE	FAMEOLMString,0
	APTR	fols_Next	; Pointer to the Next list entry
	APTR	fols_Prev	; Pointer to the Prev list entry
	APTR	fols_OLMessage	; OLM message text. Note, it has
				; been dynamic allocated via
				; AllocVec and so you have to
				; deallocate it via FreeVec
				; before you begin to free one
				; of the list entries!!!
	LABEL	fols_SIZEOF


; OLM structure to send online messages.
;
; Note: You must free the list beginning with folm_First first completely
;		 before you free any list entry!!!
;		 Note also the note for the structure FAMEOLMString!!!

	STRUCTURE	FAMEOnlineMsg,0
	APTR	folm_Next		; Pointer to the Next list entry
	APTR	folm_Prev		; Pointer to the Prev list entry
	APTR	folm_FirstOLMStr	; The first entry of the dynamic
					; allocated OLM text list
	STRUCT	folm_Sender,32		; The name of the user/tool
					; who/which has send this olm
	STRUCT	folm_Command,202	; Maybe a menu command, FAMEChat
	ULONG	folm_NodeNr		; The node number of the sender
	ULONG	folm_BitFlags		; Bit flags for different things
	LONG	folm_Time		; The time the olm was sent
	LONG	folm_Date		; The date the olm was sent
	LABEL	folm_SIZEOF

   ENDC * FAME_FAMEPUBLICSTRUCTS_I
