af_version(3) | Attribute Filesystem (AtFS) | af_version(3) |
af_saverev, af_newgen, af_setbusy, af_sstate, af_svnum - version control in AtFS
#include <atfs.h>
int af_saverev (Af_key *busyAso, Af_key *saveAso, int generation, int storeType)
int af_newgen (Af_key *aso, Af_key *newAso)
int af_setbusy (Af_key *busyAso, Af_key *aso, Af_key *prevAso)
int af_sstate (Af_key *aso, int state)
int af_svnum (Af_key *aso, int gen, int rev)
int af_predsucc (Af_key *inAso, int mode, Af_key *outAso)
af_saverev makes a copy of the ASO identified by busyAso. This new ASO gets the status saved and a version number according to the following scheme:
Usually, versions are added to the most recent generation. This is indicated by giving the generation parameter AF_LASTVERS. It is also possible to add the new version to an older generation, indicated by an explicit generation 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.
The storeType 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.
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 saveAso. Use af_dropkey to free the allocated memory associated with saveAso.
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 most recent version becomes a new one with every call of af_saverev.
af_newgen 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 aso.
With af_setbusy 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 aso denotes the version, from which the new contents of the busy version was taken. busyAso points to the current busy version, if there is any. It may also be omitted by giving a NULL pointer. af_setbusy returns prevAso the key of the version that previously was set as origin of the busy version.
af_sstate 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:
af_svnum sets the version number of the identified ASO to the given generation (gen) and revision (rev) 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 aso.
af_predsucc returns the predecessor or successor version of inAso. The result is passed in the buffer outAso. The value for the mode parameter may be one of the following
af_intro (3), af_lock(3)
Upon error, -1 is returned and af_errno is set to the corresponding error number
Due to limitations in the UNIX filesystem, only the creator (author) of a derived object may save ASOs to a derived object cache.
Empty files cannot be inserted in a derived object cache.
The modes AF_LOGICAL_PRED and AF_LOGICAL_SUCC for af_predsucc are not yet impelmented.
Fri Jun 25 14:33:23 1993 | AtFS-1.71 |