summaryrefslogtreecommitdiffstats
path: root/sources/location.cpp
diff options
context:
space:
mode:
authorAngelo Rossi <angelo.rossi.homelab@gmail.com>2023-06-21 12:04:16 +0000
committerAngelo Rossi <angelo.rossi.homelab@gmail.com>2023-06-21 12:04:16 +0000
commitb18347ffc9db9641e215995edea1c04c363b2bdf (patch)
treef3908dc911399f1a21e17d950355ee56dc0919ee /sources/location.cpp
Initial commit.
Diffstat (limited to 'sources/location.cpp')
-rw-r--r--sources/location.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/sources/location.cpp b/sources/location.cpp
new file mode 100644
index 0000000..3d13e38
--- /dev/null
+++ b/sources/location.cpp
@@ -0,0 +1,65 @@
+//-*- mode: c++; indent-tabs-mode: t; coding: utf-8; show-trailing-whitespace: t -*-
+
+// file location.cpp
+
+#include "location.hpp"
+
+namespace location {
+
+ std::vector<size_t> sLocate = std::vector<size_t> ({
+ reinterpret_cast<size_t>(&blkcom::sBus1),
+ reinterpret_cast<size_t>(&blkcom::sBus2),
+ reinterpret_cast<size_t>(&blkcom::sBus3),
+ reinterpret_cast<size_t>(&blkcom::sBus4),
+ reinterpret_cast<size_t>(&blkcom::sBus5),
+ reinterpret_cast<size_t>(&blkcom::sBus6),
+ reinterpret_cast<size_t>(&blkcom::sTrash),
+ reinterpret_cast<size_t>(&blkcom::sBlank),
+ reinterpret_cast<size_t>(&blkcom::sTerra),
+ reinterpret_cast<size_t>(&blkcom::sUserID),
+ reinterpret_cast<size_t>(&blkcom::sBranch),
+ reinterpret_cast<size_t>(&blkcom::sChCopy),
+ reinterpret_cast<size_t>(&blkcom::cCSepar),
+ reinterpret_cast<size_t>(&blkcom::sChCont),
+ reinterpret_cast<size_t>(&blkcom::sTexCol),
+ reinterpret_cast<size_t>(&blkcom::pTextA6[ 0 ]),
+ reinterpret_cast<size_t>(&blkcom::pDate1[ 0 ]),
+ reinterpret_cast<size_t>(&blkcom::pTClock[ 0 ]),
+ // To be continued
+ });
+
+ void locatn(void)
+ {
+ //
+ }
+
+ //
+
+ template <> size_t index<char>(char *a)
+ {
+ return ((size_t) &a[ 0 ] / sizeof(char));
+ }
+
+ template <> size_t index<int>(int *a)
+ {
+ return ((size_t) &a[ 0 ] / sizeof(int));
+ }
+
+ template <> size_t index<long int>(long int *a)
+ {
+ return ((size_t) &a[ 0 ] / sizeof(long int));
+ }
+
+ template <> size_t index<double>(double *a)
+ {
+ return ((size_t) &a[ 0 ] / sizeof(double));
+ }
+
+ template <> size_t index<std::string>(std::string *a)
+ {
+ return index((char *) a -> c_str());
+ }
+
+}
+
+// end of file location.cpp