diff options
author | Chris Apers | 2004-11-09 10:45:47 +0000 |
---|---|---|
committer | Chris Apers | 2004-11-09 10:45:47 +0000 |
commit | 618971dd2fbee8b075b7c888f3abdff8aba47897 (patch) | |
tree | 50350983581f5ba727b372d6dca7b611dcef3994 /backends/PalmOS/Src/init_mathlib.cpp | |
parent | 463544099832fd8af37b813afc7c3fffc96e78aa (diff) | |
download | scummvm-rg350-618971dd2fbee8b075b7c888f3abdff8aba47897.tar.gz scummvm-rg350-618971dd2fbee8b075b7c888f3abdff8aba47897.tar.bz2 scummvm-rg350-618971dd2fbee8b075b7c888f3abdff8aba47897.zip |
Gathered common functions into new source files
svn-id: r15743
Diffstat (limited to 'backends/PalmOS/Src/init_mathlib.cpp')
-rw-r--r-- | backends/PalmOS/Src/init_mathlib.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/backends/PalmOS/Src/init_mathlib.cpp b/backends/PalmOS/Src/init_mathlib.cpp new file mode 100644 index 0000000000..6fd4931236 --- /dev/null +++ b/backends/PalmOS/Src/init_mathlib.cpp @@ -0,0 +1,30 @@ +#include <PalmOS.h> +#include "enginersc.h" + +#include "globals.h" +#include "init_mathlib.h" +#include "mathlib.h" + +Err MathlibInit() { + Err e; + + if ((e = SysLibFind(MathLibName, &MathLibRef))) + if (e == sysErrLibNotFound) // couldn't find lib + e = SysLibLoad(LibType, MathLibCreator, &MathLibRef); + + if (e) return sysErrLibNotFound; + + e = MathLibOpen(MathLibRef, MathLibVersion); + return e; +} + +void MathlibRelease() { + UInt16 useCount; + + if (MathLibRef != sysInvalidRefNum) { + MathLibClose(MathLibRef, &useCount); + + if (!useCount) + SysLibRemove(MathLibRef); + } +}
\ No newline at end of file |