int getVarFunc(HSQUIRRELVM v) { StackHandler sa(v); if (sa.GetType(1) == OT_TABLE) { VarRefPtr vr; int res = getVarInfo(sa,vr); if (res != SQ_OK) return res; return getVar(sa,vr,vr->offsetOrAddrOrConst); } // if return SQ_ERROR; } // getVarFunc
int getVarFunc(HSQUIRRELVM v) { SquirrelVM::Init(v); // For handling multi-VM setting right StackHandler sa(v); if (sa.GetType(1) == OT_TABLE) { VarRefPtr vr; int res = getVarInfo(sa,vr); if (res != SQ_OK) return res; return getVar(sa,vr,vr->offsetOrAddrOrConst); } // if return SQ_ERROR; } // getVarFunc
int Context::getOffset(string variable_name) { cout << "printing map" << endl; map<string, VarInfo*>::iterator it = variables.begin(); while (it != variables.end()) { cout << "var " << it->first << endl; it++; } cout << "end printing" << endl; VarInfo *var_info = getVarInfo(variable_name); if (var_info != NULL) return var_info->offset_base; return -1; }
void Context::saveOffset(string variable_name, int offset) { VarInfo *var_info = getVarInfo(variable_name); if (var_info != NULL) var_info->offset_base = offset; }