aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/PalmOS/Src/init_mathlib.cpp
diff options
context:
space:
mode:
authorMax Horn2006-07-06 21:44:48 +0000
committerMax Horn2006-07-06 21:44:48 +0000
commit1d8d9f5510dc5f574e926bd6fadb9d20337daede (patch)
tree5cdcf6c8a233159776be9d90f3f39885222f65eb /backends/platform/PalmOS/Src/init_mathlib.cpp
parent9269ebe9f5a281f452594f1e8108e31c88a398fb (diff)
downloadscummvm-rg350-1d8d9f5510dc5f574e926bd6fadb9d20337daede.tar.gz
scummvm-rg350-1d8d9f5510dc5f574e926bd6fadb9d20337daede.tar.bz2
scummvm-rg350-1d8d9f5510dc5f574e926bd6fadb9d20337daede.zip
Moving remaining platform/backends code, as previously threatened
svn-id: r23380
Diffstat (limited to 'backends/platform/PalmOS/Src/init_mathlib.cpp')
-rw-r--r--backends/platform/PalmOS/Src/init_mathlib.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/backends/platform/PalmOS/Src/init_mathlib.cpp b/backends/platform/PalmOS/Src/init_mathlib.cpp
new file mode 100644
index 0000000000..88cf8a21f2
--- /dev/null
+++ b/backends/platform/PalmOS/Src/init_mathlib.cpp
@@ -0,0 +1,29 @@
+#include <PalmOS.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