Monado OpenXR Runtime

Pretty printing various Monado things. More...

#include "xrt/xrt_macro_lists.h"
#include "util/u_misc.h"
#include "util/u_extension_list.h"
#include "util/u_pretty_print.h"
#include <assert.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <inttypes.h>
Include dependency graph for u_pretty_print.c:

Macros

#define X_MACRO_ENUM_CASE_RETURN_STRING(NAME)   case NAME: return #NAME;
 
#define DG(str)   (dg.func(dg.ptr, str, strlen(str)))
 

Functions

const char * get_xrt_input_type_short_str (enum xrt_input_type type)
 
const char * get_xrt_output_type_short_str (enum xrt_output_type type)
 
void stack_only_sink (void *ptr, const char *str, size_t length)
 
int update_longest_extension_name_length (struct u_extension_list *list, int current_longest_extension)
 
const char * u_str_xrt_input_name_or_null (enum xrt_input_name name)
 Returns a string of the input name, or NULL if invalid. More...
 
const char * u_str_xrt_output_name_or_null (enum xrt_output_name name)
 Returns a string of the output name, or NULL if invalid. More...
 
const char * u_str_xrt_device_name_or_null (enum xrt_device_name name)
 Returns a string of the device name, or NULL if invalid. More...
 
const char * u_str_xrt_result_or_null (xrt_result_t xret)
 Returns a string of the result, or NULL if invalid. More...
 
void u_pp (struct u_pp_delegate dg, const char *fmt,...)
 
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_output_name (struct u_pp_delegate dg, enum xrt_output_name name)
 Pretty prints the xrt_output_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_padded_pretty_ms (u_pp_delegate_t dg, uint64_t value_ns)
 Pretty prints a milliseconds padded to be at least 16 characters, the formatting is meant to be human readable, does not use locale. 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...
 
void u_pp_string_list (struct u_pp_delegate dg, struct u_extension_list *usl, const char *prefix)
 Print all the strings in the list with the given prefix. More...
 
void u_pp_string_list_extensions (struct u_pp_delegate dg, struct u_extension_list *enabled_list, struct u_extension_list *optional_list, struct u_extension_list *skipped_list)
 Pretty print the extension list with extension information. More...
 
u_pp_delegate_t u_pp_sink_stack_only_init (struct u_pp_sink_stack_only *sink)
 

Detailed Description

Function Documentation

◆ u_pp_array2d_f64()

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]

References u_pp().

◆ u_pp_array_f64()

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]

References u_pp().

◆ u_pp_padded_pretty_ms()

void u_pp_padded_pretty_ms ( u_pp_delegate_t  dg,
uint64_t  value_ns 
)

Pretty prints a milliseconds padded to be at least 16 characters, the formatting is meant to be human readable, does not use locale.

Formatted as: " M'TTT'###.FFFms" Zero: " 0.000ms"

If the value is 10 seconds or larger (MM) then it will be longer then 16 characters.

References u_pp().

Referenced by u_live_stats_ns::u_ls_ns_print_and_reset().