home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 1.3 KB | 51 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: SLVersn.cpp
- // Release Version: $ ODF 2 $
- //
- // Author: Damon Cokenias
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef SLVERSN_H
- #include "SLVersn.h"
- #endif
-
- #ifndef FWCFMRES_H
- #include "FWCFMRes.h"
- #endif
-
- #ifndef FWRESACC_H
- #include "FWResAcc.h"
- #endif
-
- //----------------------------------------------------------------------------------------
- // FW_GetODFLibraryVersion
- //----------------------------------------------------------------------------------------
- FW_Version FW_GetODFLibraryVersion (Environment* ev)
- {
- static unsigned long gCachedVersion = 0;
-
- #ifdef FW_BUILD_MAC
-
- if (gCachedVersion) {
- return gCachedVersion;
- } else {
- FW_PSharedLibraryResourceFile odfLibResFile (ev);
- FW_PResource versResource (ev, odfLibResFile, 1, 'vers');
-
- FW_CAcquireResourceData versData (ev, versResource);
- FW_ASSERT (versData.GetSize () >= sizeof (unsigned long));
-
- // First 32 bits of 'vers' resource is the packed version number
- gCachedVersion = *((unsigned long*) versData.GetData ());
- return gCachedVersion;
- }
- #else
- // DTC -- We'll have to do the right thing for Windows here
- return 0;
- #endif
- }
-