int main(unsigned argl, const char far* args) { STACK_DECL char arg[128]; uint16 cmd; int_init(); tsr_loaded = tsr_is_installed(); /* Duplicate the command line locally */ memcpy(arg, args, argl); arg[argl] = 0; /* Call the main TSR function */ if (tsr_loaded) cmd = tsr(mem_remote, arg); else cmd = tsr(0, arg); if (cmd == TSR_LOAD) { if (tsr_loaded) return EXIT_FAILURE; if (!load()) return EXIT_FAILURE; /* device driver hasn't the environment */ if (!tsr_sys) freeenv(); return EXIT_TSR; } if (cmd == TSR_UNLOAD) { if (!tsr_loaded) return EXIT_FAILURE; if (!mem_unload()) { cputs("Can't unload\n\r"); return EXIT_FAILURE; } if (freemem(tsr_loaded->psp) != 0) { cputs("Can't release the memory\n\r"); return EXIT_FAILURE; } return EXIT_SUCCESS; } if (cmd == TSR_SUCCESS) return EXIT_SUCCESS; else return EXIT_FAILURE; }
void main(void) { struct address { char far *p; }; struct address far *addr = (struct address far *) 20; addr->p = (char far *) int_5; tsr(500); // keeps 500 * 16 bytes resident (8k) }
void winfo::show_info(xwindow *cl, QString &wmname, QString &clientfqdn, QString &command, QString &rn, QString &rc, int inc_w, int inc_h, int base_w, int base_h) { QWidget *dt = QApplication::desktop(); int i; if(client != NULL) { release_cancel(); return; } WindowManager::menu_open = TRUE; client = cl; res_name = rn; res_class = rc; int cx,cw,ch; cx = client->x()+(WindowManager::adesk*dt->width()); cw = (inc_w > 1)?((client->width()-base_w)/inc_w):(client->width()); ch = (inc_h > 1)?((client->height()-base_h)/inc_h):(client->height()); QString gm; gm.sprintf("%dx%d+%d+%d", cw, ch, cx, client->y()); QString txtr; QTextStream tsr(&txtr); tsr << ": " << wmname.left(50) << " \n" << ": " << res_name.left(50) << " \n" << ": " << res_class.left(50) << " \n" << ": " << clientfqdn.left(50) << " \n" << ": " << command.left(50) << " \n" << ": " << gm << ' '; right->setText(txtr); for(i=0; i < 8; i++) qcbox[i]->setChecked((client->get_pflags() & qcf[i])?TRUE:FALSE); XRaiseWindow(QX11Info::display(), winId()); show(); move((dt->width()/2)-(width()/2), (dt->height()/2)-(height()/2)); }
int main(int argc, char** argv) { PhackmanGame tsr(Constants::WindowWidth, Constants::WindowHeight); tsr.exec(argc, argv); return 0; }