EPICS Base  7.0.6.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dbEvent.h
1 /*************************************************************************\
2 * Copyright (c) 2010 Brookhaven National Laboratory.
3 * Copyright (c) 2010 Helmholtz-Zentrum Berlin
4 * fuer Materialien und Energie GmbH.
5 * Copyright (c) 2002 The University of Chicago, as Operator of Argonne
6 * National Laboratory.
7 * Copyright (c) 2002 The Regents of the University of California, as
8 * Operator of Los Alamos National Laboratory.
9 * SPDX-License-Identifier: EPICS
10 * EPICS BASE is distributed subject to a Software License Agreement found
11 * in file LICENSE that is included with this distribution.
12 \*************************************************************************/
13 
14 /*
15  * Author: Jeffrey O. Hill <[email protected]>
16  *
17  * Ralph Lange <[email protected]>
18  */
19 
20 #ifndef INCLdbEventh
21 #define INCLdbEventh
22 
23 #include "epicsThread.h"
24 
25 #include "dbCoreAPI.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 struct dbChannel;
32 struct db_field_log;
33 struct evSubscrip;
34 
35 DBCORE_API int db_event_list (
36  const char *name, unsigned level);
37 DBCORE_API int dbel (
38  const char *name, unsigned level);
39 DBCORE_API int db_post_events (
40  void *pRecord, void *pField, unsigned caEventMask );
41 
42 typedef void * dbEventCtx;
43 
44 typedef void EXTRALABORFUNC (void *extralabor_arg);
45 DBCORE_API dbEventCtx db_init_events (void);
46 DBCORE_API int db_start_events (
47  dbEventCtx ctx, const char *taskname, void (*init_func)(void *),
48  void *init_func_arg, unsigned osiPriority );
49 DBCORE_API void db_close_events (dbEventCtx ctx);
50 DBCORE_API void db_event_flow_ctrl_mode_on (dbEventCtx ctx);
51 DBCORE_API void db_event_flow_ctrl_mode_off (dbEventCtx ctx);
52 DBCORE_API int db_add_extra_labor_event (
53  dbEventCtx ctx, EXTRALABORFUNC *func, void *arg);
54 DBCORE_API void db_flush_extra_labor_event (dbEventCtx);
55 DBCORE_API int db_post_extra_labor (dbEventCtx ctx);
56 DBCORE_API void db_event_change_priority ( dbEventCtx ctx, unsigned epicsPriority );
57 
58 #ifdef EPICS_PRIVATE_API
59 DBCORE_API void db_cleanup_events(void);
60 DBCORE_API void db_init_event_freelists (void);
61 #endif
62 
63 typedef void EVENTFUNC (void *user_arg, struct dbChannel *chan,
64  int eventsRemaining, struct db_field_log *pfl);
65 
66 typedef void * dbEventSubscription;
67 DBCORE_API dbEventSubscription db_add_event (
68  dbEventCtx ctx, struct dbChannel *chan,
69  EVENTFUNC *user_sub, void *user_arg, unsigned select);
70 DBCORE_API void db_cancel_event (dbEventSubscription es);
71 DBCORE_API void db_post_single_event (dbEventSubscription es);
72 DBCORE_API void db_event_enable (dbEventSubscription es);
73 DBCORE_API void db_event_disable (dbEventSubscription es);
74 
75 DBCORE_API struct db_field_log* db_create_event_log (struct evSubscrip *pevent);
76 DBCORE_API struct db_field_log* db_create_read_log (struct dbChannel *chan);
77 DBCORE_API void db_delete_field_log (struct db_field_log *pfl);
78 DBCORE_API int db_available_logs(void);
79 
80 #define DB_EVENT_OK 0
81 #define DB_EVENT_ERROR (-1)
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #endif /*INCLdbEventh*/
C++ and C descriptions for a thread.