1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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
|