/*********************************************************
 * Gotcha library example code.
 * (c)1995 Thomas Bickel. All rights reserved.
 *
 * Request a port from the user.
 *********************************************************/
#include <stdio.h>
#include <strings.h>
#include <stdlib.h>

#include <exec/types.h>

#include <clib/exec_protos.h>
#include <pragmas/exec_pragmas.h>

#include <clib/gotchalib_protos.h>
#include <pragmas/gotchalib_pragmas.h>
#include <libraries/gotchalib.h>

struct Library *GotchaLibBase;
struct gl_portreq prequest;
UBYTE result[64];

/***********************************************************************/
int main(long argc, char *argv[])
{
	if (GotchaLibBase = OpenLibrary("gotcha.library",1)) {

		prequest.scr	= NULL;
		prequest.win	= NULL;
		prequest.wtitle	= "Select an ARexx port";
		prequest.defport= "GOTCHA";
		prequest.res	= result;
		prequest.resmax	= sizeof(result);
		prequest.flags	= 0;

		if (GLB_OK == GL_PortRequest(&prequest)) printf("You selected: %s\n",result);

		CloseLibrary(GotchaLibBase);
	} else
		puts("Could not open 'gotcha.library'!");
}
