diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2012-04-19 11:14:33 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2012-04-19 11:14:33 +0200 |
commit | a5923caf474983e14477498117fabb041805fd04 (patch) | |
tree | e6a40a174d064acb2c7ab5a3b1e6366193b8b7d8 /pgsql.h | |
parent | 4a88c817b17498e72a95589f887197ab43edc491 (diff) | |
download | pgfuse-a5923caf474983e14477498117fabb041805fd04.tar.gz pgfuse-a5923caf474983e14477498117fabb041805fd04.tar.bz2 |
added first simple transaction policy (per FUSE operation)
Diffstat (limited to 'pgsql.h')
-rw-r--r-- | pgsql.h | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -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 ); |