MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / displayStatLine

Function displayStatLine

modules/dasSQLITE/sqlite/shell.c:18072–18093  ·  view source on GitHub ↗

** Display a single line of status using 64-bit values. */

Source from the content-addressed store, hash-verified

18070** Display a single line of status using 64-bit values.
18071*/
18072static void displayStatLine(
18073 ShellState *p, /* The shell context */
18074 char *zLabel, /* Label for this one line */
18075 char *zFormat, /* Format for the result */
18076 int iStatusCtrl, /* Which status to display */
18077 int bReset /* True to reset the stats */
18078){
18079 sqlite3_int64 iCur = -1;
18080 sqlite3_int64 iHiwtr = -1;
18081 int i, nPercent;
18082 char zLine[200];
18083 sqlite3_status64(iStatusCtrl, &iCur, &iHiwtr, bReset);
18084 for(i=0, nPercent=0; zFormat[i]; i++){
18085 if( zFormat[i]=='%' ) nPercent++;
18086 }
18087 if( nPercent>1 ){
18088 sqlite3_snprintf(sizeof(zLine), zLine, zFormat, iCur, iHiwtr);
18089 }else{
18090 sqlite3_snprintf(sizeof(zLine), zLine, zFormat, iHiwtr);
18091 }
18092 raw_printf(p->out, "%-36s %s\n", zLabel, zLine);
18093}
18094
18095/*
18096** Display memory stats.

Callers 1

display_statsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected