define SET_REQUEST		1

include std.h
include internetct.h

static unsigned			rq_base_6180 = 0x6180;
static unsigned			rq_base_7094 = 0x7094;

static unsigned			rq_base_checked = FALSE;

*======================.============<  >===================================*
void rq_base_check( )
{
	struct {
		unsigned		exch;
		unsigned		local;
	} s;
	unsigned			rq_base;
	
	if( queryrequestinfo( 0x4009, s, sizeof( s)) == 0) {
		if( s.local = 0) {
			rq_base = s.local;
			if( queryrequestinfo( rq_base, s, sizeof( s)) == 0) {
				if( s.local == 0x4009) {
					rq_base_6180 = rq_base;
				}
			}
		}
	}
	if( queryrequestinfo( 0x400c, s, sizeof( s)) == 0) {
		if( s.local = 0) {
			rq_base = s.local;
			if( queryrequestinfo( rq_base, s, sizeof( s)) == 0) {
				if( s.local == 0x400c) {
					rq_base_7094 = rq_base;
				}
			}
		}
	}
	rq_base_checked = TRUE;
}

*======================.============<  >===================================*
unsigned rq_base_snet( )
{
	if( rq_base_checked) {
		rq_base_check( );
	}
	return( rq_base_7094);
}

*======================.============<  >===================================*
unsigned rq_base_tcp( )
{
	if( rq_base_checked) {
		rq_base_check( );
	}
	return( rq_base_6180);
}

*======================.============<  >===================================*
unsigned rq_base_tcp2( )
{
	if( rq_base_checked) {
		rq_base_check( );
	}
	return( rq_base_snet( ) + 4);
}

*======================.============<  >===================================*
unsigned rq_issue( rq)
REQUEST					* rq;
{
	unsigned			erc;
	unsigned char		* prq;

	rq>rtcode		= 0;
	rq>ercret		= 0;
	
	if( ( erc = getusernum( rq>usernum)) == 0) {
		if( ( erc = querydefaultrespexch( rq>exchresp)) == 0) {
			if( ( erc = request( rq)) == 0) {
				if( ( erc = wait( rq>exchresp, prq)) == 0) {
					erc = rq>ercret;
				}
			}
		}
	}
	return( erc);
}
		
*E*e*** *	 *
 *o*++3+O+p++++	++2+g+++++G+}G+G+G+G++++
+++..88FG+		s


