···2929 * they can easily be chained together to form a debug message printing out
3030 * various information. Most of the final logging functions in Monado inserts a
3131 * newline at the end of the message and we don't want two to be inserted.
3232+ *
3333+ * There are also helpers that goes from an enum to a string that that doesn't
3434+ * use the delegate to do the printing, these returns string that are compiled
3535+ * into the binary. They will return 'UNKNOWN' if they don't know the value.
3636+ * But can be made to return NULL on unknown.
3237 */
3838+3939+/*!
4040+ * Returns a string of the input name, or NULL if invalid.
4141+ *
4242+ * @ingroup aux_pretty
4343+ */
4444+const char *
4545+u_str_xrt_input_name_or_null(enum xrt_input_name name);
4646+4747+/*!
4848+ * Returns a string of the output name, or NULL if invalid.
4949+ *
5050+ * @ingroup aux_pretty
5151+ */
5252+const char *
5353+u_str_xrt_output_name_or_null(enum xrt_output_name name);
5454+5555+/*!
5656+ * Returns a string of the device name, or NULL if invalid.
5757+ *
5858+ * @ingroup aux_pretty
5959+ */
6060+const char *
6161+u_str_xrt_device_name_or_null(enum xrt_device_name name);
6262+6363+#define U_STR_NO_NULL(NAME, TYPE) \
6464+ static inline const char *NAME(TYPE enumerate) \
6565+ { \
6666+ const char *str = NAME##_or_null(enumerate); \
6767+ return str != NULL ? str : "UNKNOWN"; \
6868+ }
6969+7070+U_STR_NO_NULL(u_str_xrt_input_name, enum xrt_input_name)
7171+U_STR_NO_NULL(u_str_xrt_output_name, enum xrt_output_name)
7272+U_STR_NO_NULL(u_str_xrt_device_name, enum xrt_device_name)
7373+7474+#undef U_STR_NO_NULL
7575+33763477/*!
3578 * Function prototype for receiving pretty printed strings.