extern int main(int argc, char **argv) { FILE_LIST *fl; char *command; SetDefault(); fl = GetOption(option, argc, argv, NULL); InitMessage("wfccontrol", NULL); if ((fl != NULL) && (fl->name != NULL)) { command = fl->name; } else { command = "stop"; } InitSystem(); MainProc(command); CleanUp(); return (0); }
MapElementFactory::MapElementFactory() { Bind( AutoId( "default" ), &CreateMapElement<DefaultMapElement> ); SetDefault( AutoId( "default" ) ); Bind( AutoId( "link" ), &CreateMapElement<LinkMapElement> ); Bind( AutoId( "map_start" ), &CreateMapElement<MapStartMapElement> ); Bind( AutoId( "spawn_soldiers" ), &CreateMapElement<SpawnSoldiersMapElement> ); Bind( AutoId( "soldier_spawn_point" ), &CreateMapElement<SoldierSpawnPointMapElement> ); Bind( AutoId( "spawn_actor" ), &CreateMapElement<SpawnActorMapElement> ); Bind( AutoId( "respawn_actor" ), &CreateMapElement<RespawnActorMapElement> ); Bind( AutoId( "ctf_soldier_spawn_point" ), &CreateMapElement<ctf::CtfSoldierSpawnPointMapElement> ); Bind( AutoId( "ctf_spawn_soldiers" ), &CreateMapElement<ctf::CtfSpawnSoldiersMapElement> ); Bind( AutoId( "ctf_flag_spawn_point" ), &CreateMapElement<ctf::CtfFlagSpawnPointMapElement> ); Bind( AutoId( "ctf_spawn_flags" ), &CreateMapElement<ctf::CtfSpawnFlagsMapElement> ); Bind( AutoId( "soldier_auto_revive" ), &CreateMapElement<SoldierAutoReviveMapElement> ); Bind( AutoId( "level_generator" ), &CreateMapElement<LevelGeneratorMapElement> ); Bind( AutoId( "level_generated" ), &CreateMapElement<LevelGeneratedMapElement> ); Bind( AutoId( "group" ), &CreateMapElement<GroupMapElement> ); Bind( AutoId( "recreate_borders" ), &CreateMapElement<RecreateBordersMapElement> ); }
void FeatureState::SetDefaultFromPref(const char* aPrefName, bool aIsEnablePref, bool aDefaultValue) { bool baseValue = Preferences::GetDefaultBool(aPrefName, aDefaultValue); SetDefault(baseValue == aIsEnablePref, FeatureStatus::Disabled, "Disabled by default"); if (Preferences::HasUserValue(aPrefName)) { bool userValue = Preferences::GetBool(aPrefName, aDefaultValue); if (userValue == aIsEnablePref) { nsCString message("Enabled via "); message.AppendASCII(aPrefName); UserEnable(message.get()); } else { nsCString message("Disabled via "); message.AppendASCII(aPrefName); UserDisable(message.get(), NS_LITERAL_CSTRING("FEATURE_FAILURE_PREF_OFF")); } } }
int AUDIOSOURCELIST::Append(AUDIOSOURCE* pNext) { info.audiosources = (AUDIOSOURCE**)realloc(info.audiosources,(info.iCount+1)*sizeof(AUDIOSOURCE*)); info.audiosources[info.iCount] = pNext; if (info.iCount) { pNext->SetBias(info.audiosources[info.iCount-1]->GetBias()+info.audiosources[info.iCount-1]->GetDuration()); } else { pNext->SetBias(0); char cBuffer[2048]; ZeroMemory(cBuffer,sizeof(cBuffer)); // pNext->GetName(cBuffer); // SetName(cBuffer); GetTitleSet()->Import(pNext->GetTitleSet()); ZeroMemory(cBuffer,sizeof(cBuffer)); std::string languageCode; pNext->GetLanguageCode(languageCode); SetLanguageCode(languageCode); SetTimecodeScale(1000); SetDefault(pNext->IsDefault()); } info.iCount++; if (info.iCount == 1) { info.active_source = info.audiosources[0]; } for (int i=0;i<info.iCount;i++) { if (!info.audiosources[i]->IsAVIOutputPossible()) { AllowAVIOutput(false); } } pNext->SetDelayMMS(this); pNext->ReInit(); return AS_OK; }
int main (int argc_, char* argv_[]) #endif { #ifdef __APPLE__ // OS X lacks a unique Right-Ctrl key, so enable the "Left-Alt for Cntrl" option by default SetDefault(altforcntrl,true); #endif if (Main::Init(argc_, argv_)) #ifdef RETRO ; #else CPU::Run(); #endif #ifdef RETRO return 0; #endif Main::Exit(); return 0; }
void XJCMD_QUERY_PROGRESSSC::Decode(const unsigned char *buffer,unsigned int& buffersize) throw (DecodeError) { const unsigned char *p; p = buffer; SetDefault(); if (1 > buffersize) throw DecodeError(); firsttime = *p; --buffersize; ++p; if (1 > buffersize) throw DecodeError(); levels_can_jump = *p; --buffersize; ++p; if (1 > buffersize) throw DecodeError(); play_times = *p; --buffersize; ++p; if (1 > buffersize) throw DecodeError(); max_play_times = *p; --buffersize; ++p; if (1 > buffersize) throw DecodeError(); have_progress = *p; --buffersize; ++p; if (have_progress == 1) { arraysize = buffersize; progress.Decode(p, arraysize); p += (buffersize-arraysize); buffersize = arraysize; } }
void XJCMD_LEVEL_STARTSC::Decode(const unsigned char *buffer,unsigned int& buffersize) throw (DecodeError) { const unsigned char *p; p = buffer; SetDefault(); if (2 > buffersize) throw DecodeError(); retcode = static_cast<SytECode>(CProto::n2h_16(p)); buffersize -= 2; p += 2; if (1 > buffersize) throw DecodeError(); jump_levels = *p; --buffersize; ++p; if (retcode == SYT_GOOD) { arraysize = buffersize; ev_seq.Decode(p, arraysize); p += (buffersize-arraysize); buffersize = arraysize; } if (jump_levels > 0 && (retcode == SYT_GOOD || retcode == SYT_ALL_LEVEL_FINISHED)) { arraysize = buffersize; jump_award_list.Decode(p, arraysize); p += (buffersize-arraysize); buffersize = arraysize; } if (retcode == SYT_GOOD) { if (1 > buffersize) throw DecodeError(); firsttime = *p; --buffersize; ++p; } }
SUBTITLESFROMMATROSKA::SUBTITLESFROMMATROSKA(MATROSKA* m, int iStream) { info.m = m; info.iStream = iStream; if (info.m->GetTrackType(info.iStream)!=MSTRT_SUBT) { ZeroMemory(&info,sizeof(info)); } else { info.m->SetActiveTrack(info.iStream); cCodecPrivate = (char*)info.m->GetCodecPrivate(info.iStream); iCP_length = info.m->GetCodecPrivateSize(info.iStream); if (!strcmp(info.m->GetCodecID(),"S_TEXT/UTF8")) { info.iFormat = SUBFORMAT_SRT; } else if (!strcmp(info.m->GetCodecID(),"S_SSA")) { info.iFormat = SUBFORMAT_SSA; } else if (!strcmp(info.m->GetCodecID(),"S_TEXT/SSA")) { info.iFormat = SUBFORMAT_SSA; } else if (!strcmp(info.m->GetCodecID(),"S_TEXT/ASS")) { info.iFormat = SUBFORMAT_SSA; } else if (!strcmp(info.m->GetCodecID(),"S_VOBSUB")) { info.iFormat = SUBFORMAT_VOBSUB; } if (GetFormat() == SUBFORMAT_SSA) { ReadSSAHeader(); ReadSSAStyles(); } SetTimecodeScale(info.m->GetTimecodeScale()); SetDefault(info.m->IsDefault(info.iStream)); GetTitleSet()->Import(info.m->GetTrackTitleSet()); } }
BOOL CAutoReg::CreateEntry( LPREGENTRY pReg, HKEY hKey, LPCTSTR pKey, DWORD dwType, LPCTSTR pName, void* pvoidData, DWORD dwLength, DWORD dwDef, void* pvoidDef, DWORD dwDefLength, DWORD dwUser, LPCTSTR pComputer ) {_STTEX(); // Sanity Checks if ( pReg == NULL ) return FALSE; if ( pKey == NULL ) return FALSE; // Blank out the structure ZeroMemory( (LPVOID)pReg, sizeof( REGENTRY ) ); // Save the users data // Key info pReg->hKey = hKey; strcpy( pReg->szKey, pKey ); pReg->dwType = dwType; // User variable info pReg->dwLength = dwLength; if ( pName == NULL || pName[ 0 ] == 0x0 ) pReg->szName[ 0 ] = 0x0; else strcpy( pReg->szName, pName ); pReg->pvoidData = pvoidData; // Set user default value info SetDefault( pReg, dwDef, pvoidDef, dwDefLength ); // User value pReg->dwUser = dwUser; // Remote computer info if ( pComputer != NULL && pComputer[ 0 ] != 0x0 ) strcpy( pReg->szComputer, pComputer ); else pReg->szComputer[ 0 ] = 0x0; return TRUE; }
//----------------------------------------------------------------------------- // Purpose: Private creation //----------------------------------------------------------------------------- void ConVar::Create( const char *pName, const char *pDefaultValue, int flags /*= 0*/, const char *pHelpString /*= NULL*/, bool bMin /*= false*/, float fMin /*= 0.0*/, bool bMax /*= false*/, float fMax /*= false*/, FnChangeCallback_t callback /*= NULL*/ ) { m_pParent = this; // Name should be static data SetDefault( pDefaultValue ); m_StringLength = strlen( m_pszDefaultValue ) + 1; m_pszString = new char[m_StringLength]; memcpy( m_pszString, m_pszDefaultValue, m_StringLength ); m_bHasMin = bMin; m_fMinVal = fMin; m_bHasMax = bMax; m_fMaxVal = fMax; m_fnChangeCallback = callback; m_fValue = ( float )atof( m_pszString ); // Bounds Check, should never happen, if it does, no big deal if ( m_bHasMin && ( m_fValue < m_fMinVal ) ) { Assert( 0 ); } if ( m_bHasMax && ( m_fValue > m_fMaxVal ) ) { Assert( 0 ); } m_nValue = ( int )m_fValue; BaseClass::Create( pName, pHelpString, flags ); }
extern int main(int argc, char **argv) { struct stat sb; DBG_Struct *dbg; int i; SetDefault(); GetOption(option, argc, argv, NULL); InitSystem(); if ((Socket == NULL) || (ExportID == NULL)) { PrintUsage(option, argv[0], NULL); exit(1); } for (i = 0;; i++) { if (stat(Socket, &sb) != -1) { break; } if (i >= RETRY) { Error("%s %s", strerror(errno), Socket); } sleep(1); } if (!S_ISSOCK(sb.st_mode)) { Error("%s is not socket file", Socket); } dbg = GetDBG_monsys(); dbg->dbt = NewNameHash(); if (OpenDB(dbg) != MCP_OK) { exit(1); } _monblob_export(dbg, ExportID, Socket); CloseDB(dbg); return 0; }
void CTextStyle::FromOldStyle(const TextStyle& style) { // Set some defaults. SetDefault(); // Copy the style information over. Font(style.get_face()); Size(MakeFixed(style.get_size(), style.get_size_fraction())); BaseSize(MakeFixed(style.get_base_size(), style.get_base_size_fraction())); Expansion(DivFixed(MakeFixed(style.get_base_size(), style.get_base_size_fraction()), MakeFixed(FONT_EXPANSION_UNIT))); Fill(style.get_pattern(), style.get_color()); Outline(style.get_outline(), style.get_color()); Shadow(style.get_shadow(), style.get_color()); m_Character.m_nEffectsVersion = 1; XFlipped(style.get_xflipped()); YFlipped(style.get_yflipped()); // Color(style.get_color()); Alignment(style.get_line_alignment()); VerticalAlignment(style.get_vertical_alignment()); // Left and right margin should be zero (default) unless set by user. // This fixes a problem converting old warp text boxes - they should // always have zero margins! LeftMargin(0); RightMargin(0); // LeftMargin(PageToInches(style.get_left_margin())); // RightMargin(PageToInches(style.get_right_margin())); LeadingType(LEADING_lines); Leading(MakeFixed(0.875)); Underline(style.UnderlineStyle()); // Update our metrics. UpdateFontMetrics(); }
SytEvAdvData::SytEvAdvData() { SetDefault(); }
SytEvTreasureChestData::SytEvTreasureChestData() { SetDefault(); }
void SytEvTreasureChestData::Decode(const unsigned char *buffer,unsigned int& buffersize) throw (DecodeError) { const unsigned char *p; p = buffer; SetDefault(); if (4 > buffersize) throw DecodeError(); chest_id = CProto::n2h_32(p); buffersize -= 4; p += 4; if (1 > buffersize) throw DecodeError(); arraysize = *p; --buffersize; ++p; //memset(&items, 0, sizeof(SytEvTCAwardItem)*MAX_NUM_TC_AWARD_ITEM); items_arraylen = 0; if (arraysize > MAX_NUM_TC_AWARD_ITEM) { throw DecodeError(); } for (unsigned int i=0; i<arraysize; ++i) { unsigned int buffersize2 = buffersize; items[i].Decode(p, buffersize2); p += (buffersize - buffersize2); buffersize = buffersize2; } items_arraylen = arraysize; if (4 > buffersize) throw DecodeError(); silver = CProto::n2h_32(p); buffersize -= 4; p += 4; if (4 > buffersize) throw DecodeError(); gold = CProto::n2h_32(p); buffersize -= 4; p += 4; if (4 > buffersize) throw DecodeError(); exp = CProto::n2h_32(p); buffersize -= 4; p += 4; if (4 > buffersize) throw DecodeError(); guard_stage_id = CProto::n2h_32(p); buffersize -= 4; p += 4; if (guard_stage_id != -1) { if (4 > buffersize) throw DecodeError(); dialog_id = CProto::n2h_32(p); buffersize -= 4; p += 4; } }
SytEvTCAwardItem::SytEvTCAwardItem() { SetDefault(); }
XJCMD_PROCESS_EVENTSC::XJCMD_PROCESS_EVENTSC() { SetDefault(); }
XJCMD_PROCESS_EVENTCS::XJCMD_PROCESS_EVENTCS() { SetDefault(); }
SytJAL_GENERAL_AWARD::SytJAL_GENERAL_AWARD() { SetDefault(); }
SytJAL_ITEM::SytJAL_ITEM() { SetDefault(); }
SytProgress::SytProgress() { SetDefault(); }
SytEvRandAwardData::SytEvRandAwardData() { SetDefault(); }
SytEvent::SytEvent() { SetDefault(); }
SytEvPvpData::SytEvPvpData() { SetDefault(); }
SytEvSeq::SytEvSeq() { SetDefault(); }
XJCMD_LEVEL_STARTSC::XJCMD_LEVEL_STARTSC() { SetDefault(); }
SytJAL_Soul::SytJAL_Soul() { SetDefault(); }
XJCMD_LEVEL_NEXTCS::XJCMD_LEVEL_NEXTCS() { SetDefault(); }
SytJAL_SKILL::SytJAL_SKILL() { SetDefault(); }
XJCMD_LEVEL_NEXTSC::XJCMD_LEVEL_NEXTSC() { SetDefault(); }