EPICS Base  7.0.6.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
db_convert.h
1 /*************************************************************************\
2 * Copyright (c) 2002 The University of Chicago, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * SPDX-License-Identifier: EPICS
7 * EPICS Base is distributed subject to a Software License Agreement found
8 * in file LICENSE that is included with this distribution.
9 \*************************************************************************/
10 /* db_convert.h */
11 
12 #ifndef INCLdb_converth
13 #define INCLdb_converth
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 #include "dbCoreAPI.h"
20 #include "dbAddr.h"
21 
22 DBCORE_API extern struct dbBase *pdbbase;
23 DBCORE_API extern volatile int interruptAccept;
24 
25 /*Definitions that allow old database access to use new conversion routines*/
26 #define newDBF_DEVICE 13
27 #define newDBR_ENUM 11
28 DBCORE_API extern long (*dbGetConvertRoutine[newDBF_DEVICE+1][newDBR_ENUM+1])
29  (struct dbAddr *paddr, void *pbuffer,long nRequest,
30  long no_elements, long offset);
31 DBCORE_API extern long (*dbPutConvertRoutine[newDBR_ENUM+1][newDBF_DEVICE+1])
32  (struct dbAddr *paddr, const void *pbuffer,long nRequest,
33  long no_elements, long offset);
34 DBCORE_API extern long (*dbFastGetConvertRoutine[newDBF_DEVICE+1][newDBR_ENUM+1])
35  (const void *from, void *to, dbAddr *paddr);
36 DBCORE_API extern long (*dbFastPutConvertRoutine[newDBR_ENUM+1][newDBF_DEVICE+1])
37  (const void *from, void *to, dbAddr *paddr);
38 
39 /*Conversion between old and new DBR types*/
40 DBCORE_API extern unsigned short dbDBRoldToDBFnew[DBR_DOUBLE+1];
41 DBCORE_API extern unsigned short dbDBRnewToDBRold[newDBR_ENUM+1];
42 #ifdef DB_CONVERT_GBLSOURCE
43 unsigned short dbDBRoldToDBFnew[DBR_DOUBLE+1] = {
44  0, /*DBR_STRING to DBF_STRING*/
45  3, /*DBR_INT to DBF_SHORT*/
46  9, /*DBR_FLOAT to DBF_FLOAT*/
47  11, /*DBR_ENUM to DBF_ENUM*/
48  1, /*DBR_CHAR to DBF_CHAR*/
49  5, /*DBR_LONG to DBF_LONG*/
50  10 /*DBR_DOUBLE to DBF_DOUBLE*/
51 };
52 unsigned short dbDBRnewToDBRold[newDBR_ENUM+1] = {
53  0, /*DBR_STRING to DBR_STRING*/
54  4, /*DBR_CHAR to DBR_CHAR*/
55  4, /*DBR_UCHAR to DBR_CHAR*/
56  1, /*DBR_SHORT to DBR_SHORT*/
57  5, /*DBR_USHORT to DBR_LONG*/
58  5, /*DBR_LONG to DBR_LONG*/
59  6, /*DBR_ULONG to DBR_DOUBLE*/
60  6, /*DBR_INT64 to DBR_DOUBLE*/
61  6, /*DBR_UINT64 to DBR_DOUBLE*/
62  2, /*DBR_FLOAT to DBR_FLOAT*/
63  6, /*DBR_DOUBLE to DBR_DOUBLE*/
64  3, /*DBR_ENUM to DBR_ENUM*/
65 };
66 #endif /*DB_CONVERT_GBLSOURCE*/
67 
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif /* INCLdb_converth */
Definition: dbAddr.h:17
Definition: dbBase.h:171