#include "internal.h"#include <stdlib.h>#include <algorithm>#include "key_iterator.h"Go to the source code of this file.
Functions | |
| bool | xorn_object_exists_in_revision (xorn_revision_t rev, xorn_object_t ob) |
| Return whether an object exists in a revision. More... | |
| xorn_obtype_t | xorn_get_object_type (xorn_revision_t rev, xorn_object_t ob) |
| Get the type of an object in a given revision. More... | |
| void const * | xorn_get_object_data (xorn_revision_t rev, xorn_object_t ob, xorn_obtype_t type) |
| Get a pointer to an object's data in a given revision. More... | |
| int | xorn_get_object_location (xorn_revision_t rev, xorn_object_t ob, xorn_object_t *attached_to_return, unsigned int *position_return) |
| Get the location of an object in the object structure. More... | |
| int | xorn_get_objects (xorn_revision_t rev, xorn_object_t **objects_return, size_t *count_return) |
| Return a list of all objects in a revision. More... | |
| int | xorn_get_objects_attached_to (xorn_revision_t rev, xorn_object_t ob, xorn_object_t **objects_return, size_t *count_return) |
| Return a list of objects in a revision which are attached to a certain object. More... | |
| int | xorn_get_selected_objects (xorn_revision_t rev, xorn_selection_t sel, xorn_object_t **objects_return, size_t *count_return) |
| Return a list of objects which are in a revision as well as in a selection. More... | |
| int | xorn_get_added_objects (xorn_revision_t from_rev, xorn_revision_t to_rev, xorn_object_t **objects_return, size_t *count_return) |
| Return a list of objects which are in a revision but not in another. More... | |
| int | xorn_get_removed_objects (xorn_revision_t from_rev, xorn_revision_t to_rev, xorn_object_t **objects_return, size_t *count_return) |
| Return a list of objects which are in a revision but not in another. More... | |
| int | xorn_get_modified_objects (xorn_revision_t from_rev, xorn_revision_t to_rev, xorn_object_t **objects_return, size_t *count_return) |
| Return a list of objects which exist in two revisions but have different type or data. More... | |
| int xorn_get_added_objects | ( | xorn_revision_t | from_rev, |
| xorn_revision_t | to_rev, | ||
| xorn_object_t ** | objects_return, | ||
| size_t * | count_return | ||
| ) |
Return a list of objects which are in a revision but not in another.
The returned list contains all objects in to_rev which are not in from_rev. They are not necessarily returned in a meaningful order.
The same semantics apply as in xorn_get_objects. See there for a more detailed description.
| int xorn_get_modified_objects | ( | xorn_revision_t | from_rev, |
| xorn_revision_t | to_rev, | ||
| xorn_object_t ** | objects_return, | ||
| size_t * | count_return | ||
| ) |
Return a list of objects which exist in two revisions but have different type or data.
The objects are not necessarily returned in a meaningful order.
The same semantics apply as in xorn_get_objects. See there for a more detailed description.
| void const* xorn_get_object_data | ( | xorn_revision_t | rev, |
| xorn_object_t | ob, | ||
| xorn_obtype_t | type | ||
| ) |
Get a pointer to an object's data in a given revision.
The returned data structure (including referenced strings) must not be changed by the caller; use xorn_set_object_data or its type-safe equivalents to change the object.
xornsch_obtype_net, returns a pointer to a xornsch_net structure). If the object doesn't exist in rev, or type doesn't match its type, returns NULL.Example:
xornsch_get_net_data etc.) which offer the same functionality but are type-safe. | int xorn_get_object_location | ( | xorn_revision_t | rev, |
| xorn_object_t | ob, | ||
| xorn_object_t * | attached_to_return, | ||
| unsigned int * | position_return | ||
| ) |
Get the location of an object in the object structure.
| rev | Revision to examine |
| ob | Object whose location to return |
| attached_to_return | Pointer to a variable where to write the object to which ob is attached |
| position_return | Pointer to a variable where to write the index of ob relative to its sibling objects |
Both pointer arguments may be NULL to indicate that the caller isn't interested in the return value.
0 and writes the appropriate values to attached_to_return and position_return if ob exists in rev. Otherwise, doesn't touch the values and returns -1. | xorn_obtype_t xorn_get_object_type | ( | xorn_revision_t | rev, |
| xorn_object_t | ob | ||
| ) |
Get the type of an object in a given revision.
Returns xorn_obtype_none if the object doesn't exist in the revision.
| int xorn_get_objects | ( | xorn_revision_t | rev, |
| xorn_object_t ** | objects_return, | ||
| size_t * | count_return | ||
| ) |
Return a list of all objects in a revision.
A list of xorn_object_t values is allocated and written to, and its location is written to the variable pointed to by objects_return. The number of objects is written to the variable pointed to by count_return. If the list is empty or there is not enough memory, *objects_return may be set to NULL.
The objects are returned in their actual order. Attached objects are listed after the object they are attached to.
0 on success and -1 if there is not enough memory.free(3).Example:
| int xorn_get_objects_attached_to | ( | xorn_revision_t | rev, |
| xorn_object_t | ob, | ||
| xorn_object_t ** | objects_return, | ||
| size_t * | count_return | ||
| ) |
Return a list of objects in a revision which are attached to a certain object.
If ob is NULL, return all objects in the revision which are not attached. The objects are returned in their actual order. Objects attached to the returned objects are not returned.
objects_return may be NULL to indicate that the caller is only interested in the object count. In this case, the object list isn't created, and the function cannot run out of memory. Otherwise, the same semantics apply as in xorn_get_objects. See there for a more detailed description.
| int xorn_get_removed_objects | ( | xorn_revision_t | from_rev, |
| xorn_revision_t | to_rev, | ||
| xorn_object_t ** | objects_return, | ||
| size_t * | count_return | ||
| ) |
Return a list of objects which are in a revision but not in another.
The returned list contains all objects in from_rev which are not in to_rev. They are not necessarily returned in a meaningful order.
The same semantics apply as in xorn_get_objects. See there for a more detailed description.
| int xorn_get_selected_objects | ( | xorn_revision_t | rev, |
| xorn_selection_t | sel, | ||
| xorn_object_t ** | objects_return, | ||
| size_t * | count_return | ||
| ) |
Return a list of objects which are in a revision as well as in a selection.
The objects are not necessarily returned in a meaningful order.
The same semantics apply as in xorn_get_objects. See there for a more detailed description.
| bool xorn_object_exists_in_revision | ( | xorn_revision_t | rev, |
| xorn_object_t | ob | ||
| ) |
1.8.8