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

Function LoadSourceMemory

codemp/botlib/l_precomp.cpp:3107–3133  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3105// Changes Globals: -
3106//============================================================================
3107source_t *LoadSourceMemory(char *ptr, int length, char *name)
3108{
3109 source_t *source;
3110 script_t *script;
3111
3112 PC_InitTokenHeap();
3113
3114 script = LoadScriptMemory(ptr, length, name);
3115 if (!script) return NULL;
3116 script->next = NULL;
3117
3118 source = (source_t *) GetMemory(sizeof(source_t));
3119 Com_Memset(source, 0, sizeof(source_t));
3120
3121 strncpy(source->filename, name, MAX_PATH);
3122 source->scriptstack = script;
3123 source->tokens = NULL;
3124 source->defines = NULL;
3125 source->indentstack = NULL;
3126 source->skip = 0;
3127
3128#if DEFINEHASHING
3129 source->definehash = (struct define_s **)GetClearedMemory(DEFINEHASHSIZE * sizeof(define_t *));
3130#endif //DEFINEHASHING
3131 PC_AddGlobalDefinesToSource(source);
3132 return source;
3133} //end of the function LoadSourceMemory
3134//============================================================================
3135//
3136// Parameter: -

Callers

nothing calls this directly

Calls 5

PC_InitTokenHeapFunction · 0.85
LoadScriptMemoryFunction · 0.85
GetMemoryFunction · 0.85
GetClearedMemoryFunction · 0.85

Tested by

no test coverage detected