int main_menu() { MENU_T menu; int opt=0; int selItem = 0; int acceptKbdEvents=0; //lk_getkey(); //Commented by Neeraja 08/06/2010 for 2 times pressed after entered password field. lk_dispclr(); fprintf(fp,"Begun main_menu()"); fflush(fp); menu.start = 0; menu.maxEntries = 4; strcpy(menu.title,"Main Menu"); strcpy(menu.menu[0],"Retail Sale"); strcpy(menu.menu[1],"Reprint"); strcpy(menu.menu[3],"Logout"); while(1) { sprintf(menu.menu[2],"Update Pending (%d)",getPending()); lk_dispclr(); opt = scroll_menu(&menu,&selItem,acceptKbdEvents); switch(opt) { case ENTER: switch (selItem+1) { case 1: retail_sale(); break; //retail.c case 2: reprint(); break; case 3: updatePendingBatch(); break; case 4: logout(); return SUCCESS; break; default: break; } } } }
static void lecture() { int i, j; int question = 0; char format[SIZE_FORMAT]; struct basicVal val; struct basicVal *pVal = &val; scanf("%d", &verbose); reprint(question++); scanf("%d", &val.nbJ); if (val.nbJ < 0) erreur_nbJ(val.nbJ); reprint(question++); scanf("%d", &val.nbS); if (val.nbS < 0) erreur_nbS(val.nbS); if ((val.nbS > 0 && val.nbJ % val.nbS != 0) || (val.nbJ == 0 && val.nbS > 1)) erreur_nbJ_nbS(val.nbJ, val.nbS); reprint(question++); scanf("%d", &val.zoom); if (val.zoom < ZOOM_MIN || val.zoom > ZOOM_MAX) erreur_zoom(val.zoom); reprint(question++); scanf("%s", format); reprint(question++); scanf("%d", &val.colonne); scanf("%d", &val.ligne); reprint(question++); int tabInit[val.ligne][val.colonne]; int tabSuiv[val.ligne][val.colonne]; int *pTabInit = (int*)tabInit; int *pTabSuiv = (int*)tabSuiv; for (i = 0; i < val.ligne; i++) for (j = 0; j < val.colonne; j++) scanf("%d", &tabInit[i][j]); if (val.nbS != 0) { header(pVal); output(pTabInit, pVal, 0); } start(pTabInit, pTabSuiv, pVal); }
/*------------------------------------------------------------------------ * ttyiin - handle interrupt-level input for a tty *------------------------------------------------------------------------ */ void ttyiin(struct devsw *pdev, unsigned char ch) { struct tty *ptty = (struct tty *)pdev->dvioblk; struct tchars *ptc; static unsigned char lastc; if (ch == '\n' && lastc == '\r') return; lastc = ch; if (ptty->tty_iflags & TIF_RAW) { iputchar(ptty, ch); if (scount(ptty->tty_isema) <= 0) signal(ptty->tty_isema); return; } if (ch == '\r') ch = '\n'; ptc = &ptty->tty_tchars; if (ch == ptc->tc_erase) { delchar(ptty); return; } else if (ch == ptc->tc_werase) { delword(ptty); return; } else if (ch == ptc->tc_reprint) { reprint(ptty); return; } else if (ch == ptc->tc_intr) { send(ptty->tty_cpid, INTRMSG); return; } else if (ch == ptc->tc_eof) { ptty->tty_iflags |= TIF_EOF; } else if (ch == ptc->tc_status) { x_ps(CONSOLE, CONSOLE, CONSOLE, 0); } iputchar(ptty, ch); if ((ptty->tty_iflags & (TIF_CBREAK|TIF_RAW)) || ch == ptty->tty_tchars.tc_eol || ch == ptty->tty_tchars.tc_eof) if (scount(ptty->tty_isema) <= 0) signal(ptty->tty_isema); }