/*********************************************************************
 *
 *   This is ADT, a user friendly frontend for Aminet FTP sites.
 *
 *   adt.h: data types, defines, etc...
 *
 *********************************************************************/

#ifndef __ADT_H_
#define __ADT_H_

/* Flags */

#define FLAG_TAG      1<<0
#define FLAG_README   1<<1

#define IS_TAGGED(entry) (entry->flags & FLAG_TAG)
#define HAS_README(entry) (entry->flags & FLAG_README)

/* Type defenitions */

/* struct link                 // Generic link structure //
{
  struct link *next;
  struct link *prev;
}; */

struct adt_entry             /* File entry */
{
  struct adt_entry *next;
  struct adt_entry *prev;
  char *file;
  char *dir;
  long time;
  long size;
  char *desc;
  char *readme;
  long flags;
};

#define ENTRY struct adt_entry

struct adt_server             /* Server entry */
{
  char *country;
  char *host;
  char *dir;
};

#define SERVER struct adt_server

struct adt_help              /* Help entry */
{
	char *command;
	char *desc;
};

#define HELP struct adt_help

struct adt_tag             /* Actual list entries */
{
  struct adt_tag *next;
  struct adt_tag *prev;
  ENTRY  *entry;
};

#define TAG struct adt_tag

/* list type indication  */

#define M_SERVER 0          /* Server selcection mode */
#define M_HELP   1          /* Help options mode */
#define M_TAG    2          /* Tag list display */
#define M_NEW    3          /* display new files */
#define M_RECENT 4          /* display recent files */
#define M_ALL    5          /* display all files */

#define ENTRY_MODE (Mode == M_NEW || Mode == M_RECENT || Mode == M_ALL)
#define MULTI_MODE (Mode == M_TAG || ENTRY_MODE)

/* sort types */

#define SORT_NONE     0
#define SORT_NAME     1
#define REV_SORT_NAME 2
#define SORT_SIZE     3
#define REV_SORT_SIZE 4
#define SORT_DIR      5
#define REV_SORT_DIR  6
#define SORT_AGE      7
#define REV_SORT_AGE  8
#endif
