This is the main() cpp sourcefile. It is initially generated by pvdevelop. Using the #define USE_INETD you can decide if you want a multi threaded pvserver (default) or use xinetd. Within pvMain() the handling of your masks starts. You may insert some lines of your own code in there.
//*************************************************************************** // main.cpp - description // ------------------- // begin : Mi Mrz 28 18:50:07 2007 // generated by : pvdevelop (C) 2000-2006 by Lehrig Software Engineering // email : lehrig@t-online.de //*************************************************************************** #include "pvapp.h" // todo: comment me out. you can insert these objects as extern in your masks. rlModbusClient modbus(modbusdaemon_MAILBOX,modbusdaemon_SHARED_MEMORY,modbusdaemon_SHARED_MEMORY_SIZE); //rlSiemensTCPClient siemensTCP(siemensdaemon_MAILBOX,siemensdaemon_SHARED_MEMORY,siemensdaemon_SHARED_MEMORY_SIZE); //rlPPIClient ppi(ppidaemon_MAILBOX,ppidaemon_SHARED_MEMORY,ppidaemon_SHARED_MEMORY_SIZE); int pvMain(PARAM *p) { int ret; pvSetCaption(p,"pvs"); pvResize(p,0,1280,1024); //pvScreenHint(p,1024,768); // this may be used to automatically set the zoomfactor ret = 1; pvGetInitialMask(p); if(strcmp(p->initial_mask,"mask1") == 0) ret = 1; while(1) { switch(ret) { case 1: pvStatusMessage(p,-1,-1,-1,"mask1"); ret = show_mask1(p); break; default: return 0; } } } #ifdef USE_INETD int main(int ac, char **av) { PARAM p; pvInit(ac,av,&p); /* here you may interpret ac,av and set p->user to your data */ pvMain(&p); return 0; } #else // multi threaded server int main(int ac, char **av) { PARAM p; int s; pvInit(ac,av,&p); /* here you may interpret ac,av and set p->user to your data */ while(1) { s = pvAccept(&p); if(s != -1) pvCreateThread(&p,s); else break; } return 0; } #endif