Xorn
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Functions
revision.cc File Reference
#include "internal.h"

Go to the source code of this file.

Functions

xorn_revision_t xorn_new_revision (xorn_revision_t rev)
 Create a new revision, either from scratch or by copying an existing one. More...
 
bool xorn_revision_is_transient (xorn_revision_t rev)
 Return whether a revision can be changed. More...
 
void xorn_finalize_revision (xorn_revision_t rev)
 Prevent further changes to a revision. More...
 
void xorn_free_revision (xorn_revision_t rev)
 Free the memory associated with a revision. More...
 

Function Documentation

void xorn_finalize_revision ( xorn_revision_t  rev)

Prevent further changes to a revision.

When a revision is created, it is initially transient, i.e. changeable. However, it is typically not desired for a revision to change once it is in its desired state. Using this function, you can prevent further changes to the revision by means of the Xorn functions (though nobody can prevent you from poking into memory and messing things up). It will still be possible to create a copy of the revision and change that.

Definition at line 91 of file revision.cc.

void xorn_free_revision ( xorn_revision_t  rev)

Free the memory associated with a revision.

Warning
rev must not be passed to any Xorn function again.

Some memory may be shared between revisions. This memory will be released once all revisions using it have been freed.

Definition at line 103 of file revision.cc.

xorn_revision_t xorn_new_revision ( xorn_revision_t  rev)

Create a new revision, either from scratch or by copying an existing one.

You should free the revision using xorn_free_revision once it isn't used any more.

Parameters
revRevision to copy, or NULL.

There is a slight difference between creating two empty revisions and copying an empty one: only in the second case, objects of one revision will be valid in the other.

Returns
Returns the newly created revision, or NULL if there is not enough memory.

Definition at line 56 of file revision.cc.

bool xorn_revision_is_transient ( xorn_revision_t  rev)

Return whether a revision can be changed.

When a revision is created, it is initially transient, i.e. changeable. This can be changed by calling xorn_finalize_revision. After that, it can't be changed directly any more—you will have to create a transient copy if you want to change it again.

Definition at line 76 of file revision.cc.