\hypertarget{struct_protobuf_c_buffer_simple}{}\section{Protobuf\+C\+Buffer\+Simple Struct Reference}
\label{struct_protobuf_c_buffer_simple}\index{Protobuf\+C\+Buffer\+Simple@{Protobuf\+C\+Buffer\+Simple}}


{\ttfamily \#include $<$protobuf-\/c.\+h$>$}



Collaboration diagram for Protobuf\+C\+Buffer\+Simple\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=284pt]{struct_protobuf_c_buffer_simple__coll__graph}
\end{center}
\end{figure}
\subsection*{Data Fields}
\begin{DoxyCompactItemize}
\item 
\hyperlink{struct_protobuf_c_buffer}{Protobuf\+C\+Buffer} \hyperlink{struct_protobuf_c_buffer_simple_ad8ce6ae63116914ed76f57874e44ef92}{base}
\item 
size\+\_\+t \hyperlink{struct_protobuf_c_buffer_simple_ae6aa2af1e41a56eb2feef494cc3b63ed}{alloced}
\item 
size\+\_\+t \hyperlink{struct_protobuf_c_buffer_simple_a7360b55975153b822efc5217b7734e6a}{len}
\item 
\hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$ \hyperlink{struct_protobuf_c_buffer_simple_abe222f6d3581e7920dcad5306cc906a8}{data}
\item 
\hyperlink{group__api_ga98475218bcbd7a2171589414021c2633}{protobuf\+\_\+c\+\_\+boolean} \hyperlink{struct_protobuf_c_buffer_simple_adbaf2b97c06b8871d667e36cb5f5973f}{must\+\_\+free\+\_\+data}
\item 
\hyperlink{struct_protobuf_c_allocator}{Protobuf\+C\+Allocator} $\ast$ \hyperlink{struct_protobuf_c_buffer_simple_a2edfa16c1252117c2fde7da7b993c51c}{allocator}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Simple buffer \char`\"{}subclass\char`\"{} of {\ttfamily \hyperlink{struct_protobuf_c_buffer}{Protobuf\+C\+Buffer}}.

A {\ttfamily \hyperlink{struct_protobuf_c_buffer_simple}{Protobuf\+C\+Buffer\+Simple}} object is declared on the stack and uses a scratch buffer provided by the user for the initial allocation. It performs exponential resizing, using dynamically allocated memory. A {\ttfamily \hyperlink{struct_protobuf_c_buffer_simple}{Protobuf\+C\+Buffer\+Simple}} object can be created and used as follows\+:


\begin{DoxyCode}
\hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\_t} pad[128];
\hyperlink{struct_protobuf_c_buffer_simple}{ProtobufCBufferSimple} simple = 
      \hyperlink{group__api_ga1d0aff4451c876c7fa4df6c590feb775}{PROTOBUF\_C\_BUFFER\_SIMPLE\_INIT}(pad);
\hyperlink{struct_protobuf_c_buffer}{ProtobufCBuffer} *buffer = (\hyperlink{struct_protobuf_c_buffer}{ProtobufCBuffer} *) &simple;
\end{DoxyCode}


{\ttfamily buffer} can now be used with {\ttfamily \hyperlink{group__api_gaa1cde08f1ad1408209ed427f9e0647bc}{protobuf\+\_\+c\+\_\+message\+\_\+pack\+\_\+to\+\_\+buffer()}}. Once a message has been serialized to a {\ttfamily \hyperlink{struct_protobuf_c_buffer_simple}{Protobuf\+C\+Buffer\+Simple}} object, the serialized data bytes can be accessed from the {\ttfamily .data} field.

To free the memory allocated by a {\ttfamily \hyperlink{struct_protobuf_c_buffer_simple}{Protobuf\+C\+Buffer\+Simple}} object, if any, call \hyperlink{group__api_ga6ccc14c3d392606d993581def958522e}{P\+R\+O\+T\+O\+B\+U\+F\+\_\+\+C\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+S\+I\+M\+P\+L\+E\+\_\+\+C\+L\+E\+A\+R()} on the object, for example\+:


\begin{DoxyCode}
\hyperlink{group__api_ga6ccc14c3d392606d993581def958522e}{PROTOBUF\_C\_BUFFER\_SIMPLE\_CLEAR}(&simple);
\end{DoxyCode}


\begin{DoxySeeAlso}{See also}
\hyperlink{group__api_ga1d0aff4451c876c7fa4df6c590feb775}{P\+R\+O\+T\+O\+B\+U\+F\+\_\+\+C\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+S\+I\+M\+P\+L\+E\+\_\+\+I\+N\+IT} 

\hyperlink{group__api_ga6ccc14c3d392606d993581def958522e}{P\+R\+O\+T\+O\+B\+U\+F\+\_\+\+C\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+S\+I\+M\+P\+L\+E\+\_\+\+C\+L\+E\+AR} 
\end{DoxySeeAlso}


Definition at line 468 of file protobuf-\/c.\+h.



\subsection{Field Documentation}
\mbox{\Hypertarget{struct_protobuf_c_buffer_simple_a2edfa16c1252117c2fde7da7b993c51c}\label{struct_protobuf_c_buffer_simple_a2edfa16c1252117c2fde7da7b993c51c}} 
\index{Protobuf\+C\+Buffer\+Simple@{Protobuf\+C\+Buffer\+Simple}!allocator@{allocator}}
\index{allocator@{allocator}!Protobuf\+C\+Buffer\+Simple@{Protobuf\+C\+Buffer\+Simple}}
\subsubsection{\texorpdfstring{allocator}{allocator}}
{\footnotesize\ttfamily \hyperlink{struct_protobuf_c_allocator}{Protobuf\+C\+Allocator}$\ast$ allocator}

Allocator to use. May be N\+U\+LL to indicate the system allocator. 

Definition at line 480 of file protobuf-\/c.\+h.

\mbox{\Hypertarget{struct_protobuf_c_buffer_simple_ae6aa2af1e41a56eb2feef494cc3b63ed}\label{struct_protobuf_c_buffer_simple_ae6aa2af1e41a56eb2feef494cc3b63ed}} 
\index{Protobuf\+C\+Buffer\+Simple@{Protobuf\+C\+Buffer\+Simple}!alloced@{alloced}}
\index{alloced@{alloced}!Protobuf\+C\+Buffer\+Simple@{Protobuf\+C\+Buffer\+Simple}}
\subsubsection{\texorpdfstring{alloced}{alloced}}
{\footnotesize\ttfamily size\+\_\+t alloced}

Number of bytes allocated in {\ttfamily data}. 

Definition at line 472 of file protobuf-\/c.\+h.

\mbox{\Hypertarget{struct_protobuf_c_buffer_simple_ad8ce6ae63116914ed76f57874e44ef92}\label{struct_protobuf_c_buffer_simple_ad8ce6ae63116914ed76f57874e44ef92}} 
\index{Protobuf\+C\+Buffer\+Simple@{Protobuf\+C\+Buffer\+Simple}!base@{base}}
\index{base@{base}!Protobuf\+C\+Buffer\+Simple@{Protobuf\+C\+Buffer\+Simple}}
\subsubsection{\texorpdfstring{base}{base}}
{\footnotesize\ttfamily \hyperlink{struct_protobuf_c_buffer}{Protobuf\+C\+Buffer} base}

\char`\"{}\+Base class\char`\"{}. 

Definition at line 470 of file protobuf-\/c.\+h.

\mbox{\Hypertarget{struct_protobuf_c_buffer_simple_abe222f6d3581e7920dcad5306cc906a8}\label{struct_protobuf_c_buffer_simple_abe222f6d3581e7920dcad5306cc906a8}} 
\index{Protobuf\+C\+Buffer\+Simple@{Protobuf\+C\+Buffer\+Simple}!data@{data}}
\index{data@{data}!Protobuf\+C\+Buffer\+Simple@{Protobuf\+C\+Buffer\+Simple}}
\subsubsection{\texorpdfstring{data}{data}}
{\footnotesize\ttfamily \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t}$\ast$ data}

Data bytes. 

Definition at line 476 of file protobuf-\/c.\+h.

\mbox{\Hypertarget{struct_protobuf_c_buffer_simple_a7360b55975153b822efc5217b7734e6a}\label{struct_protobuf_c_buffer_simple_a7360b55975153b822efc5217b7734e6a}} 
\index{Protobuf\+C\+Buffer\+Simple@{Protobuf\+C\+Buffer\+Simple}!len@{len}}
\index{len@{len}!Protobuf\+C\+Buffer\+Simple@{Protobuf\+C\+Buffer\+Simple}}
\subsubsection{\texorpdfstring{len}{len}}
{\footnotesize\ttfamily size\+\_\+t len}

Number of bytes currently stored in {\ttfamily data}. 

Definition at line 474 of file protobuf-\/c.\+h.

\mbox{\Hypertarget{struct_protobuf_c_buffer_simple_adbaf2b97c06b8871d667e36cb5f5973f}\label{struct_protobuf_c_buffer_simple_adbaf2b97c06b8871d667e36cb5f5973f}} 
\index{Protobuf\+C\+Buffer\+Simple@{Protobuf\+C\+Buffer\+Simple}!must\+\_\+free\+\_\+data@{must\+\_\+free\+\_\+data}}
\index{must\+\_\+free\+\_\+data@{must\+\_\+free\+\_\+data}!Protobuf\+C\+Buffer\+Simple@{Protobuf\+C\+Buffer\+Simple}}
\subsubsection{\texorpdfstring{must\+\_\+free\+\_\+data}{must\_free\_data}}
{\footnotesize\ttfamily \hyperlink{group__api_ga98475218bcbd7a2171589414021c2633}{protobuf\+\_\+c\+\_\+boolean} must\+\_\+free\+\_\+data}

Whether {\ttfamily data} must be freed. 

Definition at line 478 of file protobuf-\/c.\+h.



The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
src/protobuf-\/c/\hyperlink{protobuf-c_8h}{protobuf-\/c.\+h}\end{DoxyCompactItemize}
