Normalize include guards in gdb
[deliverable/binutils-gdb.git] / gdb / common / buffer.h
index 2a47db4cc09d8bc866d667376909274529ab5cf6..8b24b54d0eb1e22a5db717f6317718c599f1963c 100644 (file)
@@ -1,6 +1,6 @@
 /* A simple growing buffer for GDB.
   
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -17,8 +17,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef BUFFER_H
-#define BUFFER_H
+#ifndef COMMON_BUFFER_H
+#define COMMON_BUFFER_H
 
 struct buffer
 {
@@ -31,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);
@@ -56,4 +65,4 @@ void buffer_xml_printf (struct buffer *buffer, const char *format, ...)
 #define buffer_grow_str0(BUFFER,STRING)                        \
   buffer_grow (BUFFER, STRING, strlen (STRING) + 1)
 
-#endif
+#endif /* COMMON_BUFFER_H */
This page took 0.030094 seconds and 4 git commands to generate.