#ifndef RECCOON_MENU_H
#define RECCOON_MENU_H TRUE
/*
**  $Filename: Reccoon/Menu.h $
**  $Release: 0.58 $
**  $Revision: 58.3 $
**  $Date: 94/02/22 $
**
**  Reccoon menu commands and structures.
**
**  (C) Copyright 1991-94 Niclas Emdelius.
**          All Rights Reserved
*/ 

#ifndef RECCOON_RECCOON_H
#include <Reccoon/Reccoon2.h>
#endif

#define MNU_PROMPT 100
#define MNU_FILENAME (PATHSIZE+20)
#define MNU_ARGS 60

/*** These new structures are NOT active yet!  But they WILL be, I promise! ***/

struct new_Menu
{
	struct new_MenuFile *	menufiles;
	struct new_PromptFile * prompts;
	struct new_MenuKey *	keys;

	unsigned int 		selectable :1;	// Ehum? What is this for? (Can't remember, unused)
	unsigned int		hotkeyed   :1;
	unsigned int		unused 	   :30;
};

struct new_MenuFile
{
	struct new_MenuFile *	next;
	UWORD			minaccess;
	UWORD			maxaccess;
	UBYTE			filename[MNU_FILENAME];
};

struct new_PromptFile
{
	struct new_MenuFile *	next;
	UWORD			minaccess;
	UWORD			maxaccess;
	UBYTE			filename[MNU_FILENAME];
};

struct new_MenuKey
{
	struct new_MenuKey *	next;
	struct new_MenuComm *	comms;
	UBYTE			key[8];
};

struct new_MenuComm
{
	struct new_MenuComm *	next;
	UWORD			minaccess;
	UWORD			maxaccess;
	UWORD			bitmask;
	UWORD			bits;
	UWORD			comm;
	UBYTE			args[MNU_ARGS];
};

/*** Here comes the old menustructures. ***/

struct menufunc
{
	UBYTE 		menu_min[64];		// Min access
	UBYTE 		menu_max[64];		// Max access
	UBYTE 		menu_function[64]; 	// Menu function
	UBYTE 		menu_args[64][50]; 	// Menu argument(s?)
};
	
struct menu
{
	unsigned int 		hotkey :1; 		// 1= Hotkeyed menu (unused)
	unsigned int		unused :31;
	UBYTE 			menu_file[20];		// Default menu file name
	UBYTE 			menu_prompt[20];	// Default prompt file name
	struct   menufunc 	entry[5];		// Menu functions
};

/*** Menu commands, common for both FPL and Rcn menus  ***/

#define LOGOFF 1		// LogOff user.            ARGS: 	(Textfile)
#define LOG 2			// Enter line in logfile	 	Textline  
#define YELL 3          	// page Sysop                    	none      
#define LINKMENU 4      	// Jump to another menu          	MenuPage  
#define EXECUTE 5       	// Execute a DOS command         	(Command) 
#define PREVIOUS 6      	// Link previous Menu            	none      
#define PUTBUFF 7  		// Put string to input buffer    	String    
#define DROPBUFF 8		// Clear input buffer            	none      
#define USERLIST 9      	// Show the UserList             	none      
#define RUNDOOR 10      	// Run a Reccoon door program    	Name      
#define MSGAREA 11		// Goto a certain Msg area       	(Areanum) 
#define QUEST 12		// Give user questions		 	FileName  
#define SHOWMENU 13		// Show current menu		 	none	   
#define GETRETURN 14		// Wait for return key		 	(Prompt)  
#define SHOWFILE 15		// Show a text file		 	FileName  
#define ECHO 16			// Send a string to user	 	String    
#define CLS 17			// Clear Screen			 	none      
#define EXPSHOWMENU 18		// SHOWMENU - ignore expertmode	 	none      
#define PARRUNDOOR 19		// Run Paragon door		 	filename  
#define PASSWORD 20		// Prompt for Password		 	Password  

#define WRITE 21		// Write a message		 	(To)	   
#define WAITINGMAIL 23		// Check for waiting mail        	none	   
#define BACKMSGAREA 24  	// Goto msgarea-1		 	none	   
#define NEXTMSGAREA 25  	// Goto next message area        	none      
#define READFORWARD 26		// Read messages forward         	(start)   
#define READNEW 27		// Read new messages		 	none	   
#define READREVERSE 28		// Read reverse			 	(start)   
#define READMARKED 29		// Read marked messages		 	none	   
#define GLOBALREADNEW 30	// Global readnew		 	(SIG)	   
#define SEARCHNODELIST 31	// Search the Nodelist       		(searchstring)
#define SCANMSG 32		// *Scan messages	     		(Searchstring)
#define MSGSIG 33		// Change message SIG	         	(SIG)	   
#define LISTMSGAREAS 34 	// List message areas            	none      
#define LISTMSGSIGS 35 		// List message SIGs             	none      

#define PRM_MENU 40		// Change menu type		 	(type)	   
#define PRM_HANDLE 41   	// Change handle	   	 	(handle)  
#define PRM_SCRLENGTH 42	// Change screen length		 	(length)  
#define PRM_USERNAME 43 	// Change username               	(Name)    
#define PRM_CITY 44     	// Change City                   	(City)    
#define PRM_ACCESS 45   	// Change Access level           	(Access)  
#define PRM_TELE 46     	// Change Telenr                 	(Tele)    
#define PRM_COMPUT 47   	// *Change computer               	(comp#)   
#define PRM_EXPERT 48   	// Toggle expertmode             	(on/off)  
#define PRM_HOTKEYS 49  	// Toggle HotKeys                	(on/off)  

// Also take a look at menucommands 70-79

#define GOFILEAREA 50		// Go to a file area		 	(Area)	   
#define DOWNLOAD 51		// Download marked files. 	 	none	   
#define MARKFILE 52		// Markfile				(Filename) 
#define DOSMARKFILE 53 		// Mark DOS file			(Filename) 
#define ADDFILE 54		// Add a file to current area		(filename) 
#define NEXTFILAREA 55		// Go to next file area		 	none	   
#define BACKFILAREA 56		// Go to filearea-1		 	none	   
#define LIMARKEDFIL 57		// List marked files		 	none	   	
#define UPLOAD 58		// Upload file(s)	         	none	   
#define FILESIG 59		// Change file-SIG		 	(SIG)     
//#define LISTALLFILES 60 	// list all files.               	none	   
#define LISTFILAREAS 61 	// List message areas            	none      
#define LISTFILSIGS 62 		// List message SIGs             	none      
//#define LISTNEWFILES 63 	// List new files		 	none	   
//#define GLOBALLISTNEWFILES 64	// List new files global   		none	   
#define REMOVEFILES 65		// Remove files from markedfiles	   	
//#define LISTSEARCH 66		// List files with searchstring  	(string)
//#define GLBLISTSEARCH 67	// Global list files w/ search	 	(string)
#define VIEWARCHIVE 68		// View archive contents		(Filename)

#define PRM_ZIP 70      	// Change ZipCode                	(Zip)
#define PRM_FSED 71     	// Toggle FSEditor              	(On/Off)
#define PRM_CLUDGES 72  	// Toggle MessageCludges        	(On/Off)	
#define PRM_LASTREAD 73 	// *Set lastread-pointers       	(Pointer)	
#define PRM_PASSWORD 74 	// Change password              	(password)	
#define PRM_XLATE 75		// Character translation	 	(number)  
#define PRM_BIRTH 76		// Birthday			 	none	   
#define PRM_OPTIMIZE 77 	// Optimize textoutput			(On/Off)   

#define PREVMSGAREA 80		// Previous Msgarea		 	none	   
#define PREVFILAREA 81		// Previous Filearea			none	   
#define SIG 82			// Change both file&msg SIG      	(SIG)	   
#define BRODCAST 83		// Send message to all nodes     	(string)
#define RETURNFPL 84		// Return to FPL-Script		 	none	
#define SHOWNONSTOP 85		// Show a textfile without pauses	Filename
#define SHOWANYFILE 86		// Show a textfile with full path	Path&Filename
#define SHOWANYNONSTOP 87	// Show a textfile nonstop with path	Path&Filename

#define GLBLIST_NS_ALL 90	// Global-list, Nosort, all      	(Sig)	
#define GLBLIST_NS_NEW 91	// Global-list, Nosort, new      	(Sig)	
#define GLBLIST_NS_SEARCH 92	// Global-list, Nosort, search   	(String)
#define GLBLIST_NS_SEARCHUL 93  // Global-list, Nosort, search uploader (Name)	
#define GLBLIST_NS_UNVAL 94	// Global-list, Nosort, list unval	(Sig)
#define GLBLIST_ON_ALL 95	// Global-list, Old-new, all      	(Sig)	
#define GLBLIST_ON_NEW 96	// Global-list, Old-new, new      	(Sig)	
#define GLBLIST_ON_SEARCH 97	// Global-list, Old-new, search   	(String)
#define GLBLIST_ON_SEARCHUL 98	// Global-list, Old-new, search uploader (Name)	
#define GLBLIST_ON_UNVAL 99	// Global-list, Old-new, list unval	(Sig)
#define GLBLIST_NO_ALL 100	// Global-list, New-old, all      	(Sig)	
#define GLBLIST_NO_NEW 101	// Global-list, New-old, new      	(Sig)	
#define GLBLIST_NO_SEARCH 102	// Global-list, New-old, search   	(String)
#define GLBLIST_NO_SEARCHUL 103 // Global-list, New-old, search uploader (Name)	
#define GLBLIST_NO_UNVAL 104	// Global-list, New-old, list unval	(Sig)

#define LIST_NS_ALL 105		// List, Nosort, all      		(Area)	
#define LIST_NS_NEW 106		// List, Nosort, new      		(Area)	
#define LIST_NS_SEARCH 107	// List, Nosort, search   		(String)
#define LIST_NS_SEARCHUL 108  	// List, Nosort, search uploader 	(Name)
#define LIST_NS_UNVAL 109	// List, Nosort, list unval		(Area)
#define LIST_ON_ALL 110		// List, Old-new, all      		(Area)
#define LIST_ON_NEW 111		// List, Old-new, new      		(Area)
#define LIST_ON_SEARCH 112	// List, Old-new, search   		(String)
#define LIST_ON_SEARCHUL 113	// List, Old-new, search uploader 	(Name)
#define LIST_ON_UNVAL 114	// List, Old-new, list unval		(Area)
#define LIST_NO_ALL 115		// List, New-old, all      		(Area)
#define LIST_NO_NEW 116		// List, New-old, new      		(Area)
#define LIST_NO_SEARCH 117	// List, New-old, search   		(String)
#define LIST_NO_SEARCHUL 118 	// List, New-old, search uploader 	(Name)
#define LIST_NO_UNVAL 119	// List, New-old, list unval		(Area)

#define RUNAREXX 120		// Launch an ARexx-script		Filename
#define FPLHOOK 121		// Call a FPL-Hook			FunctionName
#define SIMPLEDOS 122		// Execute a DOS-command. No input.	Command

// FPL only commands

#define FPLM_GETKEY 20000 	// Get menuchoise from user		[bool noecho, bool nowait, bool hotkey] 
#define FPLM_SETMENU 20001	// Set menu textfile			<string Filename>	
#define FPLM_SETPROMPT 20002	// Set prompt textfile			<string filename>	
#define FPLM_GETLEVEL 20003	// Get user's accesslevel		none			
#define FPLM_GETGFX 20004	// Get user's graphicsmode		none			
#define FPLM_GETNAME 20005	// Get user's name			none			
#define FPLM_GETHANDLE 20006	// Get user's handle			none			
#define FPLM_GETMSGSIG 20007	// Get current msgSIG			none			
#define FPLM_GETMSGAREA 20008	// Get current msgarea			none			
#define FPLM_GETFILESIG 20009	// Get current fileSIG			none			
#define FPLM_GETFILEAREA 20010	// Get current filearea			none			
#define FPLM_GETAGE 20011	// Get user's age			none			
#define FPLM_SETMENUNUM 20012	// Set current menu-number		<number>		
#define FPLM_GETMENUNUM 20013	// Get current menu-number		none			
#define FPLM_GETULB 20014	// Get bytes upload			none
#define FPLM_GETULF 20015	// Get files upload			none
#define FPLM_GETDLB 20016	// Get bytes download			none
#define FPLM_GETDLF 20017	// Get files download			none
#define FPLM_GETSTRING 20018	// Get string from user			<maxlength> [flags]
#define FPLM_GETTIMEUSED 20019	// Get time used			none
#define FPLM_GETTIMELEFT 20020	// Get remaning time			none
#define FPLM_ADDTIME 20021	// Add time to user			<minutes>
#define FPLM_GETLINE 20022	// Get current line-number		none
#define FPLM_YESNO 20023	// Prompt user for Y/n			<prompt> [Y-key] [N-key]
#define FPLM_NOYES 20024	// Prompt user for y/N			<prompt> [Y-key] [N-key]


/* All standard-lib functions are not yet implmemended */

// FPL standard-lib functions. Just like the ANSI-C standard. (but not as many)

// file-functions.

#define FPLST_FCLOSE	30000	// fclose()
#define FPLST_FFLUSH	30001	// fflush()
#define FPLST_FOPEN	30002	// fopen()
#define FPLST_FREOPEN	30003	// freopen()
#define FPLST_FPRINTF	30004	// fprintf() (future)
#define FPLST_FSCANF	30005	// fscanf()  (future)
#define FPLST_FGETC	30006	// fgetc()
#define FPLST_FGETS	30007	// fgets()
#define FPLST_FPUTC	30008	// fputc()
#define FPLST_FPUTS	30009	// fputs()
#define FPLST_FREAD	30010	// fread()
#define FPLST_FWRITE	30011	// fwrite()
#define FPLST_FGETPOS	30012	// fgetpos()
#define FPLST_FSEEK	30013	// fseek()
#define FPLST_FSETPOS	30014	// fsetpos()
#define FPLST_FTELL	30015	// ftell()
#define FPLST_REWIND	30016	// rewind()
#define FPLST_FEOF	30017	// feof()
#define FPLST_FERROR	30018	// ferror()
#define FPLST_PRINTF	30020	// printf()  (not stdio) (future)
#define FPLST_SPRINTF	30021	// sprintf()
#define FPLST_PUTS	30022	// puts()    (not stdio)

// String functions  (fpl got some built-in functions too)

#define FPLST_STRCPY	30100	// strcpy()
#define FPLST_STRNCPY	30101	// strncpy()
#define FPLST_STRICMP	30102	// stricmp()



/*** Want more commands?  Give me suggestions! ***/

#endif
