/*---------------------------------------------------------------------------------------
Purpose: small DLL to exercise the dynamic loading features of
the PUPS system
Author: Mark O'Neill
Digital Vision
Didcot
Oxfordshire
OX11 8QY
Dated: 7 July 1999
Version: 1.00
E-mail: mao@ermine.ox.ac.uk
---------------------------------------------------------------------------------------*/
#include <stdio.h>
#include <xtypes.h>
#include <psrp.h>
/* PSRP communication channels - required if exported function */
/* are dynamic PSRP action functions */
_IMPORT FILE *psrp_in,
*psrp_out;
/*---------------------------------------------------------------------------------------
Each dynamic function must supply four pieces of information. Firstly the
_BOOLEAN <func>_is_orifice = TRUE tells the binder (in dlllib) that this
function may be legitately exported. The <func>_prototype is used to make
sure that importing process and the exportying DLL can do dynamic type
checking (in the future, they may also do type broking aka CORBA). The
<func>_info pointer optionally points to a string which supplies user
readable information about the exported function.
The last piece of infomation supplied is, of course, the function
itself ...
---------------------------------------------------------------------------------------*/
/* Mark this function as being orifice exportable */
_PUBLIC _BOOLEAN phlegm_is_orifice = TRUE;
/* Optional information field */
_PUBLIC char *phlegm_info = "Mucus by any other name";
/* Prototype for function (note this is a PSRP dynamic function prototype) */
_PUBLIC char *phlegm_prototype = "int (*)(int, char *[])";
/* The function actually exported */
_PUBLIC int phlegm(int argc, char *argv[])
{ fprintf(psrp_out,"phlegm\n");
fflush(psrp_out);
return(PSRP_OK);
}
/* Optional information field */
_PUBLIC _BOOLEAN sickbag_is_orifice = TRUE;
/* Prototype for function (note this is a PSRP dynamic function prototype) */
_PUBLIC char *sickbag_info = "The sickbag";
/* The function actually exported */
_PUBLIC char *sickbag_prototype = "int (*)(int, char *[])";
/* The function actually exported */
_PUBLIC int sickbag(int argc, char *argv[])
{ fprintf(psrp_out,"sickbag\n");
fflush(psrp_out);
return(PSRP_OK);
}