2014-04-10 22:35:45 -04:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv = "Content-Type" content = "text/xhtml;charset=UTF-8" />
< meta http-equiv = "X-UA-Compatible" content = "IE=9" />
2016-06-07 04:05:03 +00:00
< meta name = "generator" content = "Doxygen 1.8.9.1" />
2014-04-10 22:35:45 -04:00
< title > json-c: printbuf.h File Reference</ title >
< link href = "tabs.css" rel = "stylesheet" type = "text/css" />
< script type = "text/javascript" src = "jquery.js" ></ script >
< script type = "text/javascript" src = "dynsections.js" ></ script >
< link href = "doxygen.css" rel = "stylesheet" type = "text/css" />
</ head >
< body >
< div id = "top" > <!-- do not remove this div, it is closed by doxygen! -->
< div id = "titlearea" >
< table cellspacing = "0" cellpadding = "0" >
< tbody >
< tr style = "height: 56px;" >
< td style = "padding-left: 0.5em;" >
< div id = "projectname" > json-c
2016-06-07 04:05:03 +00:00
  < span id = "projectnumber" > 0.12.1</ span >
2014-04-10 22:35:45 -04:00
</ div >
</ td >
</ tr >
</ tbody >
</ table >
</ div >
<!-- end header part -->
2016-06-07 04:05:03 +00:00
<!-- Generated by Doxygen 1.8.9.1 -->
2014-04-10 22:35:45 -04:00
< div id = "navrow1" class = "tabs" >
< ul class = "tablist" >
< li >< a href = "index.html" >< span > Main  Page</ span ></ a ></ li >
< li >< a href = "pages.html" >< span > Related  Pages</ span ></ a ></ li >
< li >< a href = "annotated.html" >< span > Data  Structures</ span ></ a ></ li >
< li class = "current" >< a href = "files.html" >< span > Files</ span ></ a ></ li >
</ ul >
</ div >
< div id = "navrow2" class = "tabs2" >
< ul class = "tablist" >
< li >< a href = "files.html" >< span > File  List</ span ></ a ></ li >
< li >< a href = "globals.html" >< span > Globals</ span ></ a ></ li >
</ ul >
</ div >
</ div > <!-- top -->
< div class = "header" >
< div class = "summary" >
< a href = "#nested-classes" > Data Structures</ a > |
< a href = "#define-members" > Macros</ a > |
< a href = "#func-members" > Functions</ a > </ div >
< div class = "headertitle" >
< div class = "title" > printbuf.h File Reference</ div > </ div >
</ div > <!--header-->
< div class = "contents" >
< table class = "memberdecls" >
< tr class = "heading" >< td colspan = "2" >< h2 class = "groupheader" >< a name = "nested-classes" ></ a >
Data Structures</ h2 ></ td ></ tr >
< tr class = "memitem:" >< td class = "memItemLeft" align = "right" valign = "top" > struct   </ td >< td class = "memItemRight" valign = "bottom" >< a class = "el" href = "structprintbuf.html" > printbuf</ a ></ td ></ tr >
< tr class = "separator:" >< td class = "memSeparator" colspan = "2" >   </ td ></ tr >
</ table >< table class = "memberdecls" >
< tr class = "heading" >< td colspan = "2" >< h2 class = "groupheader" >< a name = "define-members" ></ a >
Macros</ h2 ></ td ></ tr >
2016-06-07 04:05:03 +00:00
< tr class = "memitem:a6f3a4dc87fab41c37e3eff42f40dc346" >< td class = "memItemLeft" align = "right" valign = "top" > #define  </ td >< td class = "memItemRight" valign = "bottom" >< a class = "el" href = "printbuf_8h.html#a6f3a4dc87fab41c37e3eff42f40dc346" > printbuf_memappend_fast</ a > (p, bufptr, bufsize)</ td ></ tr >
2014-04-10 22:35:45 -04:00
< tr class = "separator:a6f3a4dc87fab41c37e3eff42f40dc346" >< td class = "memSeparator" colspan = "2" >   </ td ></ tr >
< tr class = "memitem:acdd84ad88987c0166b7ba0e3f1f8f1bb" >< td class = "memItemLeft" align = "right" valign = "top" > #define  </ td >< td class = "memItemRight" valign = "bottom" >< a class = "el" href = "printbuf_8h.html#acdd84ad88987c0166b7ba0e3f1f8f1bb" > printbuf_length</ a > (p)    ((p)-> bpos)</ td ></ tr >
< tr class = "separator:acdd84ad88987c0166b7ba0e3f1f8f1bb" >< td class = "memSeparator" colspan = "2" >   </ td ></ tr >
</ table >< table class = "memberdecls" >
< tr class = "heading" >< td colspan = "2" >< h2 class = "groupheader" >< a name = "func-members" ></ a >
Functions</ h2 ></ td ></ tr >
< tr class = "memitem:a3e390ebc7660a18335edd89f640fd415" >< td class = "memItemLeft" align = "right" valign = "top" > struct < a class = "el" href = "structprintbuf.html" > printbuf</ a > *  </ td >< td class = "memItemRight" valign = "bottom" >< a class = "el" href = "printbuf_8h.html#a3e390ebc7660a18335edd89f640fd415" > printbuf_new</ a > (void)</ td ></ tr >
< tr class = "separator:a3e390ebc7660a18335edd89f640fd415" >< td class = "memSeparator" colspan = "2" >   </ td ></ tr >
< tr class = "memitem:a22f09779a19db59a83e7cb8c2ce4c75f" >< td class = "memItemLeft" align = "right" valign = "top" > int  </ td >< td class = "memItemRight" valign = "bottom" >< a class = "el" href = "printbuf_8h.html#a22f09779a19db59a83e7cb8c2ce4c75f" > printbuf_memappend</ a > (struct < a class = "el" href = "structprintbuf.html" > printbuf</ a > *p, const char *buf, int size)</ td ></ tr >
< tr class = "separator:a22f09779a19db59a83e7cb8c2ce4c75f" >< td class = "memSeparator" colspan = "2" >   </ td ></ tr >
< tr class = "memitem:ad7fc6ec4c296e85abf404244614cded5" >< td class = "memItemLeft" align = "right" valign = "top" > int  </ td >< td class = "memItemRight" valign = "bottom" >< a class = "el" href = "printbuf_8h.html#ad7fc6ec4c296e85abf404244614cded5" > printbuf_memset</ a > (struct < a class = "el" href = "structprintbuf.html" > printbuf</ a > *pb, int offset, int charvalue, int len)</ td ></ tr >
< tr class = "separator:ad7fc6ec4c296e85abf404244614cded5" >< td class = "memSeparator" colspan = "2" >   </ td ></ tr >
< tr class = "memitem:adf6214db6c8ce994c7f7f1180863c8a4" >< td class = "memItemLeft" align = "right" valign = "top" > int  </ td >< td class = "memItemRight" valign = "bottom" >< a class = "el" href = "printbuf_8h.html#adf6214db6c8ce994c7f7f1180863c8a4" > sprintbuf</ a > (struct < a class = "el" href = "structprintbuf.html" > printbuf</ a > *p, const char *msg,...)</ td ></ tr >
< tr class = "separator:adf6214db6c8ce994c7f7f1180863c8a4" >< td class = "memSeparator" colspan = "2" >   </ td ></ tr >
< tr class = "memitem:a4393ee3dedb376af11c96fe97532292e" >< td class = "memItemLeft" align = "right" valign = "top" > void  </ td >< td class = "memItemRight" valign = "bottom" >< a class = "el" href = "printbuf_8h.html#a4393ee3dedb376af11c96fe97532292e" > printbuf_reset</ a > (struct < a class = "el" href = "structprintbuf.html" > printbuf</ a > *p)</ td ></ tr >
< tr class = "separator:a4393ee3dedb376af11c96fe97532292e" >< td class = "memSeparator" colspan = "2" >   </ td ></ tr >
< tr class = "memitem:ab525221c767ac65c58ddeea8a655a4e8" >< td class = "memItemLeft" align = "right" valign = "top" > void  </ td >< td class = "memItemRight" valign = "bottom" >< a class = "el" href = "printbuf_8h.html#ab525221c767ac65c58ddeea8a655a4e8" > printbuf_free</ a > (struct < a class = "el" href = "structprintbuf.html" > printbuf</ a > *p)</ td ></ tr >
< tr class = "separator:ab525221c767ac65c58ddeea8a655a4e8" >< td class = "memSeparator" colspan = "2" >   </ td ></ tr >
</ table >
< h2 class = "groupheader" > Macro Definition Documentation</ h2 >
< a class = "anchor" id = "acdd84ad88987c0166b7ba0e3f1f8f1bb" ></ a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > #define printbuf_length</ td >
< td > (</ td >
< td class = "paramtype" >   </ td >
< td class = "paramname" > p</ td >< td > )</ td >
< td >     ((p)-> bpos)</ td >
</ tr >
</ table >
</ div >< div class = "memdoc" >
</ div >
</ div >
< a class = "anchor" id = "a6f3a4dc87fab41c37e3eff42f40dc346" ></ a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > #define printbuf_memappend_fast</ td >
< td > (</ td >
< td class = "paramtype" >   </ td >
< td class = "paramname" > p, </ td >
</ tr >
< tr >
< td class = "paramkey" ></ td >
< td ></ td >
< td class = "paramtype" >   </ td >
< td class = "paramname" > bufptr, </ td >
</ tr >
< tr >
< td class = "paramkey" ></ td >
< td ></ td >
< td class = "paramtype" >   </ td >
< td class = "paramname" > bufsize  </ td >
</ tr >
< tr >
< td ></ td >
< td > )</ td >
< td ></ td >< td ></ td >
</ tr >
</ table >
</ div >< div class = "memdoc" >
< b > Value:</ b >< div class = "fragment" >< div class = "line" >< span class = "keywordflow" > do</ span > { \</ div >
< div class = "line" > if ((p-> size - p-> bpos) > bufsize) { \</ div >
< div class = "line" > memcpy(p-> buf + p-> bpos, (bufptr), bufsize); \</ div >
< div class = "line" > p-> bpos += bufsize; \</ div >
< div class = "line" > p-> buf[p-> bpos]= < span class = "charliteral" > ' \0' </ span > ; \</ div >
< div class = "line" > } < span class = "keywordflow" > else</ span > { < a class = "code" href = "printbuf_8h.html#a22f09779a19db59a83e7cb8c2ce4c75f" > printbuf_memappend</ a > (p, (bufptr), bufsize); } \</ div >
< div class = "line" > } < span class = "keywordflow" > while</ span > (0)</ div >
< div class = "ttc" id = "printbuf_8h_html_a22f09779a19db59a83e7cb8c2ce4c75f" >< div class = "ttname" >< a href = "printbuf_8h.html#a22f09779a19db59a83e7cb8c2ce4c75f" > printbuf_memappend</ a ></ div >< div class = "ttdeci" > int printbuf_memappend(struct printbuf *p, const char *buf, int size)</ div ></ div >
</ div > <!-- fragment -->
</ div >
</ div >
< h2 class = "groupheader" > Function Documentation</ h2 >
< a class = "anchor" id = "ab525221c767ac65c58ddeea8a655a4e8" ></ a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > void printbuf_free </ td >
< td > (</ td >
< td class = "paramtype" > struct < a class = "el" href = "structprintbuf.html" > printbuf</ a > *  </ td >
< td class = "paramname" >< em > p</ em ></ td >< td > )</ td >
< td ></ td >
</ tr >
</ table >
</ div >< div class = "memdoc" >
</ div >
</ div >
< a class = "anchor" id = "a22f09779a19db59a83e7cb8c2ce4c75f" ></ a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > int printbuf_memappend </ td >
< td > (</ td >
< td class = "paramtype" > struct < a class = "el" href = "structprintbuf.html" > printbuf</ a > *  </ td >
< td class = "paramname" >< em > p</ em > , </ td >
</ tr >
< tr >
< td class = "paramkey" ></ td >
< td ></ td >
< td class = "paramtype" > const char *  </ td >
< td class = "paramname" >< em > buf</ em > , </ td >
</ tr >
< tr >
< td class = "paramkey" ></ td >
< td ></ td >
< td class = "paramtype" > int  </ td >
< td class = "paramname" >< em > size</ em >   </ td >
</ tr >
< tr >
< td ></ td >
< td > )</ td >
< td ></ td >< td ></ td >
</ tr >
</ table >
</ div >< div class = "memdoc" >
</ div >
</ div >
< a class = "anchor" id = "ad7fc6ec4c296e85abf404244614cded5" ></ a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > int printbuf_memset </ td >
< td > (</ td >
< td class = "paramtype" > struct < a class = "el" href = "structprintbuf.html" > printbuf</ a > *  </ td >
< td class = "paramname" >< em > pb</ em > , </ td >
</ tr >
< tr >
< td class = "paramkey" ></ td >
< td ></ td >
< td class = "paramtype" > int  </ td >
< td class = "paramname" >< em > offset</ em > , </ td >
</ tr >
< tr >
< td class = "paramkey" ></ td >
< td ></ td >
< td class = "paramtype" > int  </ td >
< td class = "paramname" >< em > charvalue</ em > , </ td >
</ tr >
< tr >
< td class = "paramkey" ></ td >
< td ></ td >
< td class = "paramtype" > int  </ td >
< td class = "paramname" >< em > len</ em >   </ td >
</ tr >
< tr >
< td ></ td >
< td > )</ td >
< td ></ td >< td ></ td >
</ tr >
</ table >
</ div >< div class = "memdoc" >
< p > Set len bytes of the buffer to charvalue, starting at offset offset. Similar to calling memset(x, charvalue, len);</ p >
< p > The memory allocated for the buffer is extended as necessary.</ p >
< p > If offset is -1, this starts at the end of the current data in the buffer. </ p >
</ div >
</ div >
< a class = "anchor" id = "a3e390ebc7660a18335edd89f640fd415" ></ a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > struct < a class = "el" href = "structprintbuf.html" > printbuf</ a > * printbuf_new </ td >
< td > (</ td >
< td class = "paramtype" > void  </ td >
< td class = "paramname" ></ td >< td > )</ td >
< td ></ td >
</ tr >
</ table >
</ div >< div class = "memdoc" >
</ div >
</ div >
< a class = "anchor" id = "a4393ee3dedb376af11c96fe97532292e" ></ a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > void printbuf_reset </ td >
< td > (</ td >
< td class = "paramtype" > struct < a class = "el" href = "structprintbuf.html" > printbuf</ a > *  </ td >
< td class = "paramname" >< em > p</ em ></ td >< td > )</ td >
< td ></ td >
</ tr >
</ table >
</ div >< div class = "memdoc" >
</ div >
</ div >
< a class = "anchor" id = "adf6214db6c8ce994c7f7f1180863c8a4" ></ a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > int sprintbuf </ td >
< td > (</ td >
< td class = "paramtype" > struct < a class = "el" href = "structprintbuf.html" > printbuf</ a > *  </ td >
< td class = "paramname" >< em > p</ em > , </ td >
</ tr >
< tr >
< td class = "paramkey" ></ td >
< td ></ td >
< td class = "paramtype" > const char *  </ td >
< td class = "paramname" >< em > msg</ em > , </ td >
</ tr >
< tr >
< td class = "paramkey" ></ td >
< td ></ td >
< td class = "paramtype" >   </ td >
< td class = "paramname" >< em > ...</ em >   </ td >
</ tr >
< tr >
< td ></ td >
< td > )</ td >
< td ></ td >< td ></ td >
</ tr >
</ table >
</ div >< div class = "memdoc" >
</ div >
</ div >
</ div > <!-- contents -->
<!-- start footer part -->
< hr class = "footer" />< address class = "footer" >< small >
2016-06-07 04:05:03 +00:00
Generated on Tue Jun 7 2016 20:51:02 for json-c by   < a href = "http://www.doxygen.org/index.html" >
2014-04-10 22:35:45 -04:00
< img class = "footer" src = "doxygen.png" alt = "doxygen" />
2016-06-07 04:05:03 +00:00
</ a > 1.8.9.1
2014-04-10 22:35:45 -04:00
</ small ></ address >
</ body >
</ html >