CString CP4FileStats::GetFormattedFilename(BOOL showFileType) const { CString filename = GET_P4REGPTR( )->ShowEntireDepot( ) <= SDF_DEPOT ? GetDepotFilename() : GetClientFilename(); // Format name + haveRev+headRev for display CString temp; if(m_HeadAction == F_DELETE) { // If the user has the file at < headrev, let the user know if( m_HaveRev > 0 && m_HaveRev < m_HeadRev ) temp.FormatMessage(IDS_FSTAT_s_n_n_s_HEAD_REV_DELETED, filename, m_HaveRev, m_HeadRev, m_HeadType); else if(showFileType) temp.FormatMessage(IDS_FSTAT_s_n_n_s_DELETED, filename, m_HaveRev, m_HeadRev, m_HeadType); else temp.FormatMessage(IDS_FSTAT_s_n_n_DELETED, filename, m_HaveRev, m_HeadRev); } else { if (!m_HeadRev && !m_HaveRev) temp = filename; else if(showFileType) temp.FormatMessage(IDS_FSTAT_s_n_n_s, filename, m_HaveRev, m_HeadRev, m_HeadType); else temp.FormatMessage(IDS_FSTAT_s_n_n, filename, m_HaveRev, m_HeadRev); } return temp; }
MagickExport void InitializeMagick(const char *path) { const char *p; /* NOTE: This routine sets up the path to the client which needs to be determined before almost anything else works right. This also includes logging!!! So we can't start logging until the path is actually saved. As soon as we know what the path is we make the same call to DefineClientSettings to set it up. Please make sure that this rule is followed in any future updates the this code!!! */ if (MagickInitialized == InitInitialized) return; SPINLOCK_WAIT; MagickInitialized=InitInitialized; SPINLOCK_RELEASE; #if defined(MSWINDOWS) # if defined(_DEBUG) && !defined(__BORLANDC__) { int debug; debug=_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); debug|=_CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_DELAY_FREE_MEM_DF | _CRTDBG_LEAK_CHECK_DF; // debug=_CrtSetDbgFlag(debug); // _ASSERTE(_CrtCheckMemory()); } # endif /* defined(_DEBUG) */ #endif /* defined(MSWINDOWS) */ (void) setlocale(LC_ALL,""); (void) setlocale(LC_NUMERIC,"C"); /* Initialize semaphores */ InitializeSemaphore(); /* Initialize logging */ InitializeLogInfo(); /* Seed the random number generator */ srand(MagickRandNewSeed()); /* Initialize our random number generator */ InitializeMagickRandomGenerator(); /* Set logging flags using the value of MAGICK_DEBUG if it is set in the environment. */ if ((p=getenv("MAGICK_DEBUG")) != (const char *) NULL) (void) SetLogEventMask(p); (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), "Initialize Magick"); /* Set the filesystem block size. */ { size_t block_size=16384; if ((p=getenv("MAGICK_IOBUF_SIZE")) != (const char *) NULL) block_size = (size_t) MagickAtoL(p); MagickSetFileSystemBlockSize(block_size); } /* Establish the path, filename, and display name of the client app */ InitializeMagickClientPathAndName(path); /* If the client name did not get setup for any reason, we take one last shot at it using the data the caller passed us. */ if (GetClientName() == (const char *) NULL) DefineClientName(path); /* Adjust minimum coder class if requested. */ if ((p=getenv("MAGICK_CODER_STABILITY")) != (const char *) NULL) { if (LocaleCompare(p,"UNSTABLE") == 0) MinimumCoderClass=UnstableCoderClass; else if (LocaleCompare(p,"STABLE") == 0) MinimumCoderClass=StableCoderClass; else if (LocaleCompare(p,"PRIMARY") == 0) MinimumCoderClass=PrimaryCoderClass; } InitializeMagickSignalHandlers(); /* Signal handlers */ InitializeTemporaryFiles(); /* Temporary files */ InitializeMagickResources(); /* Resources */ InitializeMagickRegistry(); /* Image/blob registry */ InitializeConstitute(); /* Constitute semaphore */ InitializeMagickInfoList(); /* Coder registrations + modules */ InitializeMagicInfo(); /* File format detection */ InitializeTypeInfo(); /* Font information */ InitializeDelegateInfo(); /* External delegate information */ InitializeColorInfo(); /* Color database */ MagickInitializeCommandInfo(); /* Command parser */ /* Let's log the three important setting as we exit this routine */ (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), "Path: \"%s\" Name: \"%s\" Filename: \"%s\"", GetClientPath(),GetClientName(),GetClientFilename()); }