MCPcopy Create free account
hub / github.com/dborth/fceugx / LoadPrefsFromMethod

Function LoadPrefsFromMethod

source/preferences.cpp:585–611  ·  view source on GitHub ↗

* Load Preferences from specified filepath ***************************************************************************/

Source from the content-addressed store, hash-verified

583 * Load Preferences from specified filepath
584 ***************************************************************************/
585bool
586LoadPrefsFromMethod (char * path)
587{
588 bool retval = false;
589 int offset = 0;
590 char filepath[MAXPATHLEN];
591 sprintf(filepath, "%s/%s", path, PREF_FILE_NAME);
592
593 AllocSaveBuffer ();
594
595 offset = LoadFile(filepath, SILENT);
596
597 if (offset > 0)
598 retval = decodePrefsData ();
599
600 FreeSaveBuffer ();
601
602 if(retval)
603 {
604 strcpy(prefpath, path);
605
606 if(appPath[0] == 0)
607 strcpy(appPath, prefpath);
608 }
609
610 return retval;
611}
612
613/****************************************************************************
614 * Load Preferences

Callers 1

LoadPrefsFunction · 0.85

Calls 4

AllocSaveBufferFunction · 0.85
LoadFileFunction · 0.85
decodePrefsDataFunction · 0.85
FreeSaveBufferFunction · 0.85

Tested by

no test coverage detected