aboutsummaryrefslogtreecommitdiff
path: root/backends/PalmOS/Src/init_mathlib.cpp
diff options
context:
space:
mode:
authorChris Apers2004-11-09 10:45:47 +0000
committerChris Apers2004-11-09 10:45:47 +0000
commit618971dd2fbee8b075b7c888f3abdff8aba47897 (patch)
tree50350983581f5ba727b372d6dca7b611dcef3994 /backends/PalmOS/Src/init_mathlib.cpp
parent463544099832fd8af37b813afc7c3fffc96e78aa (diff)
downloadscummvm-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.cpp30
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