Skip to content

Commit

Permalink
Add typing to dbEvent.h opaque structs when -DUSE_TYPED_DBEVENT
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Dec 22, 2023
1 parent 8998341 commit 0463e82
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 3 deletions.
2 changes: 2 additions & 0 deletions modules/database/src/ioc/db/dbChannelIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* 505 665 1831
*/

#define USE_TYPED_DBEVENT

#include <string>
#include <stdexcept>

Expand Down
2 changes: 2 additions & 0 deletions modules/database/src/ioc/db/dbContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* 505 665 1831
*/

#define USE_TYPED_DBEVENT

#include <limits.h>

#include "epicsMutex.h"
Expand Down
2 changes: 2 additions & 0 deletions modules/database/src/ioc/db/dbContextReadNotifyCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* Author Jeff Hill
*/

#define USE_TYPED_DBEVENT

#include <stdlib.h>

#include "epicsMutex.h"
Expand Down
2 changes: 2 additions & 0 deletions modules/database/src/ioc/db/dbEvent.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
*/

#define EPICS_PRIVATE_API
#define USE_TYPED_DBEVENT

#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
Expand Down
12 changes: 9 additions & 3 deletions modules/database/src/ioc/db/dbEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,22 @@ struct dbChannel;
struct db_field_log;
struct evSubscrip;

#ifdef USE_TYPED_DBEVENT
struct dbEventContext; // use dbEventCtx
typedef struct evSubscrip* dbEventSubscription;
typedef struct dbEventContext* dbEventCtx;
#else
typedef void * dbEventSubscription;
typedef void * dbEventCtx;
#endif

DBCORE_API int db_event_list (
const char *name, unsigned level);
DBCORE_API int dbel (
const char *name, unsigned level);
DBCORE_API int db_post_events (
void *pRecord, void *pField, unsigned caEventMask );

typedef void * dbEventCtx;

typedef void EXTRALABORFUNC (void *extralabor_arg);
DBCORE_API dbEventCtx db_init_events (void);
DBCORE_API int db_start_events (
Expand All @@ -63,7 +70,6 @@ DBCORE_API void db_init_event_freelists (void);
typedef void EVENTFUNC (void *user_arg, struct dbChannel *chan,
int eventsRemaining, struct db_field_log *pfl);

typedef void * dbEventSubscription;
DBCORE_API dbEventSubscription db_add_event (
dbEventCtx ctx, struct dbChannel *chan,
EVENTFUNC *user_sub, void *user_arg, unsigned select);
Expand Down
2 changes: 2 additions & 0 deletions modules/database/src/ioc/db/dbPutNotifyBlocker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* 505 665 1831
*/

#define USE_TYPED_DBEVENT

#include <string>
#include <stdexcept>

Expand Down
2 changes: 2 additions & 0 deletions modules/database/src/ioc/db/dbSubscriptionIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* 505 665 1831
*/

#define USE_TYPED_DBEVENT

#include <string>
#include <stdexcept>

Expand Down
1 change: 1 addition & 0 deletions modules/database/src/ioc/db/dbUnitTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <string.h>

#define EPICS_PRIVATE_API
#define USE_TYPED_DBEVENT

#include "dbmf.h"
#include "epicsUnitTest.h"
Expand Down

0 comments on commit 0463e82

Please sign in to comment.