int main() { if (gwmInit() != 0) { fprintf(stderr, "Failed to initialize GWM!\n"); return 1; }; GWMGlobWinRef wins[128]; GWMGlobWinRef focused; int count = gwmGetDesktopWindows(&focused, wins); printf("There are %d windows open\n", count); if (focused.fd != 0) { printWindowInfo("Focused window: ", &focused); }; int i; for (i=0; i<count; i++) { printWindowInfo("", &wins[i]); }; gwmQuit(); return 0; };
int main(int argc,char *argv[]) { pthread_t timerThread, senderThread, receiverThread; int nReceivers,size,mss; int iret1,iret2,iret3; //strcpy(); nReceivers = (argc -3 )/2; initReceivers(argv,nReceivers); size = atoi( argv[argc-2] ); mss = atoi( argv[ argc-1 ] ); initWindow(size,mss); printWindowInfo(); printReceiverList(); iret1 = pthread_create( &senderThread, NULL, senderFunction,(void *) argv[argc-3]); iret2 = pthread_create( &receiverThread, NULL, recvFunction, NULL); iret3 = pthread_create( &timerThread, NULL, timer, NULL); pthread_join( timerThread, NULL); pthread_join( receiverThread, NULL); pthread_join( timerThread, NULL); }