Skip to content

Commit

Permalink
type asTrapWriteBeforeWithData() and asTrapWriteAfterWrite()
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Apr 15, 2024
1 parent ae28175 commit 6379fa3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions modules/database/src/ioc/rsrv/camessage.c
Expand Up @@ -88,7 +88,7 @@ typedef struct rsrv_put_notify {
long nRequest;
short dbrType;
/* end arguments for db_put_field */
void * asWritePvt;
asTrapWrite * asWritePvt;
unsigned valueSize; /* size of block pointed to by pbuffer */
char busy; /* put notify in progress */
char onExtraLaborQueue;
Expand Down Expand Up @@ -756,7 +756,7 @@ static int write_action ( caHdrLargeArray *mp,
struct channel_in_use *pciu;
int status;
long dbStatus;
void *asWritePvt;
asTrapWrite *asWritePvt;

pciu = MPTOPCIU(mp);
if(!pciu){
Expand Down
12 changes: 10 additions & 2 deletions modules/libcom/src/as/asLib.h
Expand Up @@ -122,11 +122,19 @@ LIBCOM_API int epicsStdCall asDumpMemFP(FILE *fp,const char *asgname,
LIBCOM_API int epicsStdCall asDumpHash(void);
LIBCOM_API int epicsStdCall asDumpHashFP(FILE *fp);

LIBCOM_API void * epicsStdCall asTrapWriteBeforeWithData(
/** \brief Handle for in progress asTrapWrite
*
* Returned by asTrapWriteBeforeWithData(), must be passed to asTrapWriteAfterWrite()
*
* \since UNRELEASED Previously was void
*/
typedef struct asTrapWrite asTrapWrite;

LIBCOM_API struct asTrapWrite * epicsStdCall asTrapWriteBeforeWithData(
const char *userid, const char *hostid, struct dbChannel *addr,
int dbrType, int no_elements, void *data);

LIBCOM_API void epicsStdCall asTrapWriteAfterWrite(void *pvt);
LIBCOM_API void epicsStdCall asTrapWriteAfterWrite(struct asTrapWrite *pvt);

#define S_asLib_clientsExist (M_asLib| 1) /*Client Exists*/
#define S_asLib_noUag (M_asLib| 2) /*User Access Group does not exist*/
Expand Down
7 changes: 3 additions & 4 deletions modules/libcom/src/as/asTrapWrite.c
Expand Up @@ -44,7 +44,7 @@ typedef struct asTrapListener{
void *pvt2;
}listener;

typedef struct writeMessage {
typedef struct asTrapWrite {
ELLNODE node;
asTrapWriteMessage message;
ELLLIST listenerPvtList;
Expand Down Expand Up @@ -141,7 +141,7 @@ void asTrapCallListener(const listener *plistener, asTrapWriteMessage* msg, int
(*plistener->func2)(plistener->pvt2, msg, after);
}

void * epicsStdCall asTrapWriteBeforeWithData(
struct asTrapWrite * epicsStdCall asTrapWriteBeforeWithData(
const char *userid, const char *hostid, struct dbChannel *addr,
int dbrType, int no_elements, void *data)
{
Expand Down Expand Up @@ -179,9 +179,8 @@ void * epicsStdCall asTrapWriteBeforeWithData(
return pwriteMessage;
}

void epicsStdCall asTrapWriteAfterWrite(void *pvt)
void epicsStdCall asTrapWriteAfterWrite(writeMessage *pwriteMessage)
{
writeMessage *pwriteMessage = (writeMessage *)pvt;
listenerPvt *plistenerPvt;

if (pwriteMessage == 0 ||
Expand Down

0 comments on commit 6379fa3

Please sign in to comment.