static Boolean compNodeSetNodeSet(binaryExpr *be, expr* left, expr* right, VTDNav *vn, opType op){ exception e; int i,i1,k,s1,stackSize; Try { if (be->fib1 == NULL) be->fib1 = createFastIntBuffer2(BUF_SZ_EXP); push2(vn); stackSize = vn->contextBuf2->size; while ((i = be->left->evalNodeSet(be->left,vn)) != -1) { i1 = getStringVal(vn,i); if (i1 != -1) appendInt(be->fib1,i1); } be->left->reset(be->left,vn); vn->contextBuf2->size = stackSize; pop2(vn); push2(vn); stackSize = vn->contextBuf2->size; while ((i = be->right->evalNodeSet(be->right,vn)) != -1) { i1 = getStringVal(vn,i); if (i1 != -1){ s1 = be->fib1->size; for (k = 0; k < s1; k++) { Boolean b = compareVV(be,intAt(be->fib1,k),vn,i1,op); if (b){ clearFastIntBuffer(be->fib1); vn->contextBuf2->size = stackSize; pop2(vn); be->right->reset(be->right,vn); return TRUE; } } } } vn->contextBuf2->size = stackSize; pop2(vn); be->right->reset(be->right,vn); clearFastIntBuffer(be->fib1); return FALSE; } Catch (e) { if (e.et == out_of_mem){ Throw e; } if(be->fib1!=NULL) clearFastIntBuffer(be->fib1); e.et = other_exception; e.msg = "undefined run time behavior in computerEQNE"; Throw e; } return FALSE; }
static Boolean compNodeSetString(binaryExpr *be, expr* left, expr* right, VTDNav *vn, opType op){ exception e; int i,i1 = 0,stackSize; UCSChar *s=NULL; Boolean b; Try { s = be->right->evalString(be->right,vn); push2(vn); stackSize = vn->contextBuf2->size; while ((i = be->left->evalNodeSet(be->left,vn)) != -1) { i1 = getStringVal(vn,i); if (i1 != -1){ b = compareVString2(be,i1,vn,s,op); if (b==TRUE){ be->left->reset(be->left,vn); vn->contextBuf2->size = stackSize; pop2(vn); free(s); return b; } } } vn->contextBuf2->size = stackSize; pop2(vn); be->left->reset(be->left,vn); b = compEmptyNodeSet(op, s); free(s); return b; } Catch ( e) { e.et = other_exception; e.msg = "undefined run time behavior in computerEQNE"; Throw e; } return FALSE; }
static Boolean compNumericalNodeSet(binaryExpr *be, expr* left, expr* right, VTDNav *vn, opType op){ exception e; int i,i1,stackSize; double d; Try { d = be->left->evalNumber(be->left,vn); push2(vn); stackSize = vn->contextBuf2->size; while ((i = be->right->evalNodeSet(be->right,vn)) != -1) { i1 = getStringVal(vn,i); if (i1!=-1 && compareVNumber1(be,i1,vn,d,op)){ be->right->reset(be->right,vn); vn->contextBuf2->size = stackSize; pop2(vn); return TRUE; } } vn->contextBuf2->size = stackSize; pop2(vn); be->right->reset(be->right,vn); return FALSE; } Catch (e) { e.et = other_exception; e.msg = "Undefined behavior in evalBoolean_be"; Throw e; } return FALSE; }
bool ResourceManager::getMysqldInfo( std::string& h, std::string& u, std::string& w, unsigned int& p) const { h = getStringVal("CrossEngineSupport", "Host", "unassigned"); p = getUintVal("CrossEngineSupport", "Port", 0); u = getStringVal("CrossEngineSupport", "User", "unassigned"); w = getStringVal("CrossEngineSupport", "Password", ""); bool rc = true; if ((h.compare("unassigned") == 0) || (u.compare("unassigned") == 0) || (p == 0)) rc = false; return rc; }
bool ResourceManager::userPriorityEnabled() const { std::string val(getStringVal("UserPriority", "Enabled", "N" )); boost::to_upper(val); return "Y" == val; }
bool ResourceManager::queryStatsEnabled() const { std::string val(getStringVal("QueryStats", "Enabled", "N" )); boost::to_upper(val); return "Y" == val; }
void parseNode(lua_State* L, plist_t node, int depth) { char* name, *id, *bundleId; plist_t kids; int numChildren; int i; if (node == NULL) { return; } switch (nodeType(node)) { case PLIST_DICT: lua_newtable(L); addToTable(L, kIconUserDataType); id = getStringVal(node, kAppleDisplayIDKey); name = getStringVal(node, kAppleDisplayNameKey); bundleId = getStringVal(node, kAppleBundleIdKey); kids = dictEntry(node, kAppleIconListKey); if (name == NULL && id == NULL) { lua_pushstring(L, "unexpected value reading icons!"); lua_error(L); } if (name != NULL) { SET_STRING(L, kIconName,name); } if (id != NULL) { SET_STRING(L, kIconId,id); } if (bundleId != NULL) { SET_STRING(L, kAppleBundleIdKey,id); } storeIconInRegistry(L, node, name, id); if (groupSize(kids) > 0) { lua_newtable(L); flatPackArray(L, kids, depth+1); lua_setfield(L, -2, kIconsKey); } break; case PLIST_ARRAY: lua_newtable(L); addToTable(L, depth == 0 ? kIconCollectionTypeKey : kPageTypeKey); numChildren = groupSize(node); for (i=0;i<numChildren;i++) { parseNode(L, arrayElem(node, i), depth+1); } default: break; case PLIST_BOOLEAN:break; case PLIST_UINT:break; case PLIST_REAL:break; case PLIST_STRING:break; case PLIST_DATE:break; case PLIST_DATA:break; case PLIST_KEY:break; case PLIST_UID:break; case PLIST_NONE:break; } // append to the end of our parent container lua_rawseti(L, -2, lua_rawlen(L, -2) + 1); }