XTA: API Reference for C language

xta_postgresql_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 POSTGRESQL_XA_RESOURCE_H
20 # define POSTGRESQL_XA_RESOURCE_H
21 
22 
23 
24 /* PostgreSQL front-end */
25 #include <libpq-fe.h>
26 /* XTA includes */
28 /* LIXA includes */
29 #include "lixa_sw.h"
30 
31 
32 
33 /* save old LIXA_TRACE_MODULE and set a new value */
34 #ifdef LIXA_TRACE_MODULE
35 # define LIXA_TRACE_MODULE_SAVE LIXA_TRACE_MODULE
36 # undef LIXA_TRACE_MODULE
37 #else
38 # undef LIXA_TRACE_MODULE_SAVE
39 #endif /* LIXA_TRACE_MODULE */
40 #define LIXA_TRACE_MODULE LIXA_TRACE_MOD_XTA
41 
42 
43 
47 typedef struct {
48  union {
51  };
55  PGconn *connection;
60  struct lixa_sw_status_rm_s lssr;
62 
63 
64 
65 #ifdef __cplusplus
66 extern "C" {
67 #endif /* __cplusplus */
68 
69 
70 
83  PGconn *connection, const char *name, const char *open_info);
84 
85 
86 
92  xta_postgresql_xa_resource_t *xa_resource);
93 
94 
95 
109  xta_postgresql_xa_resource_t *xa_resource,
110  PGconn *connection, const char *name, const char *open_info);
111 
112 
113 
121  xta_postgresql_xa_resource_t *xa_resource);
122 
123 
124 
137  int xta_postgresql_xa_close(xta_xa_resource_t *context, char *xa_info,
138  int rmid, long flags);
139 
140 
141 
152  int xta_postgresql_xa_commit(xta_xa_resource_t *context, const XID *xid,
153  int rmid, long flags);
154 
155 
156 
168  int xta_postgresql_xa_end(xta_xa_resource_t *context, const XID *xid,
169  int rmid, long flags);
170 
171 
172 
183  int xta_postgresql_xa_forget(xta_xa_resource_t *context, const XID *xid,
184  int rmid, long flags);
185 
186 
187 
200  int xta_postgresql_xa_open(xta_xa_resource_t *context, char *xa_info,
201  int rmid, long flags);
202 
203 
204 
215  int xta_postgresql_xa_prepare(xta_xa_resource_t *context, const XID *xid,
216  int rmid, long flags);
217 
218 
219 
234  XID *xids, long count, int rmid, long flags);
235 
236 
237 
248  int xta_postgresql_xa_rollback(xta_xa_resource_t *context, const XID *xid,
249  int rmid, long flags);
250 
251 
252 
264  int xta_postgresql_xa_start(xta_xa_resource_t *context, const XID *xid,
265  int rmid, long flags);
266 
267 
268 
269 #ifdef __cplusplus
270 }
271 #endif /* __cplusplus */
272 
273 
274 
275 /* restore old value of LIXA_TRACE_MODULE */
276 #ifdef LIXA_TRACE_MODULE_SAVE
277 # undef LIXA_TRACE_MODULE
278 # define LIXA_TRACE_MODULE LIXA_TRACE_MODULE_SAVE
279 # undef LIXA_TRACE_MODULE_SAVE
280 #endif /* LIXA_TRACE_MODULE_SAVE */
281 
282 
283 
284 #endif /* POSTGRESQL_XA_RESOURCE_H */
void xta_postgresql_xa_resource_clean(xta_postgresql_xa_resource_t *xa_resource)
int xta_postgresql_xa_rollback(xta_xa_resource_t *context, const XID *xid, int rmid, long flags)
int xta_postgresql_xa_resource_init(xta_postgresql_xa_resource_t *xa_resource, PGconn *connection, const char *name, const char *open_info)
int xta_postgresql_xa_recover(xta_xa_resource_t *context, XID *xids, long count, int rmid, long flags)
int xta_postgresql_xa_start(xta_xa_resource_t *context, const XID *xid, int rmid, long flags)
int xta_postgresql_xa_commit(xta_xa_resource_t *context, const XID *xid, int rmid, long flags)
int xta_postgresql_xa_end(xta_xa_resource_t *context, const XID *xid, int rmid, long flags)
int xta_postgresql_xa_prepare(xta_xa_resource_t *context, const XID *xid, int rmid, long flags)
Definition: xa.h:28
int xta_postgresql_xa_open(xta_xa_resource_t *context, char *xa_info, int rmid, long flags)
int xta_postgresql_xa_close(xta_xa_resource_t *context, char *xa_info, int rmid, long flags)
int xta_postgresql_xa_forget(xta_xa_resource_t *context, const XID *xid, int rmid, long flags)
void xta_postgresql_xa_resource_delete(xta_postgresql_xa_resource_t *xa_resource)
xta_postgresql_xa_resource_t * xta_postgresql_xa_resource_new(PGconn *connection, const char *name, const char *open_info)
xta_acquired_xa_resource_t acquired_xa_resource

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