fixed problem with win32 dll keywords and added new interface

This commit is contained in:
Jeff Hill
2000-03-21 23:55:03 +00:00
parent 23255f64a0
commit 7de7df7b58
2 changed files with 77 additions and 1 deletions

View File

@@ -55,6 +55,9 @@
#include "dbAccessDefs.h"
#include "recGbl.h"
#include "dbNotify.h"
#include "freeList.h"
static void *putNotifyFreeList;
/*NODE structure attached to ppnn field of each record in list*/
typedef struct pnWaitNode {
@@ -392,3 +395,68 @@ long dbtpn(char *pname,char *pvalue)
}
return(0);
}
#if 0
/*
* dbCreatePutNotify()
*/
epicsShareFunc long epicsShareAPI dbPutNotifyInitiate (
struct dbAddr *pAddr, unsigned type, unsigned long count, const void *pValue,
void (*callback)(void *), void *usrPvt, dbPutNotifyID *pID)
{
PUTNOTIFY *ppn;
long dbStatus;
if (!putNotifyFreeList) {
freeListInitPvt (&putNotifyFreeList, sizeof (PUTNOTIFY), 100);
if (!putNotifyFreeList) {
return S_db_noMemory;
}
}
if ( type > SHRT_MAX) {
return S_db_badDbrtype;
}
if ( count > LONG_MAX ) {
return S_db_errArg;
}
ppn = freeListCalloc (putNotifyFreeList);
if (!ppn) {
return S_db_noMemory;
}
ppn->paddr = pAddr;
ppn->pbuffer = pValue;
ppn->dbrType = (short) type; /* see range check above */
ppn->nRequest = (long) count; /* see range check above */
ppn->userCallback = callback;
ppn->usrPvt = usrPvt;
dbStatus = dbPutNotify (ppn);
if (dbStatus==S_db_Pending) {
*pID = (dbPutNotifyID) ppn;
}
else if (dbStatus==S_db_Blocked || status==0) {
free (ppn);
*pID = 0;
}
return dbStatus;
}
epicsShareFunc void epicsShareAPI dbPutNotifyDestroy (dbPutNotifyID idIn)
{
if (idIn==0) {
return;
}
else {
PUTNOTIFY *ppn = (PUTNOTIFY *) idIn;
dbNotifyCancel (ppn);
freeListFree (putNotifyFreeList, ppn)
}
}
#endif

View File

@@ -51,7 +51,7 @@ typedef struct putNotify{
void *waitForCallback;
}PUTNOTIFY;
int dbPutNotifyMapType (PUTNOTIFY *ppn, short oldtype);
epicsShareFunc int epicsShareAPI dbPutNotifyMapType (PUTNOTIFY *ppn, short oldtype);
/*dbNotifyAdd called by dbScanPassive and dbScanLink*/
epicsShareFunc void epicsShareAPI dbNotifyAdd(
@@ -62,4 +62,12 @@ epicsShareFunc void epicsShareAPI dbNotifyCompletion(struct dbCommon *precord);
epicsShareFunc long epicsShareAPI dbPutNotify(PUTNOTIFY *pputnotify);
typedef void * dbPutNotifyID;
epicsShareFunc long epicsShareAPI dbPutNotifyInitiate (
struct dbAddr *pAddr, unsigned type, unsigned long count, const void *pValue,
void (*callback)(void *), void *usrPvt, dbPutNotifyID *pID);
epicsShareFunc void epicsShareAPI dbPutNotifyDestroy (dbPutNotifyID idIn);
#endif /*INCdbNotifyh*/