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

Function db_putchar

freebsd/ddb/db_output.c:121–144  ·  view source on GitHub ↗

* Output character. Buffer whitespace. */

Source from the content-addressed store, hash-verified

119 * Output character. Buffer whitespace.
120 */
121static void
122db_putchar(int c, void *arg)
123{
124 struct dbputchar_arg *dap = arg;
125
126 if (dap->da_pbufr == NULL) {
127 /* No bufferized output is provided. */
128 db_putc(c);
129 } else {
130 *dap->da_pnext++ = c;
131 dap->da_remain--;
132
133 /* Leave always the buffer 0 terminated. */
134 *dap->da_pnext = '\0';
135
136 /* Check if the buffer needs to be flushed. */
137 if (dap->da_remain < 2 || c == '\n') {
138 db_puts(dap->da_pbufr);
139 dap->da_pnext = dap->da_pbufr;
140 dap->da_remain = dap->da_nbufr;
141 *dap->da_pnext = '\0';
142 }
143 }
144}
145
146static void
147db_putc(int c)

Callers

nothing calls this directly

Calls 2

db_putcFunction · 0.85
db_putsFunction · 0.85

Tested by

no test coverage detected