/*============================================================================ * * fxdemo2 - studio test application broker * Generated by adfgen from adfgen.gsl on 2004/07/22, 17:52:22. * * WTP broker - must be run from Xitami/Studio. * *===========================================================================*/ #define USE_WTP_BROKER 1 #include "sfl.h" /* SFL prototypes & definitions */ #include "formio.h" /* Formio definitions */ #include "wtplib.h" /* WTP definitions */ #include "wtpmsg.h" /* WTP message API */ #include "browtp.h" /* WTP broker definitions */ static void handle_signal (int the_signal); int main (int argc, char *argv []) { char *version, /* WTP version string */ *protocol, /* Protocol to use */ *port, /* Port number */ *callback; /* Callback key */ signal (SIGINT, handle_signal); signal (SIGTERM, handle_signal); console_set_mode (CONSOLE_DATETIME); if (argc < 4) { puts ("Must be run from WTP manager!"); exit (0); } else { version = argv [1]; protocol = argv [2]; port = argv [3]; callback = argv [4]; } wtp_open (version, protocol, port); wtp_connect (callback, argv [0]); wtp_register ("fxtest1", 1); wtp_ready (); /* Pass to WTP manager */ wtp_broker (); return (EXIT_SUCCESS); } local handle_signal (int the_signal) { switch (the_signal) { case SIGINT: case SIGTERM: puts (" - interrupted"); break; } exit (1); } /* We must define each program that the broker contains, with a C * prototype and an entry in the broker map table. */ int fxtest1_program (SESSION *session); BROKER_MAP wtp_broker_map [] = { { "fxtest1", fxtest1_program }, { NULL, NULL } }; /* This function initialises the broker and returns the name of the * application root program. */ char * wtp_root (void) { return ("fxtest1"); }