Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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;
}
Ejemplo n.º 4
0
void Context::saveOffset(string variable_name, int offset) {
	VarInfo *var_info = getVarInfo(variable_name);
	if (var_info != NULL)
		var_info->offset_base = offset;
}