split db_access.h so ca not dependent on db
This commit is contained in:
+4
-1
@@ -16,11 +16,14 @@ INC += dbLock.h
|
||||
INC += dbNotify.h
|
||||
INC += dbScan.h
|
||||
INC += dbTest.h
|
||||
INC += db_access.h
|
||||
INC += db_test.h
|
||||
INC += db_field_log.h
|
||||
INC += initHooks.h
|
||||
INC += recGbl.h
|
||||
# The following go away what old database access goes away
|
||||
INC += db_access.h
|
||||
INC += db_access_routines.h
|
||||
INC += db_convert.h
|
||||
|
||||
MENUS += menuAlarmSevr.h
|
||||
MENUS += menuAlarmStat.h
|
||||
|
||||
@@ -22,14 +22,4 @@ typedef struct dbAddr{
|
||||
/*DBR_STRING,...,DBR_ENUM,DBR_NOACCESS*/
|
||||
}DBADDR;
|
||||
|
||||
/*
|
||||
* old db access API
|
||||
* (included here because these routines use dbAccess.h and their
|
||||
* prototypes must also be included in db_access.h)
|
||||
*/
|
||||
epicsShareFunc int epicsShareAPI db_name_to_addr(const char *pname, DBADDR *paddr);
|
||||
epicsShareFunc int epicsShareAPI db_put_field(DBADDR *paddr, int src_type,
|
||||
const void *psrc, int no_elements);
|
||||
epicsShareFunc int epicsShareAPI db_get_field(DBADDR *paddr, int dest_type,
|
||||
void *pdest, int no_elements, void *pfl);
|
||||
#endif /* dbAddrh */
|
||||
|
||||
+3
-1
@@ -41,11 +41,13 @@ of this distribution.
|
||||
#include "epicsPrint.h"
|
||||
#include "dbCommon.h"
|
||||
#include "cadef.h"
|
||||
#include "db_access.h"
|
||||
#include "caerr.h"
|
||||
/*following because we cant include dbStaticLib.h*/
|
||||
epicsShareFunc void * epicsShareAPI dbCalloc(size_t nobj,size_t size);
|
||||
#define epicsExportSharedSymbols
|
||||
#include "db_access.h"
|
||||
#include "db_access_routines.h"
|
||||
#include "db_convert.h"
|
||||
#include "dbScan.h"
|
||||
#include "dbCa.h"
|
||||
#include "dbCaPvt.h"
|
||||
|
||||
+1
-1
@@ -61,9 +61,9 @@
|
||||
#include "recSup.h"
|
||||
#include "alarm.h"
|
||||
#define epicsExportSharedSymbols
|
||||
#include "dbAddr.h"
|
||||
#include "dbNotify.h"
|
||||
#include "dbAccessDefs.h"
|
||||
#include "db_access_routines.h"
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
|
||||
+18
-82
@@ -1,34 +1,24 @@
|
||||
/* base/include/db_access.h */
|
||||
/* $Id$
|
||||
/* $Id$ */
|
||||
|
||||
/* Author: Bob Dalesio
|
||||
* Date: 4-4-88
|
||||
*/
|
||||
|
||||
/*
|
||||
* Author: Bob Dalesio
|
||||
* Date: 4-4-88
|
||||
*
|
||||
* Experimental Physics and Industrial Control System (EPICS)
|
||||
*
|
||||
* Copyright 1991, the Regents of the University of California,
|
||||
* and the University of Chicago Board of Governors.
|
||||
*
|
||||
* This software was produced under U.S. Government contracts:
|
||||
* (W-7405-ENG-36) at the Los Alamos National Laboratory,
|
||||
* and (W-31-109-ENG-38) at Argonne National Laboratory.
|
||||
*
|
||||
* Initial development by:
|
||||
* The Controls and Automation Group (AT-8)
|
||||
* Ground Test Accelerator
|
||||
* Accelerator Technology Division
|
||||
* Los Alamos National Laboratory
|
||||
*
|
||||
* Co-developed with
|
||||
* The Controls and Computing Group
|
||||
* Accelerator Systems Division
|
||||
* Advanced Photon Source
|
||||
* Argonne National Laboratory
|
||||
*
|
||||
*
|
||||
* Modification Log:
|
||||
/*****************************************************************
|
||||
COPYRIGHT NOTIFICATION
|
||||
*****************************************************************
|
||||
|
||||
(C) COPYRIGHT 1991 Regents of the University of California,
|
||||
and the University of Chicago Board of Governors.
|
||||
|
||||
This software was developed under a United States Government license
|
||||
described on the COPYRIGHT_Combined file included as part
|
||||
of this distribution.
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
/* Modification Log:
|
||||
* -----------------
|
||||
* .01 05-02-88 lrd add control enumeration field, structure & size
|
||||
* .02 05-12-88 lrd add array structures
|
||||
@@ -89,9 +79,6 @@
|
||||
#ifndef INCLdb_accessh
|
||||
#define INCLdb_accessh
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -99,10 +86,6 @@ extern "C" {
|
||||
#include "epicsTypes.h"
|
||||
#include "tsStamp.h"
|
||||
#include "ellLib.h"
|
||||
#include "dbAddr.h"
|
||||
|
||||
epicsShareExtern struct dbBase *pdbbase;
|
||||
epicsShareExtern volatile int interruptAccept;
|
||||
|
||||
|
||||
#define MAX_UNITS_SIZE 8
|
||||
@@ -212,45 +195,6 @@ epicsShareDef READONLY int epicsTypeToDBR_XXXX [lastEpicsType+1] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
/*Definitions that allow old database access to use new conversion routines*/
|
||||
#define newDBF_DEVICE 11
|
||||
#define newDBR_ENUM 9
|
||||
epicsShareExtern long (*dbGetConvertRoutine[newDBF_DEVICE+1][newDBR_ENUM+1])
|
||||
(struct dbAddr *paddr, void *pbuffer,long nRequest,
|
||||
long no_elements, long offset);
|
||||
epicsShareExtern long (*dbPutConvertRoutine[newDBR_ENUM+1][newDBF_DEVICE+1])
|
||||
(struct dbAddr *paddr, void *pbuffer,long nRequest,
|
||||
long no_elements, long offset);
|
||||
epicsShareExtern long (*dbFastGetConvertRoutine[newDBF_DEVICE+1][newDBR_ENUM+1])();
|
||||
epicsShareExtern long (*dbFastPutConvertRoutine[newDBR_ENUM+1][newDBF_DEVICE+1])();
|
||||
|
||||
/*Conversion between old and new DBR types*/
|
||||
epicsShareExtern unsigned short dbDBRoldToDBFnew[DBR_DOUBLE+1];
|
||||
epicsShareExtern unsigned short dbDBRnewToDBRold[newDBR_ENUM+1];
|
||||
#ifdef DB_TEXT_GLBLSOURCE
|
||||
epicsShareDef unsigned short dbDBRoldToDBFnew[DBR_DOUBLE+1] = {
|
||||
0, /*DBR_STRING to DBF_STRING*/
|
||||
3, /*DBR_INT to DBF_SHORT*/
|
||||
7, /*DBR_FLOAT to DBF_FLOAT*/
|
||||
9, /*DBR_ENUM to DBF_ENUM*/
|
||||
1, /*DBR_CHAR to DBF_CHAR*/
|
||||
5, /*DBR_LONG to DBF_LONG*/
|
||||
8 /*DBR_DOUBLE to DBF_DOUBLE*/
|
||||
};
|
||||
epicsShareDef unsigned short dbDBRnewToDBRold[newDBR_ENUM+1] = {
|
||||
0, /*DBR_STRING to DBR_STRING*/
|
||||
4, /*DBR_CHAR to DBR_CHAR*/
|
||||
4, /*DBR_UCHAR to DBR_CHAR*/
|
||||
1, /*DBR_SHORT to DBR_SHORT*/
|
||||
5, /*DBR_USHORT to DBR_LONG*/
|
||||
5, /*DBR_LONG to DBR_LONG*/
|
||||
6, /*DBR_ULONG to DBR_DOUBLE*/
|
||||
2, /*DBR_FLOAT to DBR_FLOAT*/
|
||||
6, /*DBR_DOUBLE to DBR_DOUBLE*/
|
||||
3, /*DBR_ENUM to DBR_ENUM*/
|
||||
};
|
||||
#endif /*DB_TEXT_GLBLSOURCE*/
|
||||
|
||||
/*
|
||||
* The DBR_XXXX types are indicies into this array
|
||||
*/
|
||||
@@ -305,10 +249,6 @@ epicsShareDef READONLY epicsType DBR_XXXXToEpicsType [LAST_BUFFER_TYPE+1] = {
|
||||
epicsShareExtern READONLY epicsType DBR_XXXXToEpicsType [LAST_BUFFER_TYPE+1];
|
||||
#endif
|
||||
|
||||
/* extra processing flags */
|
||||
#define EP_SCAN 0x01
|
||||
#define EP_INIT 0x02
|
||||
#define EP_CALC 0x03
|
||||
|
||||
/* values returned for each field type
|
||||
* DBR_STRING returns a NULL terminated string
|
||||
@@ -1153,8 +1093,4 @@ union db_access_val{
|
||||
epicsShareDef READONLY short dbr_text_dim = (sizeof dbr_text)/(sizeof (char *)) + 1;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* INCLdb_accessh */
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/* base/include/db_access_routines.h */
|
||||
|
||||
/*****************************************************************
|
||||
COPYRIGHT NOTIFICATION
|
||||
*****************************************************************
|
||||
|
||||
(C) COPYRIGHT 1991 Regents of the University of California,
|
||||
and the University of Chicago Board of Governors.
|
||||
|
||||
This software was developed under a United States Government license
|
||||
described on the COPYRIGHT_Combined file included as part
|
||||
of this distribution.
|
||||
**********************************************************************/
|
||||
|
||||
/* This defined routines for old database access. These were broken out of
|
||||
db_access.h so that ca can be build independent of db.
|
||||
src/ca contains db_access, which contains that data definitions
|
||||
*/
|
||||
|
||||
#ifndef INCLdb_access_routinesh
|
||||
#define INCLdb_access_routinesh
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "dbAddr.h"
|
||||
|
||||
epicsShareExtern struct dbBase *pdbbase;
|
||||
epicsShareExtern volatile int interruptAccept;
|
||||
|
||||
|
||||
/*
|
||||
* old db access API
|
||||
* (included here because these routines use dbAccess.h and their
|
||||
* prototypes must also be included in db_access.h)
|
||||
*/
|
||||
epicsShareFunc int epicsShareAPI db_name_to_addr(
|
||||
const char *pname, DBADDR *paddr);
|
||||
epicsShareFunc int epicsShareAPI db_put_field(
|
||||
DBADDR *paddr, int src_type,const void *psrc, int no_elements);
|
||||
epicsShareFunc int epicsShareAPI db_get_field(
|
||||
DBADDR *paddr, int dest_type,void *pdest, int no_elements, void *pfl);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* INCLdb_access_routinesh */
|
||||
@@ -0,0 +1,72 @@
|
||||
/* db_convert.h */
|
||||
|
||||
/*****************************************************************
|
||||
COPYRIGHT NOTIFICATION
|
||||
*****************************************************************
|
||||
|
||||
(C) COPYRIGHT 1991 Regents of the University of California,
|
||||
and the University of Chicago Board of Governors.
|
||||
|
||||
This software was developed under a United States Government license
|
||||
described on the COPYRIGHT_Combined file included as part
|
||||
of this distribution.
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#ifndef INCLdb_converth
|
||||
#define INCLdb_converth
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "dbAddr.h"
|
||||
|
||||
epicsShareExtern struct dbBase *pdbbase;
|
||||
epicsShareExtern volatile int interruptAccept;
|
||||
|
||||
/*Definitions that allow old database access to use new conversion routines*/
|
||||
#define newDBF_DEVICE 11
|
||||
#define newDBR_ENUM 9
|
||||
epicsShareExtern long (*dbGetConvertRoutine[newDBF_DEVICE+1][newDBR_ENUM+1])
|
||||
(struct dbAddr *paddr, void *pbuffer,long nRequest,
|
||||
long no_elements, long offset);
|
||||
epicsShareExtern long (*dbPutConvertRoutine[newDBR_ENUM+1][newDBF_DEVICE+1])
|
||||
(struct dbAddr *paddr, void *pbuffer,long nRequest,
|
||||
long no_elements, long offset);
|
||||
epicsShareExtern long (*dbFastGetConvertRoutine[newDBF_DEVICE+1][newDBR_ENUM+1])();
|
||||
epicsShareExtern long (*dbFastPutConvertRoutine[newDBR_ENUM+1][newDBF_DEVICE+1])();
|
||||
|
||||
/*Conversion between old and new DBR types*/
|
||||
epicsShareExtern unsigned short dbDBRoldToDBFnew[DBR_DOUBLE+1];
|
||||
epicsShareExtern unsigned short dbDBRnewToDBRold[newDBR_ENUM+1];
|
||||
#ifdef DB_CONVERT_GBLSOURCE
|
||||
epicsShareDef unsigned short dbDBRoldToDBFnew[DBR_DOUBLE+1] = {
|
||||
0, /*DBR_STRING to DBF_STRING*/
|
||||
3, /*DBR_INT to DBF_SHORT*/
|
||||
7, /*DBR_FLOAT to DBF_FLOAT*/
|
||||
9, /*DBR_ENUM to DBF_ENUM*/
|
||||
1, /*DBR_CHAR to DBF_CHAR*/
|
||||
5, /*DBR_LONG to DBF_LONG*/
|
||||
8 /*DBR_DOUBLE to DBF_DOUBLE*/
|
||||
};
|
||||
epicsShareDef unsigned short dbDBRnewToDBRold[newDBR_ENUM+1] = {
|
||||
0, /*DBR_STRING to DBR_STRING*/
|
||||
4, /*DBR_CHAR to DBR_CHAR*/
|
||||
4, /*DBR_UCHAR to DBR_CHAR*/
|
||||
1, /*DBR_SHORT to DBR_SHORT*/
|
||||
5, /*DBR_USHORT to DBR_LONG*/
|
||||
5, /*DBR_LONG to DBR_LONG*/
|
||||
6, /*DBR_ULONG to DBR_DOUBLE*/
|
||||
2, /*DBR_FLOAT to DBR_FLOAT*/
|
||||
6, /*DBR_DOUBLE to DBR_DOUBLE*/
|
||||
3, /*DBR_ENUM to DBR_ENUM*/
|
||||
};
|
||||
#endif /*DB_CONVERT_GBLSOURCE*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* INCLdb_converth */
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "errlog.h"
|
||||
#define epicsExportSharedSymbols
|
||||
#include "db_access.h"
|
||||
#include "db_access_routines.h"
|
||||
#include "dbNotify.h"
|
||||
|
||||
|
||||
|
||||
+8
-2
@@ -37,14 +37,20 @@ of this distribution.
|
||||
#undef INVALID_DB_REQ
|
||||
/*end of conflicting definitions*/
|
||||
#include "cadef.h"
|
||||
#include "db_access.h"
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "dbCommon.h"
|
||||
#include "shareLib.h"
|
||||
#define epicsExportSharedSymbols
|
||||
/*define DB_TEXT_GLBLSOURCE because db_access.d does not include db_access.h*/
|
||||
|
||||
/*define DB_TEXT_GLBLSOURCE temporily; ca will do this later */
|
||||
#define DB_TEXT_GLBLSOURCE
|
||||
#include "db_access.h"
|
||||
|
||||
/*define DB_CONVERT_GBLSOURCE because db_access.c does not include db_access.h*/
|
||||
#define DB_CONVERT_GBLSOURCE
|
||||
#include "db_access_routines.h"
|
||||
#include "db_convert.h"
|
||||
#include "dbCaPvt.h"
|
||||
#include "dbCa.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user