EPICS Base  7.0.6.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
initHooks.h
1 /*************************************************************************\
2 * Copyright (c) 2009 UChicago Argonne LLC, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * SPDX-License-Identifier: EPICS
7 * EPICS BASE is distributed subject to a Software License Agreement found
8 * in file LICENSE that is included with this distribution.
9 \*************************************************************************/
10 /*
11  * Authors: Benjamin Franksen (BESY) and Marty Kraimer
12  * Date: 06-01-91
13  * major Revision: 07JuL97
14  */
15 
16 #ifndef INC_initHooks_H
17 #define INC_initHooks_H
18 
19 #include "libComAPI.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 /* This enum must agree with the array of names defined in initHookName() */
26 typedef enum {
27  initHookAtIocBuild = 0, /* Start of iocBuild/iocInit commands */
28  initHookAtBeginning,
29  initHookAfterCallbackInit,
30  initHookAfterCaLinkInit,
31  initHookAfterInitDrvSup,
32  initHookAfterInitRecSup,
33  initHookAfterInitDevSup,
34  initHookAfterInitDatabase,
35  initHookAfterFinishDevSup,
36  initHookAfterScanInit,
37  initHookAfterInitialProcess,
38  initHookAfterCaServerInit,
39  initHookAfterIocBuilt, /* End of iocBuild command */
40 
41  initHookAtIocRun, /* Start of iocRun command */
42  initHookAfterDatabaseRunning,
43  initHookAfterCaServerRunning,
44  initHookAfterIocRunning, /* End of iocRun/iocInit commands */
45 
46  initHookAtIocPause, /* Start of iocPause command */
47  initHookAfterCaServerPaused,
48  initHookAfterDatabasePaused,
49  initHookAfterIocPaused, /* End of iocPause command */
50 
51  initHookAtShutdown, /* Start of iocShutdown commands */
52  initHookAfterCloseLinks,
53  initHookAfterStopScan, /* triggered only by unittest code. testIocShutdownOk() */
54  initHookAfterStopCallback, /* triggered only by unittest code. testIocShutdownOk() */
55  initHookAfterStopLinks,
56  initHookBeforeFree, /* triggered only by unittest code. testIocShutdownOk() */
57  initHookAfterShutdown, /* End of iocShutdown commands */
58 
59 /* Deprecated states, provided for backwards compatibility.
60  * These states are announced at the same point they were before,
61  * but will not be repeated if the IOC gets paused and restarted.
62  */
63  initHookAfterInterruptAccept, /* After initHookAfterDatabaseRunning */
64  initHookAtEnd, /* Before initHookAfterIocRunning */
65 } initHookState;
66 
67 typedef void (*initHookFunction)(initHookState state);
68 LIBCOM_API int initHookRegister(initHookFunction func);
69 LIBCOM_API void initHookAnnounce(initHookState state);
70 LIBCOM_API const char *initHookName(int state);
71 LIBCOM_API void initHookFree(void);
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif /* INC_initHooks_H */