+/* * Control types for commands. */
+
+enum misc_command_type
+{
+ ok_command,
+ end_command,
+ else_command,
+ nop_command
+};
+
+enum command_control_type
+{
+ simple_control,
+ break_control,
+ continue_control,
+ while_control,
+ if_control,
+ commands_control,
+ python_control,
+ compile_control,
+ guile_control,
+ while_stepping_control,
+ define_control,
+ invalid_control
+};
+
+struct command_line;
+
+extern void free_command_lines (struct command_line **);
+
+/* A deleter for command_line that calls free_command_lines. */
+
+struct command_lines_deleter
+{
+ void operator() (command_line *cmd_lines) const
+ {
+ free_command_lines (&cmd_lines);
+ }
+};
+
+/* A reference-counted struct command_line. */
+typedef std::shared_ptr<command_line> counted_command_line;
+
+/* * Structure for saved commands lines (for breakpoints, defined
+ commands, etc). */
+
+struct command_line
+{
+ explicit command_line (command_control_type type_, char *line_ = nullptr)
+ : line (line_),
+ control_type (type_)
+ {
+ memset (&control_u, 0, sizeof (control_u));
+ }
+
+ DISABLE_COPY_AND_ASSIGN (command_line);
+
+ struct command_line *next = nullptr;
+ char *line;
+ enum command_control_type control_type;
+ union
+ {
+ struct
+ {
+ enum compile_i_scope_types scope;
+ void *scope_data;
+ }
+ compile;
+ }
+ control_u;
+ /* * For composite commands, the nested lists of commands. For
+ example, for "if" command this will contain the then branch and
+ the else branch, if that is available. */
+ counted_command_line body_list_0;
+ counted_command_line body_list_1;
+
+private:
+
+ friend void free_command_lines (struct command_line **);
+
+ ~command_line ()
+ {
+ xfree (line);
+ }
+};
+
+extern counted_command_line read_command_lines
+ (const char *, int, int, gdb::function_view<void (const char *)>);
+extern counted_command_line read_command_lines_1
+ (gdb::function_view<const char * ()>, int,
+ gdb::function_view<void (const char *)>);
+
+