+/* Parse a string argument into a print_values value. */
+
+static enum print_values
+mi_parse_values_option (const char *arg)
+{
+ if (strcmp (arg, "0") == 0
+ || strcmp (arg, mi_no_values) == 0)
+ return PRINT_NO_VALUES;
+ else if (strcmp (arg, "1") == 0
+ || strcmp (arg, mi_all_values) == 0)
+ return PRINT_ALL_VALUES;
+ else if (strcmp (arg, "2") == 0
+ || strcmp (arg, mi_simple_values) == 0)
+ return PRINT_SIMPLE_VALUES;
+ else
+ error (_("Unknown value for PRINT_VALUES\n\
+Must be: 0 or \"%s\", 1 or \"%s\", 2 or \"%s\""),
+ mi_no_values, mi_simple_values, mi_all_values);
+}
+
+/* Return 1 if given the argument PRINT_VALUES we should display
+ a value of type TYPE. */
+
+static int
+mi_print_value_p (struct type *type, enum print_values print_values)
+{
+ if (type != NULL)
+ type = check_typedef (type);
+
+ if (print_values == PRINT_NO_VALUES)
+ return 0;
+
+ if (print_values == PRINT_ALL_VALUES)
+ return 1;
+
+ /* For PRINT_SIMPLE_VALUES, only print the value if it has a type
+ and that type is not a compound type. */
+
+ return (TYPE_CODE (type) != TYPE_CODE_ARRAY
+ && TYPE_CODE (type) != TYPE_CODE_STRUCT
+ && TYPE_CODE (type) != TYPE_CODE_UNION);
+}
+