Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Provisional API: This reference documents current compiler behavior. Compatibility is not yet promised.

src/report.x

Command progress and completion receipts.

Functions

FunctionSummary
report_configureResets process reporting for one command.
report_durationFormats microseconds as integer us, rounded whole ms, or seconds with two decimal places.
report_file_bytesReturns the size of a regular file.
report_lineWrites one newline-terminated receipt to stderr when receipts are enabled.
report_now_usReturns monotonic time in microseconds, or zero when the clock read fails.
report_phaseWrites a muted phase receipt when receipts are enabled.
report_progressUpdates the terminal’s transient progress line when transient mode is active.
report_receiptsReturns whether stable completion receipts are currently enabled.
report_sizeFormats bytes as B, KiB, or MiB using binary unit boundaries.
report_suspendClears the active transient line from stderr, if one exists.

Functions

report_configure

void report_configure( int quiet, int plain, Symbol color_mode, int verbose, int dry_run, int inspecting)

Resets process reporting for one command. Quiet, verbose, dry-run, and inspection modes disable receipts. Transient progress additionally requires terminal stderr, non-plain output, and no parent Make recipe. Plain output disables color; automatic color respects terminal capability and NO_COLOR.

Source: src/report.x:105

report_duration

String report_duration(unsigned long microseconds)

Formats microseconds as integer us, rounded whole ms, or seconds with two decimal places.

Source: src/report.x:54

report_file_bytes

unsigned long long report_file_bytes(String path)

Returns the size of a regular file. NULL, a failed stat, or a non-regular path returns zero.

Source: src/report.x:45

report_line

void report_line(Symbol tone, String line)

Writes one newline-terminated receipt to stderr when receipts are enabled. Any active transient line is cleared first, and line must be non-NULL.

Source: src/report.x:184

report_now_us

unsigned long report_now_us(void)

Returns monotonic time in microseconds, or zero when the clock read fails. The value measures elapsed time; it is not a wall-clock timestamp.

Source: src/report.x:35

report_phase

void report_phase( Symbol phase, int count, String noun, int cached, unsigned long microseconds)

Writes a muted phase receipt when receipts are enabled. A fully cached nonempty phase is marked up to date; a partial cache reports its cached count, and every receipt includes the elapsed time.

Source: src/report.x:232

report_progress

void report_progress(Symbol phase, int done, int total, String detail)

Updates the terminal’s transient progress line when transient mode is active. Updates start after 125 ms and incomplete work is limited to one update per 50 ms. detail may be NULL; output is clipped to the configured terminal width and has no newline.

Source: src/report.x:196

report_receipts

int report_receipts(void)

Returns whether stable completion receipts are currently enabled.

Source: src/report.x:122

report_size

String report_size(unsigned long long bytes)

Formats bytes as B, KiB, or MiB using binary unit boundaries. Byte counts are exact; larger units use one decimal place.

Source: src/report.x:63

report_suspend

void report_suspend(void)

Clears the active transient line from stderr, if one exists.

Source: src/report.x:175

Design notes

The reporter writes only to stderr. Its transient mode uses one carriage- return line and never takes terminal input or changes terminal modes.