/***************************************************************************
* requests.c : aus irgendeinem unerfindlichen Grund ist der Startup-Code   *
*	       für SimpleRequest() und TwoGadgetRequest() aus der          *
*	       req.library nicht in den #pragmas in req.h enthalten,	   *
*	       sondern nur im glue-File (lreqglue.o). Weil ich dieses      *
*	       benuztzen will (wozu gibt es schließlich pragmas) habe ich  *
*	       die unten stehenden Routinen aus req.doc kopiert. Dabei	   *
*	       habe ich gleich noch den Gadget-Text beim SimpleRequest()   *
*	       ins deutsche übersetzt (wird je nach LANG-DEFINE benutzt    *
*	       oder nicht).						   *
*									   *
* created: 21-Apr-91 Mtwx						   *
* updated: 21-Apr-91 Mtwx						   *
***************************************************************************/

#include <stdarg.h>
#include <exec/libraries.h>
#include <intuition/intuition.h>
#include <libraries/reqbase.h>
#include <clib/req_protos.h>
#include <req.h>

extern struct ReqLib *ReqBase;

void __stdargs SimpleRequest(char *str,...)
	{
	va_list ap;
	struct TRStructure trs;

	va_start(ap,str);

	trs.Text = str;
	trs.Controls = ap;
	trs.Window = 0;
	trs.MiddleText = 0;
	trs.PositiveText = 0;
#ifdef ENGLISH
	trs.NegativeText = "Resume";
#endif
#ifdef GERMAN
	trs.NegativeText = "Weiter";
#endif
	trs.Title = "Ahem...";
	trs.KeyMask = 0xFFFF;
	trs.textcolor = 2;
	trs.detailcolor = 3;
	trs.blockcolor = 2;
	trs.versionnumber = REQVERSION;
	trs.Timeout = 0;	/* you could put a timeout here if you wanted */
	trs.AbortMask = 0;	/* If you wanted to abort this requester from another */
						/* process, pass the mask for Signal() in this element. */
						/* Then just Signal() the process that brought up the requester */
	trs.rfu1 = 0;
	TextRequest(&trs);
	va_end(ap);
	}

short __stdargs TwoGadRequest(char *str,...)
	{
	va_list ap;
	struct TRStructure trs;
	short res;

	va_start(ap,str);

	trs.Text = str;
	trs.Controls = ap;
	trs.Window = 0;
	trs.MiddleText = 0;
	trs.PositiveText = "  OK  ";
	trs.NegativeText = "CANCEL";
	trs.Title = "Ahem...";
	trs.KeyMask = 0xFFFF;
	trs.textcolor = 2;
	trs.detailcolor = 3;
	trs.blockcolor = 2;
	trs.versionnumber = REQVERSION;
	trs.Timeout = 0;	/* you could put a timeout here if you wanted */
	trs.AbortMask = 0;	/* If you wanted to abort this requester from another */
						/* process, pass the mask for Signal() in this element. */
						/* Then just Signal() the process that brought up the requester */
	trs.rfu1 = 0;

	res = TextRequest(&trs);
	va_end(ap);
	return(res);
	}

