Monado OpenXR Runtime
|
This is common functionality used directly and shared by additional pretty printing functions implemented in multiple modules, such as OpenXR entrypoints. More...
Files | |
file | u_pretty_print.c |
Pretty printing various Monado things. | |
file | u_pretty_print.h |
Pretty printing various Monado things. | |
Data Structures | |
struct | u_pp_delegate |
Helper struct to hold a function pointer and data pointer. More... | |
struct | u_pp_sink_stack_only |
Stack only pretty printer sink, no need to free, must be inited before use. More... | |
Typedefs | |
typedef void(* | u_pp_delegate_func_t) (void *ptr, const char *str, size_t length) |
Function prototype for receiving pretty printed strings. More... | |
typedef struct u_pp_delegate | u_pp_delegate_t |
Helper typedef for delegate struct, less typing. More... | |
Functions | |
void | u_pp (struct u_pp_delegate dg, const char *fmt,...) XRT_PRINTF_FORMAT(2 |
Formats a string and sends to the delegate. More... | |
void void | u_pp_xrt_input_name (struct u_pp_delegate dg, enum xrt_input_name name) |
Pretty prints the xrt_input_name. More... | |
void | u_pp_xrt_result (struct u_pp_delegate dg, xrt_result_t xret) |
Pretty prints the xrt_result_t. More... | |
void | u_pp_xrt_reference_space_type (struct u_pp_delegate dg, enum xrt_reference_space_type type) |
Pretty prints the xrt_reference_space_type. More... | |
void | u_pp_small_vec3 (u_pp_delegate_t dg, const struct xrt_vec3 *vec) |
Printers for math structs. More... | |
void | u_pp_small_pose (u_pp_delegate_t dg, const struct xrt_pose *pose) |
void | u_pp_small_matrix_3x3 (u_pp_delegate_t dg, const struct xrt_matrix_3x3 *m) |
void | u_pp_small_matrix_4x4 (u_pp_delegate_t dg, const struct xrt_matrix_4x4 *m) |
void | u_pp_small_matrix_4x4_f64 (u_pp_delegate_t dg, const struct xrt_matrix_4x4_f64 *m) |
void | u_pp_small_array_f64 (struct u_pp_delegate dg, const double *arr, size_t n) |
void | u_pp_small_array2d_f64 (struct u_pp_delegate dg, const double *arr, size_t n, size_t m) |
void | u_pp_vec3 (u_pp_delegate_t dg, const struct xrt_vec3 *vec, const char *name, const char *indent) |
void | u_pp_pose (u_pp_delegate_t dg, const struct xrt_pose *pose, const char *name, const char *indent) |
void | u_pp_matrix_3x3 (u_pp_delegate_t dg, const struct xrt_matrix_3x3 *m, const char *name, const char *indent) |
void | u_pp_matrix_4x4 (u_pp_delegate_t dg, const struct xrt_matrix_4x4 *m, const char *name, const char *indent) |
void | u_pp_matrix_4x4_f64 (u_pp_delegate_t dg, const struct xrt_matrix_4x4_f64 *m, const char *name, const char *indent) |
void | u_pp_array_f64 (u_pp_delegate_t dg, const double *arr, size_t n, const char *name, const char *indent) |
Pretty prints double arr[n] More... | |
void | u_pp_array2d_f64 (u_pp_delegate_t dg, const double *arr, size_t n, size_t m, const char *name, const char *indent) |
Pretty prints double arr[n][m] More... | |
This is common functionality used directly and shared by additional pretty printing functions implemented in multiple modules, such as OpenXR entrypoints.
Some functions have a _indented
suffix added to them, this means that what they print starts indented, but also they start with a newline. This is so they can easily be chained together to form a debug message printing out various information. Most of the final logging functions in Monado inserts a newline at the end of the message and we don't want two to be inserted.
typedef void(* u_pp_delegate_func_t) (void *ptr, const char *str, size_t length) |
#include <auxiliary/util/u_pretty_print.h>
Function prototype for receiving pretty printed strings.
typedef struct u_pp_delegate u_pp_delegate_t |
#include <auxiliary/util/u_pretty_print.h>
Helper typedef for delegate struct, less typing.
void u_pp | ( | struct u_pp_delegate | dg, |
const char * | fmt, | ||
... | |||
) |
#include <auxiliary/util/u_pretty_print.h>
Formats a string and sends to the delegate.
Referenced by u_live_stats_ns::u_ls_ns_print_and_reset(), u_live_stats_ns::u_ls_ns_print_header(), u_pp_array2d_f64(), u_pp_array_f64(), and u_pp_small_vec3().
void u_pp_array2d_f64 | ( | u_pp_delegate_t | dg, |
const double * | arr, | ||
size_t | n, | ||
size_t | m, | ||
const char * | name, | ||
const char * | indent | ||
) |
void u_pp_array_f64 | ( | u_pp_delegate_t | dg, |
const double * | arr, | ||
size_t | n, | ||
const char * | name, | ||
const char * | indent | ||
) |
void u_pp_small_vec3 | ( | u_pp_delegate_t | dg, |
const struct xrt_vec3 * | vec | ||
) |
#include <auxiliary/util/u_pretty_print.h>
Printers for math structs.
None of these functions inserts trailing newlines because it's hard to remove a trailing newline but easy to add one if one should be needed. The small functions do not insert a starting newline while the other functions does. This is so that you can easily chain print functions to print a struct.
References u_pp().
void void u_pp_xrt_input_name | ( | struct u_pp_delegate | dg, |
enum xrt_input_name | name | ||
) |
#include <auxiliary/util/u_pretty_print.h>
Pretty prints the xrt_input_name.
void u_pp_xrt_reference_space_type | ( | struct u_pp_delegate | dg, |
enum xrt_reference_space_type | type | ||
) |
#include <auxiliary/util/u_pretty_print.h>
Pretty prints the xrt_reference_space_type.
void u_pp_xrt_result | ( | struct u_pp_delegate | dg, |
xrt_result_t | xret | ||
) |