+void trans_init(void); /** Initializes the transaction system for the current thread. Called automatically as needed. **/
+void trans_cleanup(void); /** Frees memory occupied by the transaction system pools for the current thread. **/
+
+struct trans *trans_open(void); /** Creates a new transaction. Used inside `TRANS_TRY`. **/
+struct trans *trans_get_current(void); /** Get a pointer to the currently running transaction, or NULL if there is none. **/
+void trans_commit(void); /** Commits the current transaction. **/
+void trans_rollback(void); /** Rolls back the current transaction. **/
+void trans_fold(void); /** Folds the current transaction to its parent. **/
+void trans_dump(void); /** Prints out a debugging dump of the transaction stack to stdout. **/
+
+struct mempool *trans_get_pool(void);
+
+/**
+ * Data associated with an exception. Usually, this structure is created
+ * by calling @trans_throw(), but if you want to pass more data, you can
+ * create your own exception and throw it using @trans_throw_exc().
+ **/
+struct exception {
+ const char *id; // Hierarchical identifier of the exception
+ const char *msg; // Error message to present to the user
+ void *object; // Object on which the exception happened
+ // More data specific for the particular `id' can follow