/*
** Verwaltung der Auftragsliste
**
** Copyright (C) 1996 by Stefan Scherer.
**
** Permission to use, copy, modify, and distribute this software and its
** documentation for non-commerical use and without fee is hereby granted,
** provided that the above copyright notice appear in all copies and that
** both that copyright notice and this permission notice appear in
** supporting documentation.  This software is provided "as is" without
** express or implied warranty.
*/

#ifndef AUFTRAGSLISTE_H
#define AUFTRAGSLISTE_H

#include <exec/types.h>
#include "Auftrag.h"

int ConstructOrderList (void);
void DestructOrderList (void);


/* o-functions */

int OL_SetYear (UWORD year);

int OL_NewOrder (struct MinOrder *item);
int OL_DelOrder (void);
int OL_ChangeOrder (struct MinOrder *item);
int OL_SetCurrentOrderNumber (UWORD number);

int OL_LoadOrder (struct MinOrder *minorder);
int OL_SaveOrder (struct MinOrder *minorder);


/* v-functions */

UWORD OL_GetOrderCount (void);
int OL_GetOrder (UWORD number, struct MinOrder *item);
int OL_GetCurrentOrderNumber (void);
int OL_GetCurrentOrder (struct MinOrder *order);

int OL_GetYear (UWORD num, UWORD * year);
UWORD OL_GetCurrentYear (void);
UWORD OL_GetCurrentYearNumber (void);
UWORD OL_GetYearCount (void);
UWORD OL_GetNextOrderNumber (void);
STRPTR OL_GetErrorMsg (void);


/* Fehlermeldungen */

enum
  {
    ERR_OL_OK,			/* alles in Ordnung */
    ERR_OL_YEAR,		/* Jahresnummer außerhalb der Grenzen */
    ERR_OL_LISTEMPTY,		/* Liste ist leer */
    ERR_OL_NOITEM,		/* Eintrag nicht in Liste vorhanden */
    ERR_OL_NOMEM,		/* kein Speicher */
    ERR_OL_NOPOOL,		/* kein Memory-Pool */
    ERR_OL_NOPATH,		/* Problem beim Verzeichnis-Pfad */
    ERR_OL_EXALL,		/* Problem bei ExAll() */
    ERR_OL_ORDER,		/* Fehler bei Auftrag (laden/speichern) */
    ERR_OL_FILELIST,		/* Fehler beim File "Auftragsliste" */
    ERR_OL_SAVE,		/* Fehler beim speichern */
  };

#endif /* AUFTRAGSLISTE_H */
