MCPcopy Create free account
hub / github.com/JACoders/OpenJK / LibVarSet

Function LibVarSet

codemp/botlib/l_libvar.cpp:244–264  ·  view source on GitHub ↗

end of the function LibVarValue =========================================================================== Parameter: - Returns: - Changes Globals: - ===========================================================================

Source from the content-addressed store, hash-verified

242// Changes Globals: -
243//===========================================================================
244void LibVarSet(char *var_name, char *value)
245{
246 libvar_t *v;
247
248 v = LibVarGet(var_name);
249 if (v)
250 {
251 FreeMemory(v->string);
252 } //end if
253 else
254 {
255 v = LibVarAlloc(var_name);
256 } //end else
257 //variable string
258 v->string = (char *) GetMemory(strlen(value) + 1);
259 strcpy(v->string, value);
260 //the value
261 v->value = LibVarStringValue(v->string);
262 //variable is modified
263 v->modified = qtrue;
264} //end of the function LibVarSet
265//===========================================================================
266//
267// Parameter: -

Callers 4

LoadItemConfigFunction · 0.85
LoadWeaponConfigFunction · 0.85
Export_BotLibVarSetFunction · 0.85
AAS_StartFrameFunction · 0.85

Calls 5

LibVarGetFunction · 0.85
FreeMemoryFunction · 0.85
LibVarAllocFunction · 0.85
GetMemoryFunction · 0.85
LibVarStringValueFunction · 0.85

Tested by

no test coverage detected