comparison src/gpf3/ccd/ccddata_ccdptab.c @ 2:c41a534f33c6

src/gpf3: preened GPF goo from TCS3.2
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 25 Sep 2016 23:52:50 +0000
parents
children
comparison
equal deleted inserted replaced
1:864b8cc0cf63 2:c41a534f33c6
1 /*
2 +-----------------------------------------------------------------------------
3 | Project :
4 | Modul : ccddata_ccdptab.c
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : Ccddata abstraction for use in lib/dll. The four tables
18 | pvar, pcomp, pelem, and pmtx, genereraed by ccdgen
19 | (in ccdptab.cdg) are supplied. In addition, corresponding
20 | functions deliver specified elements of the tables. For
21 | pmtx the function must be used, because this three-dimesional
22 | array cannot be declared as extern without knowing the constants
23 | at compile time.
24 +-----------------------------------------------------------------------------
25 */
26
27 #include "typedefs.h"
28 #include "pconst.cdg"
29 #include "ccdtable.h"
30
31 static const T_CCD_VarTabEntry ccddata_pvar [] =
32 {
33 #include "pvar.cdg"
34 };
35
36 static const T_CCD_CompTabEntry ccddata_pcomp [] =
37 {
38 #include "pcomp.cdg"
39 };
40
41 static const T_CCD_ElemTabEntry ccddata_pelem [] =
42 {
43 #include "pelem.cdg"
44 };
45
46 static const USHORT ccddata_pmtx [MAX_PMTX_SIZE] =
47 {
48 #include "pmtxval.cdg"
49 };
50
51 const T_CCD_MTXIDX ccddata_pmtx_idx [] =
52 {
53 #include "pmtxidx.cdg"
54 };
55
56 const T_CCD_VarTabEntry* ccddata_get_pvar (USHORT idx)
57 {
58 return &ccddata_pvar[idx];
59 }
60
61 const T_CCD_CompTabEntry* ccddata_get_pcomp (USHORT idx)
62 {
63 return &ccddata_pcomp[idx];
64 }
65
66 const T_CCD_ElemTabEntry* ccddata_get_pelem (USHORT idx)
67 {
68 return &ccddata_pelem[idx];
69 }
70
71 USHORT ccddata_get_pmtx (USHORT sap, USHORT primid, USHORT index)
72 {
73 if ((sap > MAX_SAP_NUM) || (primid >= ccddata_pmtx_idx[sap].numitems))
74 return NO_REF;
75 return ccddata_pmtx[2*(ccddata_pmtx_idx[sap].idx + primid) + index];
76 }