···29 * they can easily be chained together to form a debug message printing out
30 * various information. Most of the final logging functions in Monado inserts a
31 * newline at the end of the message and we don't want two to be inserted.
0000032 */
000000000000000000000000000000000000003334/*!
35 * Function prototype for receiving pretty printed strings.
···29 * they can easily be chained together to form a debug message printing out
30 * various information. Most of the final logging functions in Monado inserts a
31 * newline at the end of the message and we don't want two to be inserted.
32+ *
33+ * There are also helpers that goes from an enum to a string that that doesn't
34+ * use the delegate to do the printing, these returns string that are compiled
35+ * into the binary. They will return 'UNKNOWN' if they don't know the value.
36+ * But can be made to return NULL on unknown.
37 */
38+39+/*!
40+ * Returns a string of the input name, or NULL if invalid.
41+ *
42+ * @ingroup aux_pretty
43+ */
44+const char *
45+u_str_xrt_input_name_or_null(enum xrt_input_name name);
46+47+/*!
48+ * Returns a string of the output name, or NULL if invalid.
49+ *
50+ * @ingroup aux_pretty
51+ */
52+const char *
53+u_str_xrt_output_name_or_null(enum xrt_output_name name);
54+55+/*!
56+ * Returns a string of the device name, or NULL if invalid.
57+ *
58+ * @ingroup aux_pretty
59+ */
60+const char *
61+u_str_xrt_device_name_or_null(enum xrt_device_name name);
62+63+#define U_STR_NO_NULL(NAME, TYPE) \
64+ static inline const char *NAME(TYPE enumerate) \
65+ { \
66+ const char *str = NAME##_or_null(enumerate); \
67+ return str != NULL ? str : "UNKNOWN"; \
68+ }
69+70+U_STR_NO_NULL(u_str_xrt_input_name, enum xrt_input_name)
71+U_STR_NO_NULL(u_str_xrt_output_name, enum xrt_output_name)
72+U_STR_NO_NULL(u_str_xrt_device_name, enum xrt_device_name)
73+74+#undef U_STR_NO_NULL
75+7677/*!
78 * Function prototype for receiving pretty printed strings.