XTA: API Reference for C language

xta_xa_resource.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009-2019, Christian Ferrari <tiian@users.sourceforge.net>
3  * All rights reserved.
4  *
5  * This file is part of LIXA.
6  *
7  * LIXA is free software: you can redistribute this file and/or modify
8  * it under the terms of the GNU Lesser General Public License version 2.1 as
9  * published by the Free Software Foundation.
10  *
11  * LIXA is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with LIXA. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef XTA_XA_RESOURCE_H
20 # define XTA_XA_RESOURCE_H
21 
22 
23 
24 /* LIXA includes */
25 #include "lixa.h"
26 /* XTA includes */
27 #include "xta_xid.h"
28 
29 
30 
37 
38 
39 
44 typedef struct act_rsrmgr_config_s xta_xa_resource_config_t;
45 
46 
47 
59 typedef struct xta_xa_resource_s {
64  struct rsrmgr_config_s rsrmgr_config;
69  struct act_rsrmgr_config_s act_rsrmgr_config;
75  int dynamic;
80  int native;
87 
88 
89 
90 #ifdef __cplusplus
91 extern "C" {
92 #endif /* __cplusplus */
93 
94 
95 
104  int xta_xa_resource_init(xta_xa_resource_t *xa_resource,
105  int native);
106 
107 
108 
115  void xta_xa_resource_clean(xta_xa_resource_t *xa_resource);
116 
117 
118 
126  const xta_xa_resource_t *xa_resource);
127 
128 
129 
135  static inline int xta_xa_resource_is_dynamic(
136  const xta_xa_resource_t *xa_resource) { return xa_resource->dynamic; }
137 
138 
139 
145  static inline int xta_xa_resource_is_native(
146  const xta_xa_resource_t *xa_resource) { return xa_resource->native; }
147 
148 
149 
159  const xta_transaction_t *tx);
160 
161 
162 
174  int xta_xa_resource_start(xta_xa_resource_t *xa_resource,
175  const xta_xid_t *xid,
176  long flag);
177 
178 
179 
197  int xta_xa_resource_end(xta_xa_resource_t *xa_resource,
198  const xta_xid_t *xid,
199  long flag);
200 
201 
202 
211  const xta_xid_t *xid);
212 
213 
214 
224  int xta_xa_resource_commit(xta_xa_resource_t *xa_resource,
225  const xta_xid_t *xid,
226  int one_phase);
227 
228 
229 
230 #ifdef __cplusplus
231 }
232 #endif /* __cplusplus */
233 
234 
235 
236 #endif /* XTA_XA_RESOURCE_H */
int xta_xa_resource_prepare(xta_xa_resource_t *xa_resource, const xta_xid_t *xid)
void xta_xa_resource_clean(xta_xa_resource_t *xa_resource)
int xta_xa_resource_end(xta_xa_resource_t *xa_resource, const xta_xid_t *xid, long flag)
struct xta_xa_resource_s xta_xa_resource_t
static int xta_xa_resource_is_native(const xta_xa_resource_t *xa_resource)
struct act_rsrmgr_config_s act_rsrmgr_config
struct act_rsrmgr_config_s xta_xa_resource_config_t
static int xta_xa_resource_is_dynamic(const xta_xa_resource_t *xa_resource)
int xta_xa_resource_enlisted(xta_xa_resource_t *xa_resource, const xta_transaction_t *tx)
const xta_xa_resource_config_t * xta_xa_resource_get_config(const xta_xa_resource_t *xa_resource)
struct rsrmgr_config_s rsrmgr_config
int xta_xa_resource_commit(xta_xa_resource_t *xa_resource, const xta_xid_t *xid, int one_phase)
const xta_transaction_t * enlisted_tx
int xta_xa_resource_init(xta_xa_resource_t *xa_resource, int native)
int xta_xa_resource_start(xta_xa_resource_t *xa_resource, const xta_xid_t *xid, long flag)

Copyright © 2009-2019, Christian Ferrari tiian@users.sourceforge.net http://www.tiian.org/