![]() |
libsxbp
v0.27
Experimental generation of 2D spiralling lines based on input binary data.
|
This compilation unit provides most of the data types used by the library, as well as defining some library constants and versioning functionality. More...
#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include <time.h>

Go to the source code of this file.
Data Structures | |
| struct | sxbp_version_t |
| Used to represent a version of libsxbp. More... | |
| struct | sxbp_line_t |
| Represents one line segment in the spiral structure. More... | |
| struct | sxbp_tuple_t |
| A generic Tuple type for storing a vector-based quantity. More... | |
| struct | sxbp_co_ord_array_t |
| Struct type for holding a dynamically allocated array of co-ordinates. More... | |
| struct | sxbp_co_ord_cache_t |
| Struct type for holding a cached set of co-ords. More... | |
| struct | sxbp_spiral_t |
| Struct type representing a Spiral figure, in any state of completion. More... | |
| struct | sxbp_buffer_t |
| A simple buffer type for storing arrays of bytes. More... | |
Macros | |
| #define | SXBP_UP 0 |
| #define | SXBP_RIGHT 1 |
| #define | SXBP_DOWN 2 |
| #define | SXBP_LEFT 3 |
| #define | SXBP_CLOCKWISE 1 |
| #define | SXBP_ANTI_CLOCKWISE -1 |
Typedefs | |
| typedef struct sxbp_version_t | sxbp_version_t |
| Used to represent a version of libsxbp. More... | |
| typedef enum sxbp_status_t | sxbp_status_t |
| Represents the success or failure status of an executed function. More... | |
| typedef uint8_t | sxbp_direction_t |
| Type for representing one of the cartesian directions. More... | |
| typedef int8_t | sxbp_rotation_t |
| Type for representing a rotational direction. More... | |
| typedef uint32_t | sxbp_length_t |
| Type for representing the length of a line segment of a spiral. More... | |
| typedef struct sxbp_line_t | sxbp_line_t |
| Represents one line segment in the spiral structure. More... | |
| typedef int32_t | sxbp_tuple_item_t |
| Type for storing one of the items of a tuple. | |
| typedef struct sxbp_tuple_t | sxbp_tuple_t |
| A generic Tuple type for storing a vector-based quantity. | |
| typedef sxbp_tuple_t | sxbp_vector_t |
| A Vector type used for representing directions. | |
| typedef sxbp_tuple_t | sxbp_co_ord_t |
| A co-ord type used for representing cartesian co-ordinates. | |
| typedef struct sxbp_co_ord_array_t | sxbp_co_ord_array_t |
| Struct type for holding a dynamically allocated array of co-ordinates. | |
| typedef struct sxbp_co_ord_cache_t | sxbp_co_ord_cache_t |
| Struct type for holding a cached set of co-ords. More... | |
| typedef struct sxbp_spiral_t | sxbp_spiral_t |
| Struct type representing a Spiral figure, in any state of completion. More... | |
| typedef struct sxbp_buffer_t | sxbp_buffer_t |
| A simple buffer type for storing arrays of bytes. | |
Enumerations | |
| enum | sxbp_status_t { SXBP_STATE_UNKNOWN = 0, SXBP_OPERATION_OK, SXBP_OPERATION_FAIL, SXBP_MALLOC_REFUSED, SXBP_IMPOSSIBLE_CONDITION, SXBP_NOT_IMPLEMENTED } |
| Represents the success or failure status of an executed function. More... | |
Functions | |
| bool | sxbp_version_less_than (sxbp_version_t a, sxbp_version_t b) |
| Checks if a version is less than another. More... | |
| bool | sxbp_version_greater_than (sxbp_version_t a, sxbp_version_t b) |
| Checks if a version is greater than another. More... | |
| bool | sxbp_version_equal_to (sxbp_version_t a, sxbp_version_t b) |
| Checks if a version is equal to another. More... | |
Variables | |
| const sxbp_version_t | LIB_SXBP_VERSION |
| Stores the current version of libsxbp. | |
| const sxbp_vector_t | SXBP_VECTOR_DIRECTIONS [4] |
| Vector direction constants. More... | |
This compilation unit provides most of the data types used by the library, as well as defining some library constants and versioning functionality.
| #define SXBP_ANTI_CLOCKWISE -1 |
The rotational direction 'ANTI-CLOCKWISE'
| #define SXBP_CLOCKWISE 1 |
The rotational direction 'CLOCKWISE'
| #define SXBP_DOWN 2 |
The cartesian direction 'DOWN'
| #define SXBP_LEFT 3 |
The cartesian direction 'LEFT'
| #define SXBP_RIGHT 1 |
The cartesian direction 'RIGHT'
| #define SXBP_UP 0 |
The cartesian direction 'UP'
| typedef struct sxbp_co_ord_cache_t sxbp_co_ord_cache_t |
Struct type for holding a cached set of co-ords.
This is useful for co-ords that are intended for re-use between operations which require co-ords which are certified as being correct up to a given line index.
| typedef uint8_t sxbp_direction_t |
Type for representing one of the cartesian directions.
This can be one of SXBP_UP, SXBP_RIGHT, SXBP_DOWN or SXBP_LEFT.
| typedef uint32_t sxbp_length_t |
Type for representing the length of a line segment of a spiral.
| typedef struct sxbp_line_t sxbp_line_t |
Represents one line segment in the spiral structure.
This includes the direction of the line and it's length (initially set to 0).
| typedef int8_t sxbp_rotation_t |
Type for representing a rotational direction.
This can be SXBP_CLOCKWISE or SXBP_ANTI_CLOCKWISE.
| typedef struct sxbp_spiral_t sxbp_spiral_t |
Struct type representing a Spiral figure, in any state of completion.
This is the most important data type in the whole library, and is passed to and from many different library functions. A partially-complete spiral object may be produced from binary data, and a fully-complete spiral may be produced from the partially complete one via the routines in the library.
| typedef enum sxbp_status_t sxbp_status_t |
Represents the success or failure status of an executed function.
Not all functions have this as their return type, but most do. Functions that may encounter error conditions which need to be propagated back to the caller will have this type as their return type.
| typedef struct sxbp_version_t sxbp_version_t |
Used to represent a version of libsxbp.
Versions are of the format <MAJOR.MINOR.patch>
| enum sxbp_status_t |
Represents the success or failure status of an executed function.
Not all functions have this as their return type, but most do. Functions that may encounter error conditions which need to be propagated back to the caller will have this type as their return type.
| bool sxbp_version_equal_to | ( | sxbp_version_t | a, |
| sxbp_version_t | b | ||
| ) |
Checks if a version is equal to another.
Checks if version a is considered 'equal to' version b.
| a | The version on the left-hand side of this comparison. |
| b | The version on the right-hand side of this comparison. |
| bool sxbp_version_greater_than | ( | sxbp_version_t | a, |
| sxbp_version_t | b | ||
| ) |
Checks if a version is greater than another.
Checks if version a is considered 'greater than' version b.
| a | The version on the left-hand side of this comparison. |
| b | The version on the right-hand side of this comparison. |
| bool sxbp_version_less_than | ( | sxbp_version_t | a, |
| sxbp_version_t | b | ||
| ) |
Checks if a version is less than another.
Checks if version a is considered 'less than' version b.
| a | The version on the left-hand side of this comparison. |
| b | The version on the right-hand side of this comparison. |
| const sxbp_vector_t SXBP_VECTOR_DIRECTIONS[4] |
1.8.11