Linking the R DLL into other applications
=========================================

The file rtest.c provides an example of linking the R engine into
another front end. To build it

- edit it to set Rp->rhome and Rp->home appropriately.

- to make with gcc,  make -f make.rtest

- to make with VC++,

	copy ..\R.exp and ..\R.dll to this directory
	lib /def:R.exp /out:Rdll.lib
	cl /MT /Ox /D Win32 /I..\..\include /I.. rtest.c Rdll.lib

This provides an rterm-like test front end. The main loop is in the
main program here: R_ReplDLLdo1() parses one line (up to ; or \n) and
returns 1 if complete, 2 if incomplete as an R expression.

There is a callback available during evaluation, plotting and console I/O,
intended to be used for processing GUI events. (The pager and graphics
windows' GUI events are handled at these times by ProcessEvents: the
callback is called from within ProcessEvents.)

An alternative to linking the import library would be to explicitly
load the DLL from a known location or after searching for it.

The example shows one way to handle user interrupts, although it might be
as easy to generate a SIGINT directly from a GUI front end. For this
to be useful you will want to set R_Interactive to be true, and you will need
to use SETJMP to jump back to somewhere useful in your code.
