vector<ip_info> LocalIpAddress::getAddresses() { string LOCAL_IP; vector<ip_info> ips; FILE * fp = popen("ifconfig", "r"); if (fp) { char *p=NULL; size_t n; while ((getline(&p, &n, fp) > 0) && p) { string line = string(p); string ip_address = getIpDataFromLine(line,"inet addr:"); if(isInternal(ip_address)) { string broadcast_address = getIpDataFromLine(line,"Bcast:"); ip_info ip; ip.ip_address = ip_address; ip.broadcast_address = broadcast_address; ips.push_back(ip); } } } pclose(fp); return ips; }
void visitInvokeInst(InvokeInst &I) { Function* target = I.getCalledFunction(); if (target == NULL) { anyUnknown = true; return; } if (isInternal(target)) { if (used != NULL) used->push(target); } else { interface->call(target->getName(), arg_begin(I), arg_end(I)); } this->visitInstruction(I); }
QVariantMap CoreAccount::toVariantMap(bool forcePassword) const { QVariantMap v; v["AccountId"] = accountId().toInt(); // can't use AccountId because then comparison fails v["AccountName"] = accountName(); v["Uuid"] = uuid().toString(); v["Internal"] = isInternal(); v["User"] = user(); if (_storePassword || forcePassword) v["Password"] = password(); else v["Password"] = QString(); v["StorePassword"] = storePassword(); v["HostName"] = hostName(); v["Port"] = port(); v["UseSSL"] = useSsl(); v["ProxyType"] = proxyType(); v["ProxyUser"] = proxyUser(); v["ProxyPassword"] = proxyPassword(); v["ProxyHostName"] = proxyHostName(); v["ProxyPort"] = proxyPort(); return v; }
// Executes a command, as a child process int child (char command []) { int count=0; // Execute internal commands if (isInternal(command)) { internal (command); exit (0); } element = strtok (command, sep); while (element != NULL) { com[count] = element; count++; com[count] = NULL; element = strtok (NULL, sep); } // Execute command execvp (com[0], com); perror("Command was not found"); return EXIT_FAILURE; }
/** * * @brief test whether the given internal transition is in this collection of * transitions * * @param - from: the state the edge departs from * @param - sym: the symbol labeling the edge * @param - to: the state the edge arrives to * @return true if the given internal transition is in this collection of * transitions associated with the NWA * */ bool TransitionStorage::isInternal( State from, Symbol sym, State to ) const { Internal it(from,sym,to); return isInternal(it); }
bool AlnusPhyolgeticBranch::isExternal() const { return !isInternal(); }