int MgCmdManagerImpl::getSelectionForChange(MgView* view, int count, MgShape** shapes) { if (_cmdname == MgCmdSelect::Name() && view) { MgCmdSelect* sel = (MgCmdSelect*)getCommand(); return sel ? sel->getSelectionForChange(view, count, shapes) : 0; } return 0; }
void HiRes5Engine::applyRoomWorkarounds(byte roomNr) { // WORKAROUND: Remove/fix buggy commands if (_state.region == 17 && roomNr == 49) { // "GET WATER" references a missing message when you already // have water. This message should be 117 instead of 17. getCommand(_roomData.commands, 8).script[4] = 117; } }
Client::Client(QObject *parent) : QObject(parent) { if (!this->connect(&socket, SIGNAL(connected()), this, SLOT(getState()))) { qDebug() << "Could not start client"; } else { qDebug() << "Client started"; } connect(&socket, SIGNAL(readyRead()), this, SLOT(getCommand())); }
Expected<ParsedCommand> OptionParser::parseCommand(int argc, const char * const *argv) { Expected<void> result = parseOptions(argc, argv); if (!result.isOk()) return result; return getCommand(); }
void Console::handleReturn() { QString command=getCommand(); moveCursor(QTextCursor::End,QTextCursor::MoveAnchor); insertPlainText("\n"); emit execCommand(command); displayPrompt(); }
Client::Client() { connect(this,SIGNAL(readyRead()),this,SLOT(readMessage())); connect(logic,SIGNAL(gameStart()),this,SIGNAL(readyToStart())); connect(logic,SIGNAL(sendCommand(QString)),this,SLOT(sendMessage(QString))); connect(this,SIGNAL(getMessage(QString)),logic,SLOT(getCommand(QString))); logic->setClient(this); }
UInt32 MgCmdManagerImpl::getSelection(MgView* view, UInt32 count, MgShape** shapes, bool forChange) { if (_cmdname == MgCommandSelect::Name()) { MgCommandSelect* sel = (MgCommandSelect*)getCommand(); return sel->getSelection(view, count, shapes, forChange); } return 0; }
void kTerm() { while(!exit){ print("\r\n>> "); memset((unsigned char*)command,0,CMD_LENGTH); getCommand(command); run(command); } }
int parseCommand(char line[], int flags, int *index, int *num, int len) { int cmd = getCommand(line, flags, index, num, len); if (0 < cmd && 0 > *num) *num = 0; return toupper(cmd) | flags; }
//----------------------------- // Name : prompt() //----------------------------- char * PoetryGen::prompt() { printf("\npoetry_gen> "); fgets( m_buffer, sizeof(m_buffer), stdin); return getCommand( m_buffer ); return NULL; }
int main ( int argc, char *argv[] ) { Param params; FlowCom *comPtr = NULL; char line [ LINE_LEN ]; while ( argc > 1 ) { if ( !strcmp( argv[1], "-D" ) ) { setDebugFlag(); } else if ( !strcmp( argv[1], "-V" ) ) { printf ( "%s\n", VERSION ); exit ( 0 ); } else { break; } argv++; argc--; } open_tempfile(); open_infile ( ( argc > 1 ) ? argv[ 1 ] : NULL ); tprintf ( "%% picture environment flowchart generated by flow " ); tprintf ( "%s\n", VERSION ); while ( readline_infile ( line, LINE_LEN ) != NULL ) { if ( ( comPtr = getCommand ( line, params ) ) != NULL ) { switch ( comPtr -> command ) { case MACRO: if ( doMacro ( params ) ) { errout ( E_NO_END_MACRO ); } break; case EXPAND: doExpand ( params ); break; default: if ( !doCommand ( comPtr, params ) ) { return 10; } } } else { break; } } close_infile(); close_tempfile(); apply_tempfile ( getPic(), ( argc > 2 ) ? argv[ 2 ] : NULL ); remove_tempfile(); // dumpFigure(); return 0; /* just to suppress the warning */ }
uint8_t getVendorCode(void){ //#if defined(DYIO) if(avrID[0]!=0x1E) avrID[0]= getCommand(readVendorCode); return avrID[0]; //#else // return 0x1E; //#endif }
int ApduDetails::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 25) qt_static_metacall(this, _c, _id, _a); _id -= 25; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = getAid(); break; case 1: *reinterpret_cast< bool*>(_v) = getSelectOnly(); break; case 2: *reinterpret_cast< bool*>(_v) = getPpse(); break; case 3: *reinterpret_cast< int*>(_v) = getTargetInx(); break; case 4: *reinterpret_cast< QString*>(_v) = getCla(); break; case 5: *reinterpret_cast< QString*>(_v) = getIns(); break; case 6: *reinterpret_cast< QString*>(_v) = getP1p2(); break; case 7: *reinterpret_cast< QString*>(_v) = getLc(); break; case 8: *reinterpret_cast< QString*>(_v) = getCommand(); break; case 9: *reinterpret_cast< QString*>(_v) = getLe(); break; } _id -= 10; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setAid(*reinterpret_cast< QString*>(_v)); break; case 1: setSelectOnly(*reinterpret_cast< bool*>(_v)); break; case 2: setPpse(*reinterpret_cast< bool*>(_v)); break; case 3: setTargetInx(*reinterpret_cast< int*>(_v)); break; case 4: setCla(*reinterpret_cast< QString*>(_v)); break; case 5: setIns(*reinterpret_cast< QString*>(_v)); break; case 6: setP1p2(*reinterpret_cast< QString*>(_v)); break; case 7: setLc(*reinterpret_cast< QString*>(_v)); break; case 8: setCommand(*reinterpret_cast< QString*>(_v)); break; case 9: setLe(*reinterpret_cast< QString*>(_v)); break; } _id -= 10; } else if (_c == QMetaObject::ResetProperty) { _id -= 10; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 10; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 10; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 10; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 10; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 10; } #endif // QT_NO_PROPERTIES return _id; }
std::vector<CatheterChannelCmd> CatheterCmdGrid::getCommands() { std::vector<CatheterChannelCmd> cmdVect; for (int i = 0; i < cmd_count; i++) { if (isRowComplete(i)) { cmdVect.push_back(getCommand(i)); } } return cmdVect; }
void interrupt() { char iname[80]; strcpy(iname, getCommand("Interrupt: -- enter priority (1-5): ")); cout << endl; int i = atoi(iname) - 1; INT::rupt[i] = 1; }
bool XAGYLWheel::getFirmwareInfo() { char resp[XAGYL_MAXBUF]; bool rc1 = getCommand(INFO_PRODUCT_NAME, resp); if (rc1) IUSaveText(&FirmwareInfoT[0], resp); bool rc2 = getCommand(INFO_FIRMWARE_VERSION, resp); if (rc2) IUSaveText(&FirmwareInfoT[1], resp); bool rc3 = getCommand(INFO_SERIAL_NUMBER, resp); if (rc3) IUSaveText(&FirmwareInfoT[2], resp); return (rc1 && rc2 && rc3); }
void decrCntr() { char cntrname[80]; strcpy(cntrname, getCommand("Decrement counter: -- enter pcell (0-19): ")); cout << endl; int pc = atoi(cntrname); CTR::pcDn[pc] = 1; }
bool MgCmdManagerImpl::dynamicChangeEnded(MgView* view, bool apply) { bool changed = false; if (_cmdname == MgCmdSelect::Name() && view) { MgCmdSelect* sel = (MgCmdSelect*)getCommand(); changed = sel && sel->dynamicChangeEnded(view, apply); } return changed; }
void readCommand(){ char* input = nextLine(); int command = getCommand(input); print("\n"); print("---Your command was #"); printint(command); println("---"); //char* param = getParam(input); }
void Command::runCommand(std::string command) { CommandBase* cmd = getCommand(command); if (cmd) { cmd->run(); cmd->fireEvent(); } }
void GetAVRid(BYTE * buffer){ //printfDEBUG("AVR getting ID"); //InitUINT32Fifo(&storeAddr,privateAddr,sizeof(privateAddr)); programMode(); avrID[0]= getCommand(readVendorCode); buffer[0]=GetHighNib(avrID[0]); buffer[1]=GetLowNib(avrID[0]); avrID[1] = getCommand(readPartFamilyandFlashSize); avrFlashSize=avrID[1]; buffer[2]=GetHighNib(avrID[1]); buffer[3]=GetLowNib(avrID[1]); avrID[2] = getCommand(readPartNumber); buffer[4]=GetHighNib(avrID[2]); buffer[5]=GetLowNib(avrID[2]); buffer[6]=0; }
BYTE getVendorCode(void){ #if defined(DYIO) if(avrID[0]!=0x1E) avrID[0]= getCommand(readVendorCode); return avrID[0]; #else return 0x1E; #endif }
void showAbout(void) { printf("\n民生银行联名卡接驳系统 v0.1\n"); printf("华润置地(成都)大区 信息管理部\nCopyRight 2016 Chengdu\n"); printf("Auth Email:[email protected]\n"); printf("Contact Address:四川省成都市锦江区华润路158号翡翠城四期六栋\n"); printf("\n安装注意事项:\n 1.需安装lftp软件,且使用sftp登陆至少一次服务器,以加入信任。\n 2.需在导入gpg秘钥后,使用gpg --edit-keys,设置秘钥为信任,否则自动执行无法完成。\n 3.计划任务请使用 -s 参数,执行自动过程。\n"); getCommand(WAIT); }
void Transport::debuggerInfo(InfoVec &info) { Add(info, "Thread Type", getThreadTypeName()); Add(info, "URL", getCommand()); Add(info, "HTTP", getHTTPVersion()); Add(info, "Method", getMethodName()); if (getMethod() == Method::POST) { int size; getPostData(size); Add(info, "Post Data", FormatSize(size)); } }
void wait_till_ready(int sck) { int val1 = 0; while (1) { getCommand(sck, sckfd, READY, 1, &val1, NULL); if (val1 == 1) { break; } } }
void Menu::start() { showHelp(); while(true) { string cmd = getCommand(); parseCommand(cmd); } }
int main (int argc, char **argv) { srand(time(0)); MAP map; setDefaults(&map); PLAYER hero; startPlayer(&hero); getargs(&map, &hero, argc, argv); startMap(&map); hero.face = map.elements.hero.face; hero.pos = putElement(&map, hero.face); GHOSTS ghosts; ghosts.face = GHOST; ghosts.count = 0; startGhosts(&map, &ghosts); fflush(stdout); initscr(); nodelay(stdscr, TRUE); noecho(); keypad(stdscr, TRUE); if (map.props.hascolor) startColors(); struct timespec tim, tim2; tim.tv_sec = 0; tim.tv_nsec = map.props.speed; do { nanosleep(&tim, &tim2); getCommand(&hero); walk(&map, &hero, &ghosts); showMap(&map, &hero, &ghosts); repopMap(&map); upGhosts(&map, &ghosts); walkGhosts(&map, &ghosts); } while (!isDead(&hero)); if (!noRecords) writeRecords(&hero, &ghosts); finalize(&map, &ghosts); finalText(&map, &hero, &ghosts); exit(0); }
void shell(void) { kprintf("\rDAMOCLES v2.0\n\n"); populateCommands(myCommands); while(1) executeCommand(getCommand(myCommands)); }
/* Gets couples of characters interleaved by a space (ENGINE_NUM + ENGINE_DEG) * All these couples must be surrounded by 2 sync characters (CHAR_SFRAME and * CHAR_SFRAME_END) * ENGINE_NUM is valid if in [CHAR_ENGINE_FIRST, CHAR_ENGINE_LAST] * ENGINE_DEG is valid if in [DEG_NEG90, DEG_POS90] * * If it's all right a sync character (CHAR_CREADY) is sent to RBR to go on * with next burst and 1 is returned. * * On error CHAR_CLOOP is sent to RBR and 0 is return. */ int getBuffer() { int state=0, f=0, engine=0, engine_n=0, empty=1; char tmp=0x0; /* gets each couple between CHAR_SFRAME */ while (f<BUF_LEN && state<2) { tmp = getCommand(); if (tmp==CHAR_SFRAME) { /* clean commands buffer */ while (f<18) commands[f++] = -1; f=0; state=1; } else if (tmp==CHAR_SFRAME_END) { state=2; } else if (tmp == CHAR_SEND) { putc(CHAR_MEND); spidy_reset(); } else if (state==1) { if (tmp != 0) { if (DEBUG_LEVEL > 0) putc(CHAR_CBUF); if (tmp>=CHAR_ENGINE_FIRST && tmp<=CHAR_ENGINE_LAST) { engine = 1; engine_n = tmp - CHAR_ENGINE_FIRST; } else if (engine && tmp >= DEG_NEG90 && tmp <= DEG_POS90) { engine = 0; commands[engine_n] = tmp; empty=0; } f++; } /* send received only outside CHAR_SFRAME */ } else { if (DEBUG_LEVEL > 2) putc(CHAR_CLOOP); return 0; } } /* there must be at least one complete couple between CHAR_SFRAME */ if (state==2 && !empty) { if (DEBUG_LEVEL > 1) putc(CHAR_CREAD); return 1; } else { /* otherwise another error */ if (DEBUG_LEVEL > 2) putc(CHAR_CLOOP); return 0; } }
int do_main(){ int c = 1; initc(); vd_puts("Type help for help\n"); while(c){ getCommand(); c = parseCommand(); c = executeCommand(c); } return 0; }