static kOutputStream *new_OutputStreamStdOut(CTX, kString *enc) { kio_t *io2 = new_io2_stdio(_ctx, 1, 4096); kOutputStream *w = new_OutputStream(_ctx, io2, new_Path(_ctx, TS_DEVSTDOUT)); OutputStream_setAutoFlush(w, 1); return w; }
void mjd_to_date(double mjd, char *date_string, int size) { OutputStream *output; output = new_OutputStream(); if(!output) goto error; if(open_StringOutputStream(output, 0, date_string, size)) { close_OutputStream(output); goto error; }; if(output_utc(output, "", 0, 0, mjd)) { close_OutputStream(output); goto error; }; close_OutputStream(output); del_OutputStream(output); return; error: strncpy(date_string, "[error]", size); return; }
static kOutputStream *new_OutputStreamStdErr(CTX, kString *enc) { kio_t *io2 = new_io2_stdio(_ctx, 2, 0); return new_OutputStream(_ctx, io2, new_Path(_ctx, TS_DEVSTDERR)); }