summaryrefslogtreecommitdiff
path: root/pgsql.h
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2012-04-19 11:14:33 +0200
committerAndreas Baumann <abaumann@yahoo.com>2012-04-19 11:14:33 +0200
commita5923caf474983e14477498117fabb041805fd04 (patch)
treee6a40a174d064acb2c7ab5a3b1e6366193b8b7d8 /pgsql.h
parent4a88c817b17498e72a95589f887197ab43edc491 (diff)
downloadpgfuse-a5923caf474983e14477498117fabb041805fd04.tar.gz
pgfuse-a5923caf474983e14477498117fabb041805fd04.tar.bz2
added first simple transaction policy (per FUSE operation)
Diffstat (limited to 'pgsql.h')
-rw-r--r--pgsql.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/pgsql.h b/pgsql.h
index c2ad54a..c5d4b2f 100644
--- a/pgsql.h
+++ b/pgsql.h
@@ -37,6 +37,33 @@ typedef struct PgMeta {
int ref_count; /* how many open file handles exist for this file */
} PgMeta;
+#define PSQL_BEGIN( T ) \
+ { \
+ int __res; \
+ __res = psql_begin( T ); \
+ if( __res < 0 ) return __res; \
+ }
+
+#define PSQL_COMMIT( T ) \
+ { \
+ int __res; \
+ __res = psql_commit( T ); \
+ if( __res < 0 ) return __res; \
+ }
+
+#define PSQL_ROLLBACK( T ) \
+ { \
+ int __res; \
+ __res = psql_rollback( T ); \
+ if( __res < 0 ) return __res; \
+ }
+
+int psql_begin( PGconn *conn );
+
+int psql_commit( PGconn *conn );
+
+int psql_rollback( PGconn *conn );
+
int psql_get_meta( PGconn *conn, const char *path, PgMeta *meta );
int psql_write_meta( PGconn *conn, const int id, const char *path, PgMeta meta );