Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
init/deinit calls for some new modules, safer passing of vbHomeDir info.
  • Loading branch information
icculus committed Oct 2, 2000
1 parent cf83618 commit e3ca9da
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions BASIClib/Initialize.c
Expand Up @@ -108,7 +108,7 @@ __boolean __initializationComplete(void)



void __initBasicLib(__long flags, int argc, char **argv, char **envp)
void __initBasicLib(__long flags, int argc, char **argv)
/*
* Global initialization function. Call __initBasicLib() before doing anything
* else with the library. This function just calls each other sections'
Expand All @@ -118,26 +118,39 @@ void __initBasicLib(__long flags, int argc, char **argv, char **envp)
* returns : void.
*/
{
char *ptr;

if (initialized == false)
{
initFlags = flags;

__calculateUserAppDir();
__initLanguage(vbHomeDir);

ptr = malloc(strlen(vbHomeDir) + 1);
if (ptr == NULL)
__runtimeError(ERR_OUT_OF_MEMORY);

strcpy(ptr, vbHomeDir);
__initLanguage(ptr);

__initMemoryManager();
__initSignalHandlers();
__initBasicError();
__initConsoleFunctions();

strcpy(ptr, vbHomeDir);
__initConsole(ptr);

__initEnvrFunctions(argc, argv);
__initTimeDateFunctions();
__initRegistryFunctions();
__initGUIFrontEnd();
__initFileSystemFunctions();
__initFileIOFunctions();
__initThreads(); /* Make sure this is last init call. */

atexit(__deinitBasicLib);

free(ptr);
initialized = true;
} /* if */
} /* __initBasicLib */
Expand All @@ -153,11 +166,12 @@ void __deinitBasicLib(void)
initFlags = INITFLAG_NOT_INITIALIZED;
initialized = false;
__deinitFileSystemFunctions();
__deinitFileIOFunctions();
__deinitRegistryFunctions();
__deinitEnvrFunctions();
__deinitThreads();
__deinitGUIFrontEnd();
__deinitConsoleFunctions();
__deinitConsole();
__deinitBasicError();
__deinitLanguage();
} /* if */
Expand Down

0 comments on commit e3ca9da

Please sign in to comment.