.ig Copyright (C) 1993,1994 by the author(s). This software is published in the hope that it will be useful, but WITHOUT ANY WARRANTY for any part of this software to work correctly or as described in the manuals. See the ShapeTools Public License for details. Permission is granted to use, copy, modify, or distribute any part of this software but only under the conditions described in the ShapeTools Public License. A copy of this license is supposed to have been given to you along with ShapeTools in a file named LICENSE. Among other things, this copyright notice and the Public License must be preserved on all copies. Author: Andreas Lampen (Andreas.Lampen@cs.tu-berlin.de) $Header: sttransaction.3[4.0] Thu Jun 24 17:43:37 1993 andy@cs.tu-berlin.de frozen $ .. .TH sttransaction 3 "Thu Jun 24 17:43:37 1993" "sttk-1.7" "ShapeTools Toolkit Library" .SH NAME stAbortThis, stThisTransaction \- simple transaction handling .SH SYNOPSIS #include .br #include .sp .ta 3.2c void stAbortThis (int domsg); .sp struct stTransaction stThisTransaction; .sp .SH DESCRIPTION \fIstAbortThis\fP is part of a simple transaction mechanism on the basis of setjmp(3) and longjmp(3). A transacion is started by setting a return point calling setjmp(3) and may be aborted by calling stAbortThis. This outputs a short abort message, cleans up the temporary files (stRmRegisteredFiles(3)) and performs a longjmp(3) operation, returning to the transaction start point. .LP The structure variable \fIstThisTransaction\fP carries information about the current transaction. It has the following fields: .nf \fCstruct stTransaction { char tr_fname[MAXPATHLEN+1]; int tr_done; int tr_seqno; int tr_rc; jmp_buf tr_env; };\fP .fi .LP When setting the transaction return point by calling setjmp(3) the \fItr_env\fP field must be used as argument to setjmp. The name of the concerned file should be stored in \fItr_fname\fP field and the \fItr_done\fP flag should be cleared. \fItr_seqno\fP is the serial number of the current transaction and must be increased at the beginning of each new transaction. The \fItr_rc\fP return code can be set to an appropriate return code when something went wrong and the transaction was aborted. When not set by the application, \fItr_rc\fP will be set nun null by stAbortThis on abortion of the transaction. On successful completion, \fItr_done\fP should be set TRUE. .SH SEE ALSO stRmRegisteredFiles(3), setjmp(3), longjmp(3).