
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <proto/dos.h>
#include "defines.h"
#include "cus.h"
#include "rev.h"

void giveversioninfo(char *progname)
{
	char *buffer = NULL;
	char *ptr;

	if ((buffer = (char *)malloc(RANGE_12BIT)) == NULL)
		CU2();
	ptr = buffer;
	strupr(progname);
	ptr += sprintf(ptr, "[1m%s Release %s.%02d (%s) -- UUCP polling server[0m\n"
						"%s(c) Copyright 1991,92 Ralf S. Engelschall, All Rights Reserved.\n"
						"%s(c) Copyright 1991,92 Cyvaned Systems, All Rights Reserved.\n\n",
						progname, Version, Revision, Date, progname, progname );

	ptr += sprintf(ptr, "  This  release  is  distributed  under  the  conditions specified in\n"
						"UUPoll.man  Using  this  program implies that you have accepted these\n"
						"licence statements and/or conditions.\n" );

	ptr += sprintf(ptr, "                        ___  _______\n"
                        "Ralf S. Engelschall,    /__)(_  /_              rse@angle.muc.sub.org\n"
                        " Weblinger Weg 28,     / \\____)(___           rse@cyvaned.muc.sub.org\n"
                        "  8060 Dachau,        /\n"
                        "   West Germany          ...!smurf.sub.org!brumuc!{angle,cyvaned}!rse\n\n" );
	strlwr(progname);
	Write(Output(), buffer, (int)(ptr-buffer));
	CUS:
	if (buffer)
		free(buffer);
	return;
}


void giveusage(char *progname)
{
	char *buffer = NULL;
	char *ptr;
	char padstr[RANGE_5BIT];
	int i;
	char *cp;

	if ((buffer = (char *)malloc(RANGE_12BIT)) == NULL)
		CU2();
	ptr = buffer;
	strlwr(progname);
	for (i = strlen(progname), cp = padstr; i > 0; i--)
		*cp++ = SP;
	*cp = NUL;
	ptr += sprintf(ptr, "Usage:  %s  [-sSystem] [-SSystem] [-rNum] [-dSec] [-tMin] [-uArg]\n"
						"        %s  [-m] [-a] [-xNum] [-i] [-v] [-?]\n"
						"\n"
						"  s  poll the specified system              m  setup modem before startup\n"
						"  S  like 's' but ignore time restrictions  a  always poll - ignore status\n"
						"  r  number of retries before giving up     x  number of debuglevel\n"
						"  d  seconds of retry delay time            i  restriction time info\n"
						"  t  minutes of restriction time            v  version info\n"
						"  u  additional uucico arguments            ?  usage info\n"
						"\n",
						progname, padstr);
	Write(Output(), buffer, (int)(ptr-buffer));
	CUS:
	if (buffer)
		free(buffer);
	return;
}

