static int capture_writefloat(t_capture *x, float f, char *buf, int col, FILE *fp) { /* CHECKME linebreaks */ col = capture_formatfloat(x, f, buf, col, 80); return (fputs(buf, fp) < 0 ? -1 : col); }
static int capture_formatnumber(t_capture *x, float f, char *buf, int col, int maxcol) { char intmode = x->x_intmode; if (intmode == 'm') intmode = (f < 128 && f > -128 ? 'd' : 'x'); /* CHECKME */ if (intmode == 'x') col = capture_formatint((int)f, buf, col, maxcol, "%x"); else if (intmode) col = capture_formatint((int)f, buf, col, maxcol, "%d"); else col = capture_formatfloat(f, buf, col, maxcol, "%g"); return (col); }
static int capture_appendfloat(t_capture *x, float f, char *buf, int col, int linebreak) { /* CHECKME 80 columns */ col = capture_formatfloat(x, f, buf, col, 80); hammereditor_append(x->x_filehandle, buf); if (linebreak) { if (col) { hammereditor_append(x->x_filehandle, "\n\n"); col = 0; } else hammereditor_append(x->x_filehandle, "\n"); } return (col); }