//----------------------------------------------------------------------------- // Parse command line... //----------------------------------------------------------------------------- void CCommandLine::ParseCommandLine() { CleanUpParms(); if (!m_pszCmdLine) return; const char *pChar = m_pszCmdLine; while ( *pChar && isspace(*pChar) ) { ++pChar; } bool bInQuotes = false; const char *pFirstLetter = NULL; for ( ; *pChar; ++pChar ) { if ( bInQuotes ) { if ( *pChar != '\"' ) continue; AddArgument( pFirstLetter, pChar ); pFirstLetter = NULL; bInQuotes = false; continue; } // Haven't started a word yet... if ( !pFirstLetter ) { if ( *pChar == '\"' ) { bInQuotes = true; pFirstLetter = pChar + 1; continue; } if ( isspace( *pChar ) ) continue; pFirstLetter = pChar; continue; } // Here, we're in the middle of a word. Look for the end of it. if ( isspace( *pChar ) ) { AddArgument( pFirstLetter, pChar ); pFirstLetter = NULL; } } if ( pFirstLetter ) { AddArgument( pFirstLetter, pChar ); } }
void Modules::Ping::Init(storm::MessageData* msg) { for(int i = 0; i < msg->commandarguments_size(); i++) { AddArgument(msg->commandarguments(i)); //add all arguments given and give it to the module } }
void Modules::Exec::Init(storm::MessageData* msg) { AddArgument(msg->commandarguments(0)); if(msg->stormarguments_size() > 0) { Silent = false; } }
void JXExprEditor::HandleMathMenu ( const JIndex item ) { if (item > kMathMenuItemCount) { return; } const JExprEditor::CmdIndex cmd = kMathMenuItemToCmd[ item-1 ]; if (cmd == kEvaluateSelCmd) { if (EndEditing()) { EvaluateSelection(); } } else if (cmd == kPrintEPSCmd) { itsEPSPrinter->BeginUserPrintSetup(); } else if (cmd == kNegateSelCmd) { NegateSelection(); } else if (cmd == kAddArgCmd) { AddArgument(); } else if (cmd == kMoveArgLeftCmd) { MoveArgument(-1); } else if (cmd == kMoveArgRightCmd) { MoveArgument(+1); } else if (cmd == kGroupLeftCmd) { GroupArguments(-1); } else if (cmd == kGroupRightCmd) { GroupArguments(+1); } else if (cmd == kUngroupCmd) { UngroupArguments(); } }
/* ParseDef - parse the 'DEF' statement */ static void ParseDef(ParseContext *c) { char name[MAXTOKEN]; Token tkn; /* get the name being defined */ FRequire(c, T_IDENTIFIER); strcpy(name, c->token); /* check for a constant definition */ if ((tkn = GetToken(c)) == '=') ParseConstantDef(c, name); /* otherwise, assume a function definition */ else { Symbol *sym; /* save the lookahead token */ SaveToken(c, tkn); /* enter the function name in the global symbol table */ sym = AddGlobal(c, name, SC_CONSTANT, 0, 0); /* start the code under construction */ StartCode(c, sym->name, CODE_TYPE_FUNCTION); sym->value = c->code; /* get the argument list */ if ((tkn = GetToken(c)) == '(') { if ((tkn = GetToken(c)) != ')') { int offset = 1; SaveToken(c, tkn); do { FRequire(c, T_IDENTIFIER); AddArgument(c, c->token, SC_VARIABLE, offset); ++offset; } while ((tkn = GetToken(c)) == ','); } Require(c, tkn, ')'); } else SaveToken(c, tkn); } FRequire(c, T_EOL); }
Job::Job(const Job& other) : BaseJob(other.Name()), fEnabled(other.IsEnabled()), fService(other.IsService()), fCreateDefaultPort(other.CreateDefaultPort()), fLaunching(other.IsLaunching()), fInitStatus(B_NO_INIT), fTeam(-1), fDefaultPort(-1), fToken((uint32)B_PREFERRED_TOKEN), fLaunchStatus(B_NO_INIT), fTarget(other.Target()), fPendingLaunchDataReplies(0, false) { mutex_init(&fLaunchStatusLock, "launch status lock"); fCondition = other.fCondition; // TODO: copy events //fEvent = other.fEvent; fEnvironment = other.fEnvironment; fSourceFiles = other.fSourceFiles; for (int32 i = 0; i < other.Arguments().CountStrings(); i++) AddArgument(other.Arguments().StringAt(i)); for (int32 i = 0; i < other.Requirements().CountStrings(); i++) AddRequirement(other.Requirements().StringAt(i)); PortMap::const_iterator constIterator = other.Ports().begin(); for (; constIterator != other.Ports().end(); constIterator++) { fPortMap.insert( std::make_pair(constIterator->first, constIterator->second)); } PortMap::iterator iterator = fPortMap.begin(); for (; iterator != fPortMap.end(); iterator++) iterator->second.RemoveData("port"); }
Create::Create() : Command() { AddArgument("name", "the name of the room to create")->token = true; AddArgument("pin", "the pin code to enter the room", true); }
Join::Join(Hall *hall, Client *client) : Command(), hall_(hall), client_(client) { AddArgument("name", "the name of the room to join"); }
void ComponentInterface::AddArgument(const char *pzName, int nValue) { GString strConvert; strConvert.Format("%d",(int)nValue); AddArgument(pzName, (const char *)strConvert); }
void Pywrap::AddArgument(void_ptr argument) { AddArgument(CreateObjFromPtr(argument)); }