aboutsummaryrefslogtreecommitdiff
path: root/gdb/defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/defs.h')
-rw-r--r--gdb/defs.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/gdb/defs.h b/gdb/defs.h
index f689ec5..a0b586f 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -445,15 +445,29 @@ struct command_line
struct command_line **body_list;
};
-extern struct command_line *read_command_lines (char *, int, int,
- void (*)(char *, void *),
- void *);
-extern struct command_line *read_command_lines_1 (char * (*) (void), int,
- void (*)(char *, void *),
- void *);
-
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 *lines) const
+ {
+ free_command_lines (&lines);
+ }
+};
+
+/* A unique pointer to a command_line. */
+
+typedef std::unique_ptr<command_line, command_lines_deleter> command_line_up;
+
+extern command_line_up read_command_lines (char *, int, int,
+ void (*)(char *, void *),
+ void *);
+extern command_line_up read_command_lines_1 (char * (*) (void), int,
+ void (*)(char *, void *),
+ void *);
+
/* * Parameters of the "info proc" command. */
enum info_proc_what