#ifndef RECCOON_RECCOON_H
#define RECCOON_RECCOON_H TRUE
/*
**  $Filename: Reccoon/Reccoon.h $
**  $Release: 0.58 $
**  $Revision: 58.2 $
**  $Date: 94/02/22 $
**
**  Misc Reccoon structures.
**
**  (C) Copyright 1991-94 Niclas Emdelius.
**          All Rights Reserved
*/ 

#define MAXAKAS 10
#define PATHSIZE 64
#define FILMAXMARK 30		// Obsolete
#define STR_MAXSTRINGS 256	// Look at Reccoon-BText.h

#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif

#ifndef EXEC_PORTS_H
#include <exec/ports.h>
#endif

/*** Reccoon's timedate structure. Used in messages, files etc. ***/
	
struct TimeDate
{
	unsigned int weekday: 3;	// Day of week (unused) 0-sun
	unsigned int hour   : 5;	
	unsigned int minute : 6;
	unsigned int second : 5;	// Second/2
	unsigned int day    : 5;
	unsigned int month  : 4;
	unsigned int year   : 4;	// year-1991
};

/*
** To be sure your program returns all allocated memory use Recclib's
** RAllocMem() and RFreeMem() functions instead of exec's AllocMem() and
** FreeMem().
** Then call Recclib's RFreeAllMem() at exit to free all allocated memory.
** 
** RAllocMem() etc are very easy to use; just have a 
** "struct RRemember *remember=0;" in the beginning of your program and use
** those functions just like exec's. (If you use the macros defined
** in Recclib.h)
*/

struct RRemember
{				// Almost like the Remember structure 
	struct RRemember *next;	// used by the intuition function
	struct RRemember *prev;	// AllocRemember(), but this one is
	ULONG size;		// slightly changed.
};

/*
** Reccoon's replacement for exec's List structure. I like this one
** much better.
*/

struct RList
{
	struct RNode *head;	// First structure in list or NULL for an empty list
	struct RNode *tail;	// Last structure in list or NULL for an empty list
	ULONG structsize;	// Size of each list member (for RFreeList() only)
};

/*
** Exec's Node structure replacement.
*/

struct RNode
{
	struct RNode *next;	// Next structure or NULL if this is the last one
	struct RNode *prev;	// Previous structure or NULL if this is the first one
	UBYTE *name;		// For use with RFindName()
};


/*
** This structure is passed to the function named CookString() in 
** reccoon.library. CookString() handles tilde display-codes in strings.
*/

struct CookData
{
	struct MsgList *	ml;
	struct FileList *	fl;
	struct ReccNode *	rn;
	struct usr *		usr;
	ULONG *			lastread;
	struct MsgAccess *	msgaccess;
	struct FileAccess *	fileaccess;
	struct msg *		msg;
	struct fil *		fil;
	struct control *	ctrl;
	UBYTE *			logfile;
	void 			(*LogOff)(void);
	BOOL			(*Skriv)(UBYTE *);
	UBYTE			(*GetChar)(UWORD flags);
	UBYTE *			disoutput;
	UBYTE *			cursor;
	UWORD *			linecount;
	WORD *			addedtime;
	struct IntuitionBase	*IntuitionBase;
	ULONG			msgnum;
	ULONG			filenum;
	struct fig *		fig;
	BYTE			(*ShowFile)(UBYTE *, UWORD);
	UBYTE *			CARRIER;
	UWORD			minaccess;	// Minaccess for output
};


/*** Flags for GetChar(). OR them together. ***/

#define GC_NOWAIT 1		// Don't wait for character
#define GC_NOTIME 2		// Don't check time limit
#define GC_NOIDLE 4		// Don't check idle timeout
#define GC_NOFILTER 8		// Don't filter characters

/*** Flags for GetString() ***/

#define GS_NOFILTER 1		// Filter characters
#define GS_NOECHO 2		// Echo '*' characters to user
#define GS_MIXED 4		// Auto Mixed Case Mode
#define GS_NUMERIC 8		// Numeric only mode
#define GS_EDIT 16		// Edit current string
#define GS_NEWLINE 32		// Send New-line after input


/*** Flags for SendString() and RSendString() ***/

#define SS_HOTKEY 1		// Hotkey string, abort when keyhit
#define SS_NOBRK 2		// No CTRL-C handling
#define SS_ASYNC 4		// Asynchronious mode
#define SS_NOLOCAL 8		// Send string to remote only
#define SS_NOXLATE 16		// Don't use character translation
#define SS_NOOPTIMIZE 32	// Don't optimize textoutput 
#define SS_OPTIMIZE 64		// Force textoutput-optimizing


/*** Flags for ShowFile(), ShowAnyFile() and ShowTheFile() ***/

#define SF_NONSTOP 1		// No 'More?' prompts
#define SF_NOTILDE 2		// Don't process tilde ctrl codes
#define SF_NOTIME 4		// Don't check time limit
#define SF_CURSOR 8		// Keep the cursor enabled
#define SF_NOBRK 16		// Don't check CTRL-C
#define SF_HOTKEY 32		// Hotkeyed textfile (menus etc)


/*** Searchmodes, sortmodes and flags for ListFiles() ***/

				// Select one of these searchmodes
#define LF_ALL 0		// List all files
#define LF_SINCE 1		// Since arg. (arg is a TimeDate structure pointer)
#define LF_SEARCH 2		// Search for arg. (arg is a string-pointer)
#define LF_SEARCHUL 3		// Search for uploader (arg is a string-pointer)
#define LF_SEARCHUNVAL 4	// Search for unvalidated files
#define LF_MODEMASK 31
				// then OR together one sort-mode
#define LF_NOSORT 0		// Natural order (fastest)
#define LF_CHRONOO 0x20		// Chronolog. (old->new) (future)
#define LF_CHRONON 0x40		// Chronolog. (new->old) (future)
#define LF_ALPHA 0x60		// Alpha.                (future)
#define LF_SORTMASK 992
				// then finally OR together some of these flags
#define LF_HEADER 0x400		// Show list-header
#define LF_VERBOSE 0x800	// Verbose listing
#define LF_FLAGMASK 64512
				// Example:
				// ListFiles(area, LF_SEARCH | LF_CHRONOO | LF_HEADER, (void *)"Whatever");



#endif
