logical pc_TopicFromOldStyle :: Setup_SDB_Structure ( ) { PropertyHandle ref_dsc_class(GetDBHandle(),"ODS_Class",PI_Read); logical term = NO; BEGINSEQ if ( !ref_dsc_class.Get(ExtractKey()) ) LEAVESEQ Setup_SDB_Resource(&ref_dsc_class); pc_TopicFromOldStyle smcebase(GPH("smcebase")); smcebase.Setup_collection(ref_dsc_class.GPH("bas_descriptions")); pc_TopicFromOldStyle smcepdde(GPH("smcepdde")); smcepdde.Setup_collection(ref_dsc_class.GPH("atr_descriptions")); pc_TopicFromOldStyle smcepref(GPH("smcepref")); smcepref.Setup_collection(ref_dsc_class.GPH("ref_descriptions")); pc_TopicFromOldStyle smcershp(GPH("smcershp")); smcershp.Setup_collection(ref_dsc_class.GPH("rsp_descriptions")); pc_TopicFromOldStyle smcepsmc(GPH("smcepsmc")); smcepsmc.Setup_collection(ref_dsc_class.GPH("sor_descriptions")); ENDSEQ return(term); }
OniSensorInfo getSensorInfo() { VideoModeMap supported_modes = getSupportedVideoModes(); OniVideoMode* modes = new OniVideoMode[supported_modes.size()]; std::transform(supported_modes.begin(), supported_modes.end(), modes, ExtractKey()); OniSensorInfo sensors = { getSensorType(), static_cast<int>(supported_modes.size()), modes }; return sensors; }
logical pc_TopicFromOldStyle :: Setup_collection (PropertyHandle *prophdl ) { int32 indx0 = 0; logical term = NO; while ( Get(indx0++) ) if ( prophdl->Get(ExtractKey()) ) Setup_SDB_Resource(prophdl); return(term); }
static int win_ExtractKeyEx(lua_State *L) { INPUT_RECORD rec; if (ExtractKey(&rec)) { PushInputRecord(L, &rec); return 1; } lua_pushnil(L); return 1; }
// result = ExtractKey() // -- general purpose function; not FAR dependent static int win_ExtractKey(lua_State *L) { INPUT_RECORD rec; if (ExtractKey(&rec) && rec.Event.KeyEvent.bKeyDown) { WORD vKey = rec.Event.KeyEvent.wVirtualKeyCode & 0xff; if(vKey && VirtualKeyStrings[vKey]) { lua_pushstring(L, VirtualKeyStrings[vKey]); return 1; } } lua_pushnil(L); return 1; }
logical pcBase :: RemoveFromSpecialExtent (char *extnames ) { char *cur_extent = GetExtentName(); logical term = NO; BEGINSEQ if ( !cur_extent || !extnames ) LEAVESEQ if ( !Exist() ) ERROR if ( strcmp(cur_extent,extnames) ) { PropertyHandle extent(GetDBHandle(),extnames,PI_Write); SDBCERR if ( extent.Get(ExtractKey()) ) extent.Delete(); } else
logical pc_TopicFromOldStyle :: Setup_ODC_ImpClass ( ) { PropertyHandle ref_dsc_class(GetDBHandle(),"ODS_Class",PI_Read); PropertyHandle *fct_descriptions = ref_dsc_class.GPH("fct_descriptions"); int32 indx0 = 0; logical term = NO; BEGINSEQ if ( !ref_dsc_class.Get(ExtractKey()) ) LEAVESEQ if ( Setup_SDB_Structure() ) ERROR pc_TopicFromOldStyle pfunctions(GPH("pfunctions")); while ( pfunctions.Get(indx0++) ) if ( fct_descriptions->Get(pfunctions.ExtractKey()) ) pfunctions.Setup_ODC_PFunction(fct_descriptions); RECOVER term = YES; ENDSEQ return(term); }
logical pc_TopicFromOldStyle :: Setup_SDB_ValueList ( ) { PropertyHandle ref_dsc_class(GetDBHandle(),"ODS_Class",PI_Read); PropertyHandle sys_ident(GPH("sys_ident")); PropertyHandle V8("V8"); PropertyHandle sv; int32 indx0 = 0; logical term = NO; BEGINSEQ if ( !ref_dsc_class.Get(ExtractKey()) ) LEAVESEQ DBObjectHandle dbh(GetDBHandle()); PropertyHandle vl(dbh,"SDB_ValueList",PI_Write); sv = sys_ident + V8; if ( !vl.Provide(sv) ) ERROR pc_TopicFromOldStyle vlist(&vl); Setup_SDB_Resource(&ref_dsc_class); PH(&vl,values) pc_TopicFromOldStyle pc_values(&values); PH(&ref_dsc_class,val_descriptions); if ( !dict.IsValid() ) dict.Open(GetDBHandle()); PropertyHandle cs(dict,sys_ident.GetString(),PI_Read); while ( cs.Get(indx0++) ) { values.Add(*cs.GPH("string")); *values.GPH("__AUTOIDENT") = cs.GPH("value"); *values.GPH("type") = cs.GPH("type"); if ( val_descriptions.Get(*values.GPH("sys_ident")) ) pc_values.Setup_SDB_Resource(&val_descriptions); } RECOVER term = YES; ENDSEQ return(term); }
logical pcBase :: ProvideInSpecialExtent (char *extnames ) { char *cur_extent = GetExtentName(); logical term = NO; BEGINSEQ if ( !cur_extent || !extnames ) LEAVESEQ if ( !Exist() ) ERROR if ( strcmp(cur_extent,extnames) ) { PropertyHandle extent(GetDBHandle(),extnames,PI_Write); SDBCERR // waere besser, aber der vertraegt weak-typed nicht // extent.Provide(ExtractKey()); SDBCERR if ( !extent.Get(ExtractKey()) ) extent.AddReference(*this); SDBCERR } RECOVER term = YES; ENDSEQ return(term); }