#include <exec/types.h>

#include <stdio.h>

#include "version.h"
#include "libinfo.h"
#include "output.h"


/* Information for C:Version */
const char verstr[] = "$VER: LibMon "PROG_VER"."PROG_REV" ("PROG_DATE")";


/*--- Output ---*/

/*
** Output LibMon header
*/
void OutputHeader(void)
{
  BoldText();
  puts("Library Monitor v"PROG_VER"."PROG_REV" © "PROG_DATE" Karl J. Ots");
  PlainText();
  puts("");
}

/*
** Output usage information
*/
void OutputUsage(void)
{
  puts("Usage: LibMon <libraries> <ALL> <LIST> <FLUSH>");
  puts("");
}

/*
** Output Library Info Header
*/
void OutputLibInfoHeader(void)
{
  Colour2Text();
  puts("Address    Library                     Version     Pri   OpenCnt");
  PlainText();
}

/*
** Output specified Library Info data
*/
void OutputLibInfo(struct LibInfo *li)
{
  printf("%08X   %-25s   %3d.%-4d   %4d   %5d\n",li->Address,
                                                 li->Name,
                                                 li->Version,
                                                 li->Revision,
                                                 li->Priority,
                                                 li->OpenCount);
}

/*
** Output flushed Library Information data
*/
void OutputFlushedLibInfo(struct LibInfo *li)
{
  printf("%s v%d.%d flushed.\n",li->Name,
                                li->Version,
                                li->Revision);
}

/*
** Output that library could not be found
*/
void OutputLibNotFound(STRPTR name)
{
  printf("           %s was not found in memory.\n",name);
}


/*--- Text colour/style ---*/

/*
** Change to plain text
*/
void PlainText(void)
{
  printf("\033[0m");
}

/*
** Change to bold text
*/
void BoldText(void)
{
  printf("\033[1m");
}

/*
** Change text colour to #2
*/
void Colour2Text(void)
{
  printf("\033[32m");
}

/* 
** Change text colour to #3
*/
void Colour3Text(void)
{
  printf("\033[33m");
}
