MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cbor_append

Function cbor_append

tools/libxo/encoder/cbor/enc_cbor.c:166–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166static void
167cbor_append (xo_handle_t *xop, cbor_private_t *cbor, xo_buffer_t *xbp,
168 unsigned major, unsigned minor, const char *data)
169{
170 if (!xo_buf_has_room(xbp, minor + 2))
171 return;
172
173 unsigned offset = xo_buf_offset(xbp);
174
175 *xbp->xb_curp = major;
176 cbor_encode_uint(xbp, minor, CBOR_ULIMIT);
177 if (data)
178 xo_buf_append(xbp, data, minor);
179
180 if (xo_get_flags(xop) & XOF_PRETTY)
181 cbor_memdump(stdout, "append", xo_buf_data(xbp, offset),
182 xbp->xb_curp - xbp->xb_bufp - offset, "",
183 cbor->c_indent * 2);
184}
185
186static int
187cbor_create (xo_handle_t *xop)

Callers 3

cbor_createFunction · 0.85
cbor_contentFunction · 0.85
cbor_handlerFunction · 0.85

Calls 7

xo_buf_has_roomFunction · 0.85
xo_buf_offsetFunction · 0.85
cbor_encode_uintFunction · 0.85
xo_buf_appendFunction · 0.85
xo_get_flagsFunction · 0.85
cbor_memdumpFunction · 0.85
xo_buf_dataFunction · 0.85

Tested by

no test coverage detected