** Display a single line of status using 64-bit values. */
| 12712 | ** Display a single line of status using 64-bit values. |
| 12713 | */ |
| 12714 | static void displayStatLine( |
| 12715 | ShellState *p, /* The shell context */ |
| 12716 | char *zLabel, /* Label for this one line */ |
| 12717 | char *zFormat, /* Format for the result */ |
| 12718 | int iStatusCtrl, /* Which status to display */ |
| 12719 | int bReset /* True to reset the stats */ |
| 12720 | ){ |
| 12721 | sqlite3_int64 iCur = -1; |
| 12722 | sqlite3_int64 iHiwtr = -1; |
| 12723 | int i, nPercent; |
| 12724 | char zLine[200]; |
| 12725 | sqlite3_status64(iStatusCtrl, &iCur, &iHiwtr, bReset); |
| 12726 | for(i=0, nPercent=0; zFormat[i]; i++){ |
| 12727 | if( zFormat[i]=='%' ) nPercent++; |
| 12728 | } |
| 12729 | if( nPercent>1 ){ |
| 12730 | sqlite3_snprintf(sizeof(zLine), zLine, zFormat, iCur, iHiwtr); |
| 12731 | }else{ |
| 12732 | sqlite3_snprintf(sizeof(zLine), zLine, zFormat, iHiwtr); |
| 12733 | } |
| 12734 | raw_printf(p->out, "%-36s %s\n", zLabel, zLine); |
| 12735 | } |
| 12736 | |
| 12737 | /* |
| 12738 | ** Display memory stats. |