From 69a09717ec7741d1bf42282d9f0f5254d9680b1f Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Mon, 1 May 2000 21:03:00 +0000 Subject: [PATCH] create proper defs for dbcar --- src/db/Makefile | 3 ++- src/db/dbCa.c | 12 ++++++++++++ src/db/{dbcar.c => dbCaTest.c} | 7 ++++--- src/db/dbCaTest.h | 29 +++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 4 deletions(-) rename src/db/{dbcar.c => dbCaTest.c} (97%) create mode 100644 src/db/dbCaTest.h diff --git a/src/db/Makefile b/src/db/Makefile index 09b2e5da0..ce01fb3c1 100644 --- a/src/db/Makefile +++ b/src/db/Makefile @@ -16,6 +16,7 @@ INC += dbLock.h INC += dbNotify.h INC += dbScan.h INC += dbTest.h +INC += dbCaTest.h INC += db_test.h INC += db_field_log.h INC += initHooks.h @@ -55,8 +56,8 @@ LIBSRCS += db_test.c LIBSRCS += recGbl.c LIBSRCS += callback.c LIBSRCS += dbCa.c +LIBSRCS += dbCaTest.c LIBSRCS += initHooks.c -LIBSRCS += dbcar.c LIBSRCS += cvtBpt.c LIBSRCS += dbServiceIO.cpp LIBSRCS += dbChannelIO.cpp diff --git a/src/db/dbCa.c b/src/db/dbCa.c index ea4e0ce0a..7ff0800eb 100644 --- a/src/db/dbCa.c +++ b/src/db/dbCa.c @@ -94,6 +94,7 @@ void epicsShareAPI dbCaAddLink( struct link *plink) { caLink *pca; +printf("dbCaAddLink called\n"); pca = (caLink*)dbCalloc(1,sizeof(caLink)); pca->plink = plink; plink->type = CA_LINK; @@ -616,12 +617,14 @@ void dbCaTask() semBinaryMustTake(caWakeupSem); while(TRUE) { /* process all requests in caList*/ semMutexMustTake(caListSem); +printf("dbCaTask semMutexMustTake returned\n"); if((pca = (caLink *)ellFirst(&caList))){/*Take off list head*/ ellDelete(&caList,&pca->node); link_action = pca->link_action; pca->link_action = 0; semMutexGive(caListSem); /*Give it back immediately*/ if(link_action&CA_DELETE) {/*This must be first*/ +printf("dbCaTask CA_DELETE\n"); if(pca->chid) ca_clear_channel(pca->chid); free(pca->pgetNative); free(pca->pputNative); @@ -633,6 +636,8 @@ void dbCaTask() continue; /*No other link_action makes sense*/ } if(link_action&CA_CONNECT) { +printf("dbCaTask CA_CONNECT\n"); +printf("dbCaTask calling ca_search_and_connect\n"); status = ca_search_and_connect( pca->plink->value.pv_link.pvname, &(pca->chid), @@ -642,6 +647,7 @@ void dbCaTask() ca_message(status)); continue; } +printf("dbCaTask calling ca_replace_access_rights_event\n"); status = ca_replace_access_rights_event(pca->chid, accessRightsCallback); if(status!=ECA_NORMAL) @@ -651,12 +657,14 @@ void dbCaTask() } if(ca_state(pca->chid) != cs_conn) continue; if(link_action&CA_WRITE_NATIVE) { +printf("dbCaTask calling ca_array_put\n"); status = ca_array_put( pca->dbrType,pca->nelements, pca->chid,pca->pputNative); if(status==ECA_NORMAL) pca->newOutNative = FALSE; } if(link_action&CA_WRITE_STRING) { +printf("dbCaTask calling ca_array_put\n"); status = ca_array_put( DBR_STRING,1, pca->chid,pca->pputString); @@ -667,17 +675,20 @@ void dbCaTask() element_size = dbr_value_size[ca_field_type(pca->chid)]; pca->pgetNative = dbCalloc(pca->nelements,element_size); +printf("dbCaTask CA_MONITOR_NATIVE calling ca_add_array_event\n"); status = ca_add_array_event( ca_field_type(pca->chid)+DBR_TIME_STRING, ca_element_count(pca->chid), pca->chid, eventCallback,pca,0.0,0.0,0.0, 0); +printf("dbCaTask returned from ca_add_array_event\n"); if(status!=ECA_NORMAL) epicsPrintf("dbCaTask ca_add_array_event %s\n", ca_message(status)); } if(link_action&CA_MONITOR_STRING) { pca->pgetString = dbCalloc(MAX_STRING_SIZE,sizeof(char)); +printf("dbCaTask calling ca_add_array_event\n"); status = ca_add_array_event(DBR_TIME_STRING,1, pca->chid, eventCallback,pca,0.0,0.0,0.0, 0); @@ -686,6 +697,7 @@ void dbCaTask() ca_message(status)); } if(link_action&CA_GET_ATTRIBUTES) { +printf("dbCaTask calling ca_get_callback\n"); status = ca_get_callback(DBR_CTRL_DOUBLE, pca->chid,getAttribEventCallback,pca); if(status!=ECA_NORMAL) diff --git a/src/db/dbcar.c b/src/db/dbCaTest.c similarity index 97% rename from src/db/dbcar.c rename to src/db/dbCaTest.c index eca82e178..2b8e19997 100644 --- a/src/db/dbcar.c +++ b/src/db/dbCaTest.c @@ -1,4 +1,4 @@ -/* dbcar.c */ +/* dbCaTest.c */ /***************************************************************** COPYRIGHT NOTIFICATION ***************************************************************** @@ -41,7 +41,6 @@ of this distribution. #include "dbDefs.h" #include "epicsPrint.h" #include "dbCommon.h" -#define epicsExportSharedSymbols /*define DB_CONVERT_GBLSOURCE because db_access.c does not include db_access.h*/ #define DB_CONVERT_GBLSOURCE @@ -49,8 +48,10 @@ of this distribution. #include "db_convert.h" #include "dbCaPvt.h" #include "dbCa.h" +#define epicsExportSharedSymbols +#include "dbCaTest.h" -long dbcar(char *precordname,int level) +long epicsShareAPI dbcar(char *precordname,int level) { DBENTRY dbentry; DBENTRY *pdbentry=&dbentry; diff --git a/src/db/dbCaTest.h b/src/db/dbCaTest.h new file mode 100644 index 000000000..0e562869c --- /dev/null +++ b/src/db/dbCaTest.h @@ -0,0 +1,29 @@ +/* dbCaTest.h */ + +/* Author: Marty Kraimer Date: 25FEB2000 */ +/***************************************************************** + COPYRIGHT NOTIFICATION +***************************************************************** + +(C) COPYRIGHT 1993 UNIVERSITY OF CHICAGO + +This software was developed under a United States Government license +described on the COPYRIGHT_UniversityOfChicago file included as part +of this distribution. +**********************************************************************/ +#ifndef INCdbTesth +#define INCdbTesth 1 + +#include "shareLib.h" + +#ifdef __cplusplus +extern "C" { +#endif + +epicsShareFunc long epicsShareAPI dbcar(char *recordname,int level); + +#ifdef __cplusplus +} +#endif + +#endif /*INCdbTesth */