dbNotify API changes

This commit is contained in:
Marty Kraimer
2002-03-07 17:04:43 +00:00
parent bafb0a76ee
commit 14184c679f
4 changed files with 9 additions and 45 deletions
+3 -17
View File
@@ -34,9 +34,6 @@
#include "dbChannelIOIL.h"
#include "dbNotifyBlockerIL.h"
#define S_db_Blocked (M_dbAccess|39)
#define S_db_Pending (M_dbAccess|37)
#if defined ( _MSC_VER )
# pragma warning ( push )
# pragma warning ( disable: 4660 )
@@ -80,8 +77,8 @@ extern "C" void putNotifyCompletion ( putNotify *ppn )
{
dbPutNotifyBlocker *pBlocker = static_cast < dbPutNotifyBlocker * > ( ppn->usrPvt );
if ( pBlocker->pNotify ) {
if ( pBlocker->pn.status ) {
if ( pBlocker->pn.status == S_db_Blocked ) {
if ( pBlocker->pn.status != putNotifyOK) {
if ( pBlocker->pn.status == putNotifyBlocked ) {
pBlocker->pNotify->exception (
ECA_PUTCBINPROG, "put notify blocked",
static_cast <unsigned> (pBlocker->pn.dbrType),
@@ -156,18 +153,7 @@ void dbPutNotifyBlocker::initiatePutNotify ( epicsAutoMutex & locker, cacWriteNo
this->pn.userCallback = putNotifyCompletion;
this->pn.usrPvt = this;
status = ::dbPutNotify ( &this->pn );
if ( status && status != S_db_Pending ) {
memset ( &this->pn, '\0', sizeof ( this->pn ) );
this->pNotify = 0;
{
epicsAutoMutexRelease autoRelease ( locker );
notify.exception (
ECA_PUTFAIL, "dbPutNotify() returned failure",
static_cast <unsigned> (this->pn.dbrType),
static_cast <unsigned> (this->pn.nRequest) );
}
}
::dbPutNotify ( &this->pn );
}
void dbPutNotifyBlocker::show ( unsigned level ) const
+3 -6
View File
@@ -657,7 +657,7 @@ static void print_returned(type,pbuffer,count)
static void tpnCallback(putNotify *ppn)
{
struct dbAddr *pdbaddr = (struct dbAddr *)ppn->paddr;
long status = ppn->status;
putNotifyStatus status = ppn->status;
char *pname;
/*This is really cheating. It only works because first field is name*/
@@ -665,7 +665,7 @@ static void tpnCallback(putNotify *ppn)
if(status==0)
printf("tpnCallback: success record=%s\n",pname);
else
errPrintf(status,__FILE__,__LINE__,"%s tpnCallback\n",pname);
errlogPrintf("%s tpnCallback status = %d\n",status);
free((void *)pdbaddr);
free(ppn);
}
@@ -707,9 +707,6 @@ int epicsShareAPI tpn(char *pname,char *pvalue)
return(-1);
}
ppn->userCallback = tpnCallback;
status = dbPutNotify(ppn);
if(status) {
errMessage(status, "tpn");
}
dbPutNotify(ppn);
return(0);
}
+3 -12
View File
@@ -1442,8 +1442,8 @@ void write_notify_reply(void *pArg)
* the channel id field is being abused to carry
* status here
*/
if(ppnb->dbPutNotify.status){
if(ppnb->dbPutNotify.status == S_db_Blocked){
if(ppnb->dbPutNotify.status != putNotifyOK){
if(ppnb->dbPutNotify.status == putNotifyBlocked){
status = ECA_PUTCBINPROG;
}
else{
@@ -1600,16 +1600,7 @@ LOCAL int write_notify_action ( caHdrLargeArray *mp, void *pPayload,
return RSRV_OK;
}
status = dbPutNotify(&pciu->pPutNotify->dbPutNotify);
if(status && status != S_db_Pending){
/*
* let the call back take care of failure
* even if it is immediate
*/
pciu->pPutNotify->dbPutNotify.status = status;
(*pciu->pPutNotify->dbPutNotify.userCallback)
(&pciu->pPutNotify->dbPutNotify);
}
dbPutNotify(&pciu->pPutNotify->dbPutNotify);
return RSRV_OK;
}
-10
View File
@@ -226,14 +226,4 @@ int cas_copy_in_header (
void cas_set_header_cid ( struct client *pClient, ca_uint32_t );
void cas_commit_msg ( struct client *pClient, ca_uint32_t size );
/*
* !!KLUDGE!!
*
* this was extracted from dbAccess.h because we are unable
* to include both dbAccess.h and db_access.h at the
* same time.
*/
#define S_db_Blocked (M_dbAccess|39) /*Request is Blocked*/
#define S_db_Pending (M_dbAccess|37) /*Request is pending*/
#endif /*INCLserverh*/