|
UFO: Alien Invasion
|
Shared functions. More...

Go to the source code of this file.
Macros | |
| #define | VA_BUFSIZE 4096 |
Functions | |
| const char * | Com_SkipPath (const char *pathname) |
| Returns just the filename from a given path. | |
| char * | Com_Chop (char *s) |
| Removed trailing whitespaces. | |
| char * | Com_Trim (char *s) |
| Removed leading and trailing whitespaces. | |
| char * | Com_ConvertToASCII7 (char *s) |
| Remove high character values and only keep ascii. This can be used to print utf-8 characters to the console. It will replace every high character value with a simple dot. | |
| static int | Com_FilterAfterStar (const char *pattern, const char *text) |
| Like Com_Filter, but match PATTERN against any final segment of TEXT. | |
| int | Com_Filter (const char *pattern, const char *text) |
| Match the pattern PATTERN against the string TEXT;. | |
| void | Com_ReplaceFilename (const char *inputPath, const char *expectedFileName, char *outputPath, size_t size) |
| Replaces the filename from one path with another one. | |
| void | Com_StripExtension (const char *in, char *out, const size_t size) |
| Removes the file extension from a filename. | |
| const char * | Com_GetExtension (const char *path) |
| void | Com_DefaultExtension (char *path, size_t len, const char *extension) |
| Sets a default extension if there is none. | |
| void | Com_FilePath (const char *in, char *out, size_t size) |
| Returns the path up to, but not including the last /. | |
| unsigned int | Com_HashKey (const char *name, int hashsize) |
| returns hash key for a string | |
| void | Com_MakeTimestamp (char *ts, const size_t tslen) |
| Creates a timestamp with date and time at the specified location. | |
| int | Q_FloatSort (const void *float1, const void *float2) |
| Compare two floats. | |
| int | Q_StringSort (const void *string1, const void *string2) |
| Compare two strings. | |
| const char * | va (const char *format,...) |
| does a varargs printf into a temp buffer, so I don't need to have varargs versions of all text functions. | |
| char * | Q_strlwr (char *str) |
| Converts a string to lowercase. | |
| void | Q_strncpyz (char *dest, const char *src, size_t destsize) |
| Safe strncpy that ensures a trailing zero. | |
| void | Q_strcat (char *dest, size_t destsize, const char *format,...) |
| Safely (without overflowing the destination buffer) concatenates two strings. | |
| bool | Com_sprintf (char *dest, size_t size, const char *fmt,...) |
| copies formatted string with buffer-size checking | |
| int | Q_vsnprintf (char *str, size_t size, const char *format, va_list ap) |
| Safe (null terminating) vsnprintf implementation. | |
| const char * | Q_stristr (const char *str, const char *substr) |
Checks in case insensitive manner whether str contains substr. | |
| char const * | Q_strstart (char const *str, char const *start) |
| Matches the start of a string. | |
| bool | Q_strreplace (const char *source, const char *pattern, const char *replace, char *dest, size_t destsize) |
| Replaces the first occurence of the given pattern in the source string with the given replace string. | |
| bool | Com_IsValidName (const char *input) |
| Checks whether the given input string is allowed to be used as a user-given name string for aircraft, soldiers, bases and so on. | |
| void | UFO_assert (bool condition, const char *fmt,...) |
Shared functions.
Definition in file shared.cpp.
| #define VA_BUFSIZE 4096 |
Definition at line 405 of file shared.cpp.
Referenced by va().
| char * Com_Chop | ( | char * | s | ) |
Removed trailing whitespaces.
| s | The string that is modified |
Definition at line 48 of file shared.cpp.
Referenced by Cmd_TokenizeString(), and Com_Trim().
| char * Com_ConvertToASCII7 | ( | char * | s | ) |
Remove high character values and only keep ascii. This can be used to print utf-8 characters to the console. It will replace every high character value with a simple dot.
Definition at line 82 of file shared.cpp.
References length.
Referenced by TEST_F().
| void Com_DefaultExtension | ( | char * | path, |
| size_t | len, | ||
| const char * | extension ) |
Sets a default extension if there is none.
Definition at line 297 of file shared.cpp.
References Com_sprintf(), len, MAX_OSPATH, and Q_strncpyz().
Referenced by Com_WriteConfig_f(), Key_WriteBindings_f(), main(), R_LoadModelAsync(), R_ModLoadAliasMD2Model(), R_ModLoadMDX(), and RT_WriteCSVFiles().
| void Com_FilePath | ( | const char * | in, |
| char * | out, | ||
| size_t | size ) |
Returns the path up to, but not including the last /.
Definition at line 319 of file shared.cpp.
References Q_strncpyz().
Referenced by ExportLightmaps(), FS_BuildFileList(), Sys_FindFirst(), and TEST_F().
| int Com_Filter | ( | const char * | pattern, |
| const char * | text ) |
Match the pattern PATTERN against the string TEXT;.
Definition at line 145 of file shared.cpp.
References Com_FilterAfterStar().
Referenced by Com_FilterAfterStar(), Sys_FindFirst(), Sys_FindNext(), and Sys_ListFilteredFiles().
|
static |
Like Com_Filter, but match PATTERN against any final segment of TEXT.
Definition at line 106 of file shared.cpp.
References Com_Filter().
Referenced by Com_Filter().
| const char * Com_GetExtension | ( | const char * | path | ) |
| path | The path resp. filename to extract the extension from |
nullptr if the given path name does not contain an extension Definition at line 282 of file shared.cpp.
Referenced by CL_CheckAndQueueDownload(), CL_FinishHTTPDownload(), CL_QueueHTTPDownload(), CL_StartHTTPDownload(), FS_LoadPackFile(), MD2Check(), MD2SkinFix(), R_FindModel(), R_LoadModelAsync(), R_ModelExists(), and SV_LoadModelAABB().
returns hash key for a string
Definition at line 336 of file shared.cpp.
Referenced by CL_GetMessageID(), CL_ParseMessageID(), Cmd_AddCommand(), Cmd_Alias_f(), Cmd_CompleteCommandParameters(), Cmd_RemoveCommand(), Cmd_TableFind(), Cmd_vExecuteString(), Com_GetConstInt(), Com_GetTerrainType(), Com_ParseTerrain(), Com_RegisterConstInt(), Com_UnregisterConstVariable(), Cvar_Delete(), Cvar_FindVar(), Cvar_Get(), R_DeleteImage(), R_GetImage(), R_LoadImageData(), RS_GetTechByID(), RS_GetTechByProvided(), RS_GetTechIdxByName(), RS_ParseTechnologies(), S_FindByName(), S_LoadSampleIdx(), SVC_BucketForAddress(), TEST_GetProperty(), TEST_RegisterProperty(), UI_WindowNodeAddIndexedNode(), UI_WindowNodeGetIndexedChild(), and va().
| bool Com_IsValidName | ( | const char * | input | ) |
Checks whether the given input string is allowed to be used as a user-given name string for aircraft, soldiers, bases and so on.
| [in] | input | The input string to check |
true if the string is valid and can be used as a name, false otherwise Definition at line 612 of file shared.cpp.
References Q_streq, and Q_strvalid.
Referenced by AIR_ChangeAircraftName_f(), B_BuildBase_f(), B_ChangeBaseName_f(), and E_ChangeName_f().
| void Com_MakeTimestamp | ( | char * | ts, |
| const size_t | tslen ) |
Creates a timestamp with date and time at the specified location.
| ts | ptr to the resulting string |
| tslen | length of target buffer |
Definition at line 352 of file shared.cpp.
References Com_sprintf().
Referenced by CL_LogEvent(), Com_vPrintf(), SAV_GameSave(), and va().
| void Com_ReplaceFilename | ( | const char * | inputPath, |
| const char * | expectedFileName, | ||
| char * | outputPath, | ||
| size_t | size ) |
Replaces the filename from one path with another one.
| [in] | inputPath | The full path to a filename |
| [in] | expectedFileName | The filename to insert into the given full path |
| [out] | outputPath | The target buffer |
| [in] | size | The size of the target buffer |
Definition at line 239 of file shared.cpp.
References Q_strncpyz().
Referenced by R_AliasModelGetSkin().
| const char * Com_SkipPath | ( | const char * | pathname | ) |
Returns just the filename from a given path.
Definition at line 37 of file shared.cpp.
Referenced by _AddToListBlock(), ExportLightmaps(), FS_GetMaps(), GenerateMaterialFile(), GetUMPName(), M_RandomTrack_f(), MD2SkinFix(), R_LoadMaterials(), SAV_ListSaveGames_f(), WEB_CGameDelete(), and WEB_ListCGameFilesCallback().
| bool Com_sprintf | ( | char * | dest, |
| size_t | size, | ||
| const char * | fmt, | ||
| ... ) |
copies formatted string with buffer-size checking
| [out] | dest | Destination buffer |
| [in] | size | Size of the destination buffer |
| [in] | fmt | Stringformat (like printf) |
Definition at line 494 of file shared.cpp.
References dest, i, len, Q_vsnprintf(), UTF8_char_len(), and UTF8_CONTINUATION_BYTE.
Referenced by actorL_tostring(), AII_UpdateOneInstallationDelay(), AIL_InitActor(), AIM_AircraftEquipMenuUpdate(), AIR_AircraftFillList_f(), AIR_AircraftSelect(), AIR_Move(), AIR_NewAircraft(), AIR_Refuel(), B_BuildBase_f(), B_SellOrAddItems(), B_SetBaseTitle_f(), B_UpdateBuildingConstructions(), BDEF_AddSlotToSlotList(), CalcTextureReflectivity(), CHAR_UpdateStats(), CheckBSPFile(), CHRSH_CharGetBody(), CHRSH_CharGetHead(), CL_ActorAppear(), CL_ActorDie(), CL_ActorRevitalised(), CL_ActorWound(), CL_AddBrushModel(), CL_CanMultiplayerStart(), CL_CheckAndQueueDownload(), CL_ConnectionlessPacket(), CL_DisplayHomebasePopup(), CL_DisplayPopupInterceptMission(), CL_DisplayPopupInterceptUFO(), CL_DownloadUMPMap(), CL_EventAddMail(), CL_FinishHTTPDownload(), CL_Init(), CL_LanguageTest(), CL_PrecacheCharacterModels(), CL_QueueHTTPDownload(), CL_StartHTTPDownload(), CL_UfoModuleLoader(), CM_AddMapTile(), CM_LoadMap(), Com_DefaultExtension(), Com_GetAircraftIdStr(), Com_GetCrashedAircraftIdStr(), Com_LoadLibrary(), Com_MakeTimestamp(), Com_sprintf(), Com_ValueToStr(), CompareAttributes(), Con_DrawConsole(), CP_BaseAttackMissionDestroyBase(), CP_BaseAttackPrepareBattle(), CP_CreateBattleParameters(), CP_MissionEndActions(), CP_MissionGetMessage(), CP_SecondConvert(), CP_SetAlienEquipmentByInterest(), CP_SetMissionName(), uiText2Node::drawText(), uiTextNode::drawText(), E_CreateEmployee(), EntityForModel(), ExportLightmap(), FS_AddGameDirectory(), FS_BuildFileList(), FS_GetHomeDirectory(), FS_GetMaps(), FS_InitFilesystem(), FS_OpenFile(), FS_RenameFile(), G_Players_f(), G_PrintActorStats(), G_PrintStats(), G_Say_f(), GAME_CP_CampaignDescription_f(), GAME_GetAbsoluteSavePath(), GAME_GetRelativeSavePath(), GAME_GetTeamFileName(), GAME_MP_EndRoundAnnounce(), GAME_MP_ParseServerInfoMessage(), GAME_MP_SetTeamNum(), GAME_SK_ChangeEquip_f(), GAME_SK_Results(), GAME_TeamGetFreeFilename(), GenerateMaterialFile(), GEO_Draw(), GEO_GetAircraftText(), GEO_GetMissionText(), GEO_GetUFOText(), HOS_EntryWoundData(), HTTP_ResolvURL(), HUD_DisplayFiremodeEntry(), HUD_MapDebugCursor(), HUD_PopupFiremodeReservation(), HUD_UpdateActorFireMode(), HUD_UpdateActorLoad_f(), HUD_UpdateActorMove(), Info_SetValueForKey(), INS_BuildInstallation_f(), INS_DestroyInstallation(), INS_DestroyInstallation_f(), INS_UpdateInstallationData(), INV_ItemDescription(), INV_UpdateActorLoad_f(), Irc_GetExternalIP(), Irc_Logic_AddChannelName(), LE_GetAnim(), Master_HeartbeatThread(), MD2SkinFix(), MS_LoadXML(), MS_TimestampedText(), NAT_HandleBudget(), NAT_SetHappiness(), NET_StreamPeerToName(), ParseBrush(), ParseUMP(), pos3L_tostring(), PR_AircraftInfo(), PR_CheckFrame(), PR_DisassemblyInfo(), PR_FinishDisassembly(), PR_FinishProduction(), PR_ItemProductionInfo(), PR_ProductionIncrease_f(), PR_QueueNext(), R_FindModel(), R_LoadMaterials(), R_LoadObjSkin(), R_ModAddMapTile(), R_ModBeginLoading(), R_ModLoadLevelOfDetailData(), R_ModLoadTexinfo(), R_PreprocessShaderR(), R_ScreenShot(), R_SetupSubmodels(), RS_CheckRequirements(), RS_MarkCollected(), RS_MarkOneResearchable(), RS_ResearchFinish(), RS_ResearchRun(), S_CompleteSounds(), SAV_GameSave(), SCR_TouchPics(), SetModelNumbers(), SV_CheckMap(), SV_DoMapAssemble(), SV_LoadModelAABB(), SV_NextMapcycle(), SV_ParseMapTile(), SV_ParseMapTileSet(), SV_ParseUMP(), SV_PrintAssemblyStats(), SVC_Info(), SVC_Status(), SVCmd_WriteIP_f(), Sys_FindFirst(), Sys_FindNext(), Sys_ListFilteredFiles(), Sys_OpenURL(), TEST_F(), Touch_NextMapTrigger(), TR_EmptyTransferCargo(), TR_FillAliens(), TR_FillEmployees(), TR_TransferEnd(), TR_TransferStart_f(), UI_AutoGenerateSprite(), UI_BuildRadarImageList(), UI_GetItemTooltip(), UI_InitRadar(), UI_Tooltip(), UP_AircraftDescription(), UP_BuildingDescription(), UP_OpenMail_f(), UP_SetMailHeader(), UP_UGVDescription(), UR_DialogStartSell_f(), UR_DialogStartStore_f(), UR_ProcessActive(), US_DestroyStoredUFO_f(), US_TransferUFO(), WEB_Auth(), WEB_CGameGetURL(), WEB_GetToFile(), and WEB_GetURL().
| void Com_StripExtension | ( | const char * | in, |
| char * | out, | ||
| const size_t | size ) |
Removes the file extension from a filename.
| [in] | in | The incoming filename |
| [out] | out | The stripped filename |
| [in] | size | The size of the output buffer |
Definition at line 259 of file shared.cpp.
References i.
Referenced by ASE_KeyMAP_DIFFUSE(), CIN_OpenCinematic(), ExportLightmaps(), FS_GetMaps(), GenerateFootstepList(), GenerateMaterialFile(), M_Start(), main(), MD2SkinFix(), PrecalcNormalsAndTangents(), R_FindImage(), R_LoadImage(), R_LoadModelAsync(), R_LoadObjSkin(), R_ModLoadAliasMD2Model(), R_ModLoadLevelOfDetailData(), R_ModLoadMDX(), S_LoadSampleIdx(), SAV_ListSaveGames_f(), WEB_CGameDelete(), and WEB_ListCGameFilesCallback().
| char * Com_Trim | ( | char * | s | ) |
Removed leading and trailing whitespaces.
| s | The string that is modified |
Definition at line 65 of file shared.cpp.
References Com_Chop().
Referenced by GAME_MP_AddChatMessage(), and R_LoadObjModel_().
Compare two floats.
| [in] | float1 | The first float |
| [in] | float2 | The second float |
Definition at line 372 of file shared.cpp.
Referenced by AIR_GetAircraftWeaponRanges(), and va().
| void Q_strcat | ( | char * | dest, |
| size_t | destsize, | ||
| const char * | format, | ||
| ... ) |
Safely (without overflowing the destination buffer) concatenates two strings.
| [in] | dest | the destination string. |
| [in] | destsize | the total size of the destination buffer. |
| [in] | format | the format or simple source string. |
Definition at line 475 of file shared.cpp.
References dest, format(), Q_vsnprintf(), and Sys_Error().
Referenced by AIM_AircraftEquipMenuUpdate(), AIR_AircraftSelect(), B_AddMap(), Cbuf_AddLateCommands(), CL_ConvertSoundFromEvent(), CL_LanguageTest(), Cmd_Alias_f(), CMod_LoadEntityString(), Com_ConsoleCompleteCommand(), Com_GetCharacterValues(), Com_MD5Buffer(), Com_MD5File(), Com_SHA1Buffer(), Com_SHA1File(), Com_SHA2ToHex(), Com_vPrintf(), uiBaseInventoryNode::drawTooltip(), uiContainerNode::drawTooltip(), uiStringNode::drawTooltip(), FS_AddHomeAsGameDirectory(), FS_GetModList(), G_Players_f(), GAME_MP_ParseServerInfoMessage(), GAME_MP_PingServerCallback(), GAME_TeamDelete_f(), GAME_TeamSlotComments_f(), GEO_DrawMarkers(), GEO_GetAircraftText(), GEO_GetUFOText(), HUD_ActorWoundData_f(), HUD_UpdateActorLoad_f(), INV_ItemDescription(), INV_UpdateActorLoad_f(), Irc_AppendToBuffer(), PR_AircraftInfo(), PR_DisassemblyInfo(), PR_ItemProductionInfo(), PrecalcNormalsAndTangents(), R_DumpOpenGlState(), Rimp_Init(), SAV_GameDelete_f(), SAV_GameLoad(), SAV_GameSave(), SAV_ListSaveGames_f(), SAV_LoadHeader(), STATS_Update_f(), SV_BuildMapStrings(), SVC_RemoteCommand(), Sys_GetHomeDirectory(), TEST_F(), UI_GetItemTooltip(), UI_GetPath(), UI_MaterialEditorStagesToName(), UI_SetKeyBindingEx(), UnparseEntities(), UP_AircraftDescription(), UP_AircraftItemDescription(), UP_BuildingDescription(), WEB_CGameDownloadFromUser(), and WEB_UploadCGame_f().
Compare two strings.
| [in] | string1 | The first string |
| [in] | string2 | The second string |
Definition at line 385 of file shared.cpp.
Referenced by Com_MapDefSort(), FS_AddGameDirectory(), FS_ListFiles(), FS_LoadPackFile(), FS_MapDefSort(), Irc_Client_Names_f(), LIST_AddStringSorted(), TEST_F(), and va().
| const char * Q_stristr | ( | const char * | str, |
| const char * | substr ) |
Checks in case insensitive manner whether str contains substr.
| [in] | str | The source string |
| [in] | substr | The string to search in the source string |
null if substr is no part of str Definition at line 563 of file shared.cpp.
References Q_strncasecmp.
Referenced by format(), and R_SearchForVendor().
| char * Q_strlwr | ( | char * | str | ) |
Converts a string to lowercase.
| [in,out] | str | The string that is converted to lowercase |
Definition at line 438 of file shared.cpp.
Referenced by format(), FS_ListFiles(), FS_LoadPackFile(), and WEB_Auth().
| void Q_strncpyz | ( | char * | dest, |
| const char * | src, | ||
| size_t | destsize ) |
Safe strncpy that ensures a trailing zero.
| dest | Destination pointer |
| src | Source pointer |
| destsize | Size of destination buffer (this should be a sizeof size due to portability) |
Definition at line 457 of file shared.cpp.
References dest, Sys_Error(), and UTF8_strncpyz().
Referenced by _Mem_CreatePool(), AIL_InitActor(), AIM_AircraftEquipMenuUpdate(), AIR_ChangeAircraftName_f(), AIR_LoadAircraftXML(), AIR_NewAircraft(), AIR_ParseAircraft(), B_LoadXML(), B_SetBaseTitle_f(), B_SetName(), BDEF_BaseDefenceMenuUpdate_f(), BDEF_RemoveBattery_f(), Check_SetNodraw(), CheckMixedFaceContents(), CheckTexturesBasedOnFlags(), CIN_ROQ_OpenCinematic(), CIN_RunCinematic(), CL_AddMapParticle(), CL_CheckOrDownloadFile(), CL_DownloadUMPMap(), CL_HTTP_Progress(), CL_Init(), CL_LanguageInit(), CL_LanguageTest(), CL_ParseClientinfo(), CL_ParseMapParticle(), CL_ParseParticle(), CL_ParsePtlCmds(), CL_ParseSequence(), CL_ParticleGetArt(), CL_ParticleSpawnTimed(), CL_QueueHTTPDownload(), CL_SetHTTPServer(), CM_AddMapTile(), CM_LoadMap(), Cmd_Alias_f(), Cmd_GenericCompleteFunction(), Cmd_GetCommandDesc(), Cmd_TokenizeString(), CMod_LoadEntityString(), CMod_LoadSurfaces(), Com_ConsoleCompleteCommand(), Com_DefaultExtension(), Com_FilePath(), Com_GetCharacterModel(), Com_GetCharacterValues(), Com_MacroExpandString(), Com_ParseActorNames(), Com_ParseBodyPart(), Com_ParseCharacterTemplate(), Com_ParseDamageTypes(), Com_ParseEquipment(), Com_ParseGameTypes(), Com_ParseInventory(), Com_ParseTeam(), Com_ParseTerrainDefinition(), Com_ParseValue(), Com_RegisterConstInt(), Com_ReplaceFilename(), Com_SetValue(), Com_ValueToStr(), Com_WriteConfig_f(), COMP_ParseComponents(), Con_LoadConsoleHistory(), CP_CheckTriggerEvent(), CP_CreateCivilianTeam(), CP_ParseAlienTeam(), CP_ParseCampaign(), CP_TEAM_FillEmployeeList_f(), uiModelNode::draw(), uiTextNode::drawText(), E_ChangeName_f(), E_CreateEmployee(), E_GetCounts_f(), ED_ParseEdict(), FindMiptex(), FS_AddGameDirectory(), FS_BuildFileList(), FS_CreateOpenPipeFile(), FS_CreatePath(), FS_GetCwd(), FS_GetFileData(), FS_GetMaps(), FS_ListFiles(), FS_LoadPackFile(), FS_NextScriptHeader(), FS_OpenFile(), G_ClientUserinfoChanged(), G_SpawnEntities(), GAME_LoadCharacter(), GAME_MP_AddChatMessage(), GAME_MP_Connect_f(), GAME_MP_ParseServerInfoMessage(), GAME_MP_ProcessPingReply(), GAME_MP_QueryMasterServerThread(), GAME_ParseModes(), GAME_SaveTeam(), GAME_SetServerInfo(), GAME_TeamSlotComments_f(), GetUMPName(), HTTP_Encode(), HTTP_ExtractComponents(), HTTP_GetURLInternal(), HTTP_Header(), HUD_ActorWoundData_f(), HUD_DisplayActions_f(), HUD_DisplayFiremodes_f(), HUD_UpdateActorFireMode(), Info_SetValueForKey(), INS_Build(), INS_ChangeInstallationName_f(), INS_LoadXML(), Irc_AppendToBuffer(), Irc_Client_CmdKick(), Irc_Client_CmdPrivmsg(), Irc_Client_CmdRplNamreply(), Irc_Client_CmdRplWhoisaccount(), Irc_Client_CmdRplWhoisidle(), Irc_Client_CmdRplWhoisserver(), Irc_Client_CmdRplWhoisuser(), Irc_Client_CmdRplWhoreply(), Irc_Client_CmdRplWhowasuser(), Irc_Client_Names_f(), Irc_Client_Topic_f(), Irc_ParseName(), Irc_Proto_Join(), Irc_Proto_ProcessServerMsg(), Key_Console(), Key_WriteBindings_f(), LM_AddModel(), LoadModel(), M_Start(), main(), MIS_LoadXML(), MS_AddNewMessage(), MS_LoadXML(), NAT_DrawCharts_f(), NAT_ListStats_f(), NET_AddrinfoToString(), NET_SockaddrToStrings(), NET_StreamPeerToName(), uiTextEntryNode::onFocusGained(), ParseBrush(), ParseFromMemory(), ParseUMP(), R_FindModel(), R_FontFindTruncFit(), R_FontGenerateTexture(), R_FontMakeChunks(), R_FontSetTruncationMarker(), R_InitExtensions(), R_LoadActorSkinsFromModel(), R_LoadAnimImages(), R_LoadImageData(), R_LoadModel(), R_LoadObjSkin(), R_LoadProgram(), R_LoadShader(), R_ModBeginLoading(), R_ModLoadAliasMD2MeshIndexed(), R_ModLoadAliasMD2MeshUnindexed(), R_ModLoadAliasMD3Model(), R_ModLoadAnims(), R_PrintInfo(), R_ProgramVariable(), S_MumbleUpdate(), SAV_GameSave(), SAV_GameSave_f(), SEQ_ExecuteModel(), SEQ_ExecuteObj2D(), BodyData::setId(), MapInfo::setName(), SP_misc_model(), STAT_GetExpenses_f(), STRHUNK_Add(), SV_CompleteMapCommand(), SV_Map(), SV_Map_f(), SV_NextMapcycle(), SV_ParseAssembly(), SV_ParseMapcycle(), SV_ParseMapTile(), SV_ParseMapTileSet(), SV_ParseUMP(), SV_SetConfigString(), SV_UserinfoChanged(), SVC_BucketForAddress(), SVC_DirectConnect(), Sys_ConsoleInput(), Sys_FindFirst(), Sys_GetCurrentUser(), TEST_F(), TEST_F(), TEST_F(), Test_Parameters(), TEST_RegisterProperty(), TexinfoForBrushTexture(), Touch_NextMapTrigger(), TR_Add_f(), U2M_Parameter(), UFO_CampaignCheckEvents(), UI_AddLineChartLine(), UI_AllocNodeWithoutNew(), UI_AllocStaticSprite(), UI_AllocStaticString(), UI_AutoGenerateSprite(), UI_BuildRadarImageList(), UI_CloneNode(), UI_DisplayNotice(), UI_DrawModelNode(), UI_InitOption(), UI_ListMaps_f(), UI_Option_SetLabel(), UI_Option_SetValue(), UI_ParseAndLoadLuaScript(), UI_ParseProperty(), UI_ReadNodePath(), UI_TextEntryNodeEdit(), UI_TextNodeGenerateLineSplit(), UM_Parameter(), UnparseEntities(), UP_SetMailHeader(), US_LoadXML(), US_StoreUFO(), WEB_Auth(), and WEB_CGameGetURL().
| bool Q_strreplace | ( | const char * | source, |
| const char * | pattern, | ||
| const char * | replace, | ||
| char * | dest, | ||
| size_t | destsize ) |
Replaces the first occurence of the given pattern in the source string with the given replace string.
| source | The source string |
| pattern | The pattern that should be replaced |
| replace | The replacement string |
| dest | The target buffer |
| destsize | The size of the target buffer |
false, the target string might be in an undefined stage. E.g. don't rely on it being 0-terminated. false if the pattern wasn't found or the target buffer is to small to store the resulting string, if the replacement was successful. Definition at line 596 of file shared.cpp.
Referenced by format(), main(), R_CheckExtension(), R_GetProcAddressExt(), TEST_F(), and WEB_CGameGetURL().
| char const * Q_strstart | ( | char const * | str, |
| char const * | start ) |
Matches the start of a string.
| [in] | str | The source string to scan. |
| [in] | start | The string to match. |
const char* name = "*cvar:version";
char *p = Q_strstrart(name, "*cvar:"); // <– p now points to the substring "version"
Definition at line 587 of file shared.cpp.
Referenced by BS_Buy_f(), BS_ShowInfo_f(), BuildLights(), Cbuf_AddText(), Check_IsInfoStart(), CheckEntities(), CL_ConnectionlessPacket(), CL_Translate(), Cmd_GenericCompleteFunction(), Com_GetAircraftIdNum(), Com_GetCrashedAircraftIdNum(), CP_CheckTriggerEvent(), CP_IsAlienEquipmentSelectable(), format(), HUD_ExecuteAction_f(), INV_EquipmentDefSanityCheck(), IsInlineModelEntity(), LE_GetAnim(), main(), uiRadioButtonNode::onActivate(), uiTextEntryNode::onLeftClick(), uiContainerNode::onLoaded(), uiTabNode::onWindowOpened(), R_ModLoadAliasMD2MeshUnindexed(), R_ParseStage(), uiAbstractValueNode::setDelta(), uiAbstractValueNode::setMax(), uiAbstractValueNode::setMin(), uiAbstractValueNode::setValue(), SV_Map(), TEST_F(), Test_Parameters(), TR_Add_f(), UFO_AnalyseTestWindow(), UI_AbstractOption_GetCurrentValue(), UI_CloneCvarOrFloat(), UI_FreeCvarOrFloat(), UI_GenInjectedString(), UI_GetFloatFromNodeProperty(), UI_GetReferenceFloat(), UI_NodeSetProperty(), UI_NodeSetPropertyFromActionValue(), and UI_ParseValueExpression().
| int Q_vsnprintf | ( | char * | str, |
| size_t | size, | ||
| const char * | format, | ||
| va_list | ap ) |
Safe (null terminating) vsnprintf implementation.
Definition at line 535 of file shared.cpp.
References Com_Printf(), format(), len, and UFO_SIZE_T.
Referenced by Cbuf_AddText(), Check_Printf(), Cmd_vExecuteString(), Com_DPrintf(), Com_DPrintf(), Com_Error(), Com_Printf(), Com_Printf(), Com_sprintf(), Com_vPrintf(), CP_Popup(), Cvar_Set(), FS_CheckFile(), FS_FileExists(), FS_Printf(), G_PrintStats(), GAME_AddChatMessage(), GAME_NET_OOB_Printf(), GAME_NET_OOB_Printf2(), GAME_UI_Popup(), Irc_AppendToBuffer(), NET_OOB_Printf(), NET_VPrintf(), Q_strcat(), R_ImageExists(), SV_BroadcastPrintf(), SV_Configstring(), SV_error(), SV_LogAdd(), SV_PlayerPrintf(), Sys_Error(), TEST_vPrintf(), TEST_vPrintfLog(), UFO_assert(), va(), and Verb_Printf().
| void UFO_assert | ( | bool | condition, |
| const char * | fmt, | ||
| ... ) |
Definition at line 627 of file shared.cpp.
References Q_vsnprintf(), and Sys_Error().
Referenced by RT_CheckCell().
| const char * va | ( | const char * | format, |
| ... ) |
does a varargs printf into a temp buffer, so I don't need to have varargs versions of all text functions.
Definition at line 410 of file shared.cpp.
References format(), index, Q_vsnprintf(), and VA_BUFSIZE.
Referenced by AIM_DrawAircraftSlots(), AIM_UpdateAircraftItemList(), AIR_AircraftStatusToName(), AIR_CampaignRun(), AIR_GeoSelectAircraft_f(), AIR_SendAircraftPursuingUFO(), AIRFIGHT_ExecuteActions(), B_AssembleMap(), B_BuildingDestroy_f(), B_Destroy_AntimaterStorage_f(), B_FillBuildingInfo_f(), B_FillMap_f(), B_SellOrAddItems(), BS_FillMarket_f(), CIN_OpenCinematic(), CL_ActorDie(), CL_ActorRevitalised(), CL_ActorSelect(), CL_ActorStateChange(), CL_BattlescapeRadarGenerate_f(), CL_CameraAppear(), CL_CharacterSkillAndScoreCvars(), CL_DisplayPopupInterceptUFO(), CL_DownloadMap(), CL_DownloadUMPMap(), CL_EventAddMail(), CL_InitSkin_f(), CL_ParticleLoadArt(), CL_QueryMasterServer(), CL_TeamDefInitMenu(), CL_VideoInitMenu(), Com_Error(), Com_GetAircraftIdNum(), Com_GetConstIntFromNamespace(), Com_GetCrashedAircraftIdNum(), Com_GetRandomMapAssemblyNameForCraft(), Com_ParseAircraftNames(), Com_ParseTeam(), Com_Quit(), CP_BaseAttackStartMission(), Cvar_Switch_f(), uiRadarNode::draw(), uiVideoNode::drawOverWindow(), FS_AddHomeAsGameDirectory(), FS_CreateOpenPipeFile(), FS_GetModList(), FS_WriteFile(), G_Init(), G_MissionGetTeamString(), GAME_MP_BookmarkAdd_f(), GAME_MP_CompleteNetworkAddress(), GAME_MP_ParseTeamInfoMessage(), GAME_MP_Results(), GAME_MP_ServerListInit(), GAME_TeamSlotComments_f(), GenerateFootstepList(), GEO_Init(), HUD_ActorWoundData_f(), HUD_ToggleCrouchReservation_f(), HUD_UpdateActorStats(), IN_JoystickInitMenu(), Info_SetValueForKeyAsInteger(), INS_FillTypes_f(), INS_FillUFOYardData_f(), Irc_Client_CmdPrivmsg(), Irc_Client_Invite_f(), Key_WriteBindings(), LET_StartIdle(), M_Start(), Master_Shutdown(), MD2SkinEdit(), MD2SkinNum(), MIS_GetName(), MIS_InitResultScreen(), MSO_InitList(), PR_RequirementsInfo(), PR_UpdateProductionList(), Qcommon_Init(), R_Draw3DGlobe(), R_DrawFlatGeoscape(), R_FindImage(), R_FindPics(), R_GenerateGrass(), R_InitializeShader(), R_InitImages(), R_LoadActorSkinsFromModel(), R_LoadAnimImages(), R_LoadMaterials(), R_LoadObjSkin(), R_LoadProgram(), R_ParseStage(), S_LoadSampleChunk(), S_MumbleUpdate(), SAV_GameLoad(), SCR_DrawDownloading(), SCR_UpdateScreen(), SV_Map(), SV_SetConfigString(), SV_SetMaster_f(), SV_StartGame_f(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TR_CargoList(), TR_InitBaseList(), TR_List_f(), UFO_AnalyseTestWindow(), UFO_CampaignCheckEvents(), UFO_ExecuteTestWindow(), UFO_GetName(), UFO_SearchAircraftTarget(), UI_AllocStaticStringCondition(), UI_BaseInventoryNodeDraw2(), UI_BaseInventoryNodeDrawItems(), UI_DrawFree(), UI_EditorNodeExtract_f(), UI_GenInjectedString(), UI_GetStringFromExpression(), UI_GetStringFromNodeProperty(), UI_InitRadar(), UI_LoadImage(), UI_LoadWrappedImage(), UI_ParseValueExpression(), UI_PlaySound(), UI_PopupButton(), UI_Tooltip(), UP_GenerateArticlesSummary(), UP_GenerateSummary(), VectorRotate(), VID_Init(), and WEB_CGameUpload().