Remove VEC(tsv_s), use std::vector instead
[deliverable/binutils-gdb.git] / gdb / common / buffer.h
index c6abc8b3f861f9f74c7f904be85495da060b74ba..9806fd8ad8590c4f424bc0cb6393dabfa3c2d842 100644 (file)
@@ -1,6 +1,6 @@
 /* A simple growing buffer for GDB.
   
-   Copyright (C) 2009-2014 Free Software Foundation, Inc.
+   Copyright (C) 2009-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #ifndef BUFFER_H
 #define BUFFER_H
 
-#include <stddef.h>
-#include <string.h>
-#include "ansidecl.h"
-
 struct buffer
 {
   char *buffer;
@@ -35,13 +31,22 @@ struct buffer
    accommodate the new data.  */
 void buffer_grow (struct buffer *buffer, const char *data, size_t size);
 
+/* Append C to the end of BUFFER.  Grows the buffer to accommodate the
+   new data.  */
+
+static inline void
+buffer_grow_char (struct buffer *buffer, char c)
+{
+  buffer_grow (buffer, &c, 1);
+}
+
 /* Release any memory held by BUFFER.  */
 void buffer_free (struct buffer *buffer);
 
 /* Initialize BUFFER.  BUFFER holds no memory afterwards.  */
 void buffer_init (struct buffer *buffer);
 
-/* Return a pointer into BUFFER data, effectivelly transfering
+/* Return a pointer into BUFFER data, effectively transferring
    ownership of the buffer memory to the caller.  Calling buffer_free
    afterwards has no effect on the returned data.  */
 char* buffer_finish (struct buffer *buffer);
This page took 0.024856 seconds and 4 git commands to generate.