yumapro  21.10T-8
YumaPro SDK
agt_db_lock.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 - 2021, YumaWorks, Inc., All Rights Reserved.
3  *
4  * Unless required by applicable law or agreed to in writing,
5  * software distributed under the License is distributed on an
6  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
7  * KIND, either express or implied. See the License for the
8  * specific language governing permissions and limitations
9  * under the License.
10  */
11 #ifdef WITH_YCONTROL
12 #ifndef _H_agt_db_lock
13 #define _H_agt_db_lock
14 
15 /* FILE: agt_db_lock.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
28 /*********************************************************************
29 * *
30 * C H A N G E H I S T O R Y *
31 * *
32 *********************************************************************
33 
34 date init comment
35 ----------------------------------------------------------------------
36 29-jan-19 abb Begun
37 */
38 
39 #include <xmlstring.h>
40 
41 #ifndef _H_agt_cfg
42 #include "agt_cfg.h"
43 #endif
44 
45 #ifndef _H_status_enum
46 #include "status_enum.h"
47 #endif
48 
49 #ifndef _H_val
50 #include "val.h"
51 #endif
52 
53 #ifndef _H_ycontrol
54 #include "ycontrol.h"
55 #endif
56 
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 /********************************************************************
63 * *
64 * C O N S T A N T S *
65 * *
66 *********************************************************************/
67 
68 /********************************************************************
69 * *
70 * T Y P E S *
71 * *
72 *********************************************************************/
73 
74 
75 /********************************************************************
76 * *
77 * F U N C T I O N S *
78 * *
79 *********************************************************************/
80 
81 /* header in agt_db_api.h */
82 
83 
97 extern status_t
98  agt_db_lock_init (void);
99 
100 
106 extern void
107  agt_db_lock_cleanup (void);
108 
109 
117 extern status_t
118  agt_db_lock_set_owner (const xmlChar *subsys_id,
119  int subsys_fd);
120 
121 
127 extern boolean
128  agt_db_lock_needed (void);
129 
130 
137 extern status_t
139 
140 
146 extern status_t
147  agt_db_lock_release (void);
148 
149 
160 extern status_t
161  agt_db_lock_handle_response (uint32 msgid,
162  const xmlChar *subsys_id,
163  ycontrol_msgbody_t msgbody_type,
164  val_value_t *msgbody);
165 
166 
173 extern void
174  agt_db_lock_subsys_gone (const xmlChar *subsys_id);
175 
176 
183 extern boolean
185 
186 
190 #ifdef __cplusplus
191 } /* end extern 'C' */
192 #endif
193 
194 #endif /* _H_agt_db_lock */
195 #endif // WITH_YCONTROL
status_t agt_db_lock_set_owner(const xmlChar *subsys_id, int subsys_fd)
Set the subsystem that owns the DB-Edit-Lock.
Definition: agt_db_lock.c:519
YumaPro Subsystem Control Protocol.
Transaction Control Block.
Definition: agt_cfg.h:224
status_t agt_db_lock_handle_response(uint32 msgid, const xmlChar *subsys_id, ycontrol_msgbody_t msgbody_type, val_value_t *msgbody)
Handle the db-lock response.
Definition: agt_db_lock.c:817
Value Node Basic Support.
Manage Server configuration edit transactions.
one value to match one type
Definition: val.h:870
boolean agt_db_lock_needed(void)
Check if lock is needed.
Definition: agt_db_lock.c:576
status_t
global error return code
Definition: status_enum.h:186
void agt_db_lock_subsys_gone(const xmlChar *subsys_id)
Called when the subsystem is gone to cleanup any db-lock state in progress.
Definition: agt_db_lock.c:915
ycontrol_msgbody_t
YControl message body types.
Definition: ycontrol_types.h:85
status_t agt_db_lock_release(void)
Release the DB-Edit-Lock.
Definition: agt_db_lock.c:754
status_t agt_db_lock_init(void)
Initialize the DB-Edit-Lock subsysystem handler.
Definition: agt_db_lock.c:425
boolean agt_db_lock_init_waiting(void)
Check if db-lock is stuck in init-waiting state.
Definition: agt_db_lock.c:948
void agt_db_lock_cleanup(void)
Cleanup the DB-Edit-Lock Module.
Definition: agt_db_lock.c:492
status_t agt_db_lock_request(agt_cfg_transaction_t *txcb)
Request the DB-Edit-Lock.
Definition: agt_db_lock.c:597
global error status code enumerations