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

Function rdline_get_buffer

dpdk/lib/cmdline/cmdline_rdline.c:139–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139const char *
140rdline_get_buffer(struct rdline *rdl)
141{
142 if (!rdl)
143 return NULL;
144 unsigned int len_l, len_r;
145 cirbuf_align_left(&rdl->left);
146 cirbuf_align_left(&rdl->right);
147
148 len_l = CIRBUF_GET_LEN(&rdl->left);
149 len_r = CIRBUF_GET_LEN(&rdl->right);
150 memcpy(rdl->left_buf+len_l, rdl->right_buf, len_r);
151
152 rdl->left_buf[len_l + len_r] = '\n';
153 rdl->left_buf[len_l + len_r + 1] = '\0';
154 return rdl->left_buf;
155}
156
157static void
158display_right_buffer(struct rdline *rdl, int force)

Callers 3

rdline_char_inFunction · 0.85
cmdline_inFunction · 0.85
test_cmdline_rdline_fnsFunction · 0.85

Calls 2

cirbuf_align_leftFunction · 0.85
memcpyFunction · 0.50

Tested by 1

test_cmdline_rdline_fnsFunction · 0.68