Introduce command_line_up
[deliverable/binutils-gdb.git] / gdb / defs.h
index f689ec5048a91509de907d2a3854ada5d1b22e19..a0b586f401eca205334e9f237081f4da97c83aa1 100644 (file)
@@ -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
This page took 0.023813 seconds and 4 git commands to generate.