.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: af_version.3[7.0] Fri Jun 25 14:33:23 1993 andy@cs.tu-berlin.de frozen $ .. .TH af_version 3 "Fri Jun 25 14:33:23 1993" "AtFS-1.71" "Attribute Filesystem (AtFS)" .SH NAME af_saverev, af_newgen, af_setbusy, af_sstate, af_svnum \- version control in AtFS .SH SYNOPSIS #include .sp int af_saverev (Af_key *busyAso, Af_key *saveAso, int generation, int storeType) .sp int af_newgen (Af_key *aso, Af_key *newAso) .sp int af_setbusy (Af_key *busyAso, Af_key *aso, Af_key *prevAso) .sp int af_sstate (Af_key *aso, int state) .sp int af_svnum (Af_key *aso, int gen, int rev) .sp int af_predsucc (Af_key *inAso, int mode, Af_key *outAso) .sp .SH DESCRIPTION \fIaf_saverev\fP makes a copy of the ASO identified by \fIbusyAso\fP. This new ASO gets the status \fIsaved\fP and a version number according to the following scheme: .sp .RS The initial revision is numbered by generation number 1 and revision number 0. All other saved versions get version numbers built from these of their predecessors by preserving the generation number and increasing the revision number by 1. .RE .sp Usually, versions are added to the most recent generation. This is indicated by giving the \fIgeneration\fP parameter \fIAF_LASTVERS\fP. It is also possible to add the new version to an older generation, indicated by an explicit \fIgeneration\fP number. In this case, the predecessor of the new version is the most recent version of the named generation and the version number is built accordingly. .LP The \fIstoreType\fP argument says, whether the new version shall be stored as delta (difference) to its predecessor version or completely. Valid values are AF_STORE_DELTA (default) and AF_STORE_COMPLETE. .LP All attributes except version status and version number (including user defined attributes) are inherited from the busy version. The key of the generated ASO is returned in \fIsaveAso\fP. Use \fIaf_dropkey\fP to free the allocated memory associated with saveAso. .LP Creating a new version in the most recent generation of a history requires reserving the update permissions by setting a lock on the most recent version (see af_lock(3)). For adding a new version to an old generation, a version lock on the most recent version of the concerned generation is needed. Subsequent calls of af_saverev for the same object history each need a new lock, as the \fImost recent version\fP becomes a new one with every call of af_saverev. .LP \fIaf_newgen\fP opens a new generation in a object history. The last saved version will be duplicated. This creates a new ASO, that is numbered by a new generation number (increased by 1) and the initial revision number (0). All other attributes remain unchanged. af_newgen requires a lock (see af_lock(3)) set on the ASO specified by \fIaso\fP. .LP With \fIaf_setbusy\fP an application can inform AtFS, that the data file of a busy version (a busy versions data always sits in a UNIX file) has been exchanged. This is usually the case, after having reinstalled an old version to be basis for further development. The argument \fIaso\fP denotes the version, from which the new contents of the busy version was taken. \fIbusyAso\fP points to the current busy version, if there is any. It may also be omitted by giving a NULL pointer. af_setbusy returns \fIprevAso\fP the key of the version that previously was set as origin of the busy version. .LP \fIaf_sstate\fP sets the state of the identified ASO. Only state transitions from one state to the next or previous state (according to the list below) are allowed. Possible states are: .TP 2c \fIbusy\fP The version is under development and its contents may be changed. .TP \fIsaved\fP The version is saved and may be used for later backup. .TP \fIproposed\fP The version has been submitted for publication by the developer but still needs formal approval by a quality assurance board to become publicly visible and accessible in the official database. .TP \fIpublished\fP The version has passed the formal approval and is now accessible to every member of the project. It is not yet accessed and may therefore be withdrawn if necessary. .TP \fIaccessed\fP The version has been published, and is now accessed by some members of the project. .TP \fIfrozen\fP The version may be part of a system configuration that has been released to the outside world. This means it must, under no circumstances, be destroyed. .LP \fIaf_svnum\fP sets the version number of the identified ASO to the given generation (\fIgen\fP) and revision (\fIrev\fP) number. The version number of source objects can only be increased \- the version number of derived objects can be set to any value. af_svnum requires a lock (see af_lock(3)) set on the ASO specified by \fIaso\fP. .LP \fIaf_predsucc\fP returns the predecessor or successor version of \fIinAso\fP. The result is passed in the buffer \fIoutAso\fP. The value for the \fImode\fP parameter may be one of the following .TP 2.5c AF_LOGICAL_SUCC logical successor AF_LOGICAL_PRED logical predecessor AF_PHYSICAL_SUCC physical successor AF_PHYSICAL_PRED physical predecessor .SH SEE ALSO af_intro (3), af_lock(3) .SH DIAGNOSTICS Upon error, \-1 is returned and \fIaf_errno\fP is set to the corresponding error number .SH BUGS Due to limitations in the \s-1UNIX\s+1 filesystem, only the creator (author) of a derived object may save ASOs to a derived object cache. .LP Empty files cannot be inserted in a derived object cache. .LP The modes AF_LOGICAL_PRED and AF_LOGICAL_SUCC for af_predsucc are not yet impelmented.