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

Function LoadSourceFile

codemp/botlib/l_precomp.cpp:3066–3100  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3064// Changes Globals: -
3065//============================================================================
3066source_t *LoadSourceFile(const char *filename)
3067{
3068 source_t *source;
3069 script_t *script;
3070
3071 PC_InitTokenHeap();
3072
3073#if DEFINEHASHING
3074 if ( !globaldefines )
3075 {
3076 globaldefines = (struct define_s **)GetClearedMemory(DEFINEHASHSIZE * sizeof(define_t *));
3077 }
3078#endif
3079
3080 script = LoadScriptFile(filename);
3081 if (!script) return NULL;
3082
3083 script->next = NULL;
3084
3085 source = (source_t *) GetMemory(sizeof(source_t));
3086 Com_Memset(source, 0, sizeof(source_t));
3087
3088 strncpy(source->filename, filename, MAX_PATH);
3089 source->scriptstack = script;
3090 source->tokens = NULL;
3091 source->defines = NULL;
3092 source->indentstack = NULL;
3093 source->skip = 0;
3094
3095#if DEFINEHASHING
3096 source->definehash = (struct define_s **)GetClearedMemory(DEFINEHASHSIZE * sizeof(define_t *));
3097#endif //DEFINEHASHING
3098 PC_AddGlobalDefinesToSource(source);
3099 return source;
3100} //end of the function LoadSourceFile
3101//============================================================================
3102//
3103// Parameter: -

Callers 10

PC_LoadSourceHandleFunction · 0.85
ReadWeightConfigFunction · 0.85
LoadItemConfigFunction · 0.85
BotLoadCharacterFromFileFunction · 0.85
LoadWeaponConfigFunction · 0.85
BotLoadSynonymsFunction · 0.85
BotLoadRandomStringsFunction · 0.85
BotLoadMatchTemplatesFunction · 0.85
BotLoadReplyChatFunction · 0.85
BotLoadInitialChatFunction · 0.85

Calls 5

PC_InitTokenHeapFunction · 0.85
GetClearedMemoryFunction · 0.85
LoadScriptFileFunction · 0.85
GetMemoryFunction · 0.85

Tested by

no test coverage detected