#ifndef PMBSLIB2_H
#define PMBSLIB2_H

/* Flags für pmbsGetFlags() */

#define FLAGS_BIN          (0L)   /* Bit 0 - gelöscht */
#define FLAGS_ASCII        (1L)   /* Bit 0 - gesetzt */
#define FLAGS_ARCHIVIERT   (2L)   /* Bit 1 */
#define FLAGS_DELETED      (4L)   /* Bit 2 */
#define FLAGS_LONG_COMMENT (8L)   /* Bit 3 */

/* Einige Konstanten für die Ausgabe auf den Ports */

#define CLS  "\x1b[H\x1b[2J"      /* Löscht den Bildschirm */
#define CRLF "\r\n"               /* Fügt einen neue Zeile ein */

#define VG_SCHWARZ "°V0"          /* Setzt die VorderGrund-Farbe */
#define VG_ROT     "°V1"
#define VG_GRUEN   "°V2"
#define VG_GELB    "°V3"
#define VG_DBLAU   "°V4"          /* ... Dunkel-Blau */
#define VG_LILA    "°V5"
#define VG_HBLAU   "°V6"          /* ... Hell-Blau */
#define VG_WEISS   "°V7"

#define HG_SCHWARZ "°H0"          /* Setzt die HinterGrund-Farbe */
#define HG_ROT     "°H1"
#define HG_GRUEN   "°H2"
#define HG_GELB    "°H3"
#define HG_DBLAU   "°H4"          /* ... Dunkel-Blau */
#define HG_LILA    "°H5"
#define HG_HBLAU   "°H6"          /* ... Hell-Blau */
#define HG_WEISS   "°H7"

/* Die Werte für pmbsGetChar() */

#define CURSOR_UP    (200)
#define CURSOR_DOWN  (201)
#define CURSOR_LEFT  (202)
#define CURSOR_RIGHT (203)

#ifdef __cplusplus
extern "C" {
#endif

short pmbsSend( short port, char *buffer );
long  pmbsMemory( long *adr );
short pmbsQuit( short port );
short pmbsRead( short port, char *vorgabe, short anzahl, char *buffer );
short pmbsBRead( short port, char *vorgabe, short anzahl, char *buffer );
short pmbsGetDir( char *buffer );
short pmbsGetNetDir( char *buffer );
short pmbsGetUser( short port, char *buffer );
short pmbsGetUserDos( short port, char *buffer );
short pmbsGetBox( short port, char *buffer );
long  pmbsCheckCarrier( short port, long *adr );
long  pmbsGetChar( short port, char *adr );
long  pmbsSendFile( short port, char *filename, long *adr );
long  pmbsReceiveFile( short port, long *adr );
long  pmbsGetPoint( short port, char *buffer );
long  pmbsGetFree( short port, long *adr );
long  pmbsSetFree( short port, long freiraum );
long  pmbsGetLevel( short port, long *adr );
short pmbsCLIRead( short port, char *vorgabe, short anzahl, char *buffer );
short pmbsEdit( short port, char *filename, long *adr );
short pmbsCursor( short port, char *buffer, long *adr );
short pmbsLogoff( short port );
short pmbsGetDomain( short port, char *buffer );
short pmbsGetSubject( short port, char *buffer, short num );
short pmbsGetSender( short port, char *buffer, short num );
short pmbsGetComment( short port, char *buffer, short num );
short pmbsGetFlags( short port, long *flags, short num );
short pmbsUsDos( short port, char *buffer, long name );
short pmbsSetComment( short port, char *buffer, short num );

/* Undokumentierte Funktionen */

short pmbsGetTime( short port, long *time );
short pmbsSetTime( short port, long time );
short pmbsGetRest( short port, long *time );
short pmbsSetRest( short port, long time );
short pmbsGetPort( short port, char *buffer );

#ifdef __cplusplus
}
#endif

#endif  // PMBSLIB2_H
