void RenderChangePicture (FD fd, const unsigned char *buf) { RenderRequestHeader (fd, buf); if (Verbose < 1) return; printreqlen(buf, fd, DVALUE2(3+n)); PrintField(buf, 4, 4, PICTURE, "picture"); PrintField(buf, 8, 4, PICTURE_BITMASK, "value-mask"); PrintValues(&buf[8], 4, PICTURE_BITMASK, &buf[12], "value-list"); }
void RenderCreatePicture (FD fd, const unsigned char *buf) { RenderRequestHeader (fd, buf); if (Verbose < 1) return; printreqlen(buf, fd, DVALUE2(5+n)); PrintField(buf, 4, 4, PICTURE, "picture"); PrintField(buf, 8, 4, DRAWABLE, "drawable"); PrintField(buf, 12, 4, PICTFORMAT, "format"); PrintField(buf, 16, 4, PICTURE_BITMASK, "value-mask"); PrintValues(&buf[16], 4, PICTURE_BITMASK, &buf[20], "value-list"); }
//打印整个语法树 int TSyntaxTreeAnalyse::Print(TMdbSqlParser * pSqlParser,int iLogType) { //#if 0 ST_SQL_STRUCT & stSqlStruct = pSqlParser->m_stSqlStruct; OutPutInfo(iLogType,"#################SqlStruct start################"); OutPutInfo(iLogType,"=========================================="); OutPutInfo(iLogType,"Insert(%d),delete(%d),update(%d),select(%d)",TK_INSERT,TK_DELETE,TK_UPDATE,TK_SELECT); OutPutInfo(iLogType,"[type = %d],[tablename = %s][alias = %s][pMdbTable = %p][pShmDSN= %p][pScanAllIndex= %p][vIndexUsed=%d]", stSqlStruct.iSqlType, ReplaceNull(stSqlStruct.sTableName), ReplaceNull(stSqlStruct.sAlias), stSqlStruct.pMdbTable,stSqlStruct.pShmDSN, stSqlStruct.pScanAllIndex, stSqlStruct.vIndexUsed.size()); OutPutInfo(iLogType,"===========[index used]=================="); PrintIndex(stSqlStruct.vIndexUsed,0,iLogType); OutPutInfo(iLogType,"===========[column list]=================="); PrintExprList(stSqlStruct.pColList,0,iLogType); OutPutInfo(iLogType,"===========[where]========================"); PrintExpr("root",stSqlStruct.pWhere,0,iLogType); OutPutInfo(iLogType,"===========[group by]========================"); PrintExprList(stSqlStruct.pGroupby,0,iLogType); OutPutInfo(iLogType,"===========[having]========================"); PrintExpr("root",stSqlStruct.pHaving,0,iLogType); OutPutInfo(iLogType,"===========[optimised where]=================="); PrintWhereClause(iLogType,stSqlStruct.tWhereOrClause); OutPutInfo(iLogType,"===========[orderby]======================"); PrintExprList(stSqlStruct.pOrderby,0,iLogType); OutPutInfo(iLogType,"===========[limit]========================"); PrintExpr("root",stSqlStruct.pstLimit,0,iLogType); OutPutInfo(iLogType,"===========[offset]======================="); PrintExpr("root",stSqlStruct.pstOffset,0,iLogType); OutPutInfo(iLogType,"===========[idlist]======================="); PrintIdList(stSqlStruct.pstIdList,0,iLogType); OutPutInfo(iLogType,"=========================================="); PrintValues(pSqlParser,iLogType); OutPutInfo(iLogType,"#################SqlStruct end#################"); _ST_DDL_SQL_STRUCT * pstDDLSqlStruct = pSqlParser->m_pDDLSqlStruct; OutPutInfo(iLogType,"###############DDLSqlStruct start##############"); if(pstDDLSqlStruct) { OutPutInfo(iLogType,"[sqltype = [%d][%d]][IfNE = %d]",pstDDLSqlStruct->iSqlType[0],pstDDLSqlStruct->iSqlType[1] ,pstDDLSqlStruct->bIfNE); PrintTable(pstDDLSqlStruct->pTable,iLogType); } OutPutInfo(iLogType,"###############DDLSqlStruct end################"); //#endif return 0; }
void PrintContents(const Container &cont, const char *contName) { std::cout<< "Printing contents of " << contName << std::endl; std::for_each(cont.begin(), cont.end(), PrintValues()); std::cout<< std::endl << std::endl; }
static void PrintExtraInfoLossy(const WebPPicture* const pic, int short_output, int full_details, const char* const file_name) { const WebPAuxStats* const stats = pic->stats; if (short_output) { fprintf(stderr, "%7d %2.2f\n", stats->coded_size, stats->PSNR[3]); } else { const int num_i4 = stats->block_count[0]; const int num_i16 = stats->block_count[1]; const int num_skip = stats->block_count[2]; const int total = num_i4 + num_i16; fprintf(stderr, "File: %s\n", file_name); fprintf(stderr, "Dimension: %d x %d%s\n", pic->width, pic->height, stats->alpha_data_size ? " (with alpha)" : ""); fprintf(stderr, "Output: " "%d bytes Y-U-V-All-PSNR %2.2f %2.2f %2.2f %2.2f dB\n", stats->coded_size, stats->PSNR[0], stats->PSNR[1], stats->PSNR[2], stats->PSNR[3]); if (total > 0) { int totals[4] = { 0, 0, 0, 0 }; fprintf(stderr, "block count: intra4: %d\n" " intra16: %d (-> %.2f%%)\n", num_i4, num_i16, 100.f * num_i16 / total); fprintf(stderr, " skipped block: %d (%.2f%%)\n", num_skip, 100.f * num_skip / total); fprintf(stderr, "bytes used: header: %6d (%.1f%%)\n" " mode-partition: %6d (%.1f%%)\n", stats->header_bytes[0], 100.f * stats->header_bytes[0] / stats->coded_size, stats->header_bytes[1], 100.f * stats->header_bytes[1] / stats->coded_size); if (stats->alpha_data_size > 0) { fprintf(stderr, " transparency: %6d (%.1f dB)\n", stats->alpha_data_size, stats->PSNR[4]); } fprintf(stderr, " Residuals bytes " "|segment 1|segment 2|segment 3" "|segment 4| total\n"); if (full_details) { fprintf(stderr, " intra4-coeffs: "); PrintByteCount(stats->residual_bytes[0], stats->coded_size, totals); fprintf(stderr, " intra16-coeffs: "); PrintByteCount(stats->residual_bytes[1], stats->coded_size, totals); fprintf(stderr, " chroma coeffs: "); PrintByteCount(stats->residual_bytes[2], stats->coded_size, totals); } fprintf(stderr, " macroblocks: "); PrintPercents(stats->segment_size, total); fprintf(stderr, " quantizer: "); PrintValues(stats->segment_quant); fprintf(stderr, " filter level: "); PrintValues(stats->segment_level); if (full_details) { fprintf(stderr, "------------------+---------"); fprintf(stderr, "+---------+---------+---------+-----------------\n"); fprintf(stderr, " segments total: "); PrintByteCount(totals, stats->coded_size, NULL); } } if (stats->lossless_size > 0) { PrintFullLosslessInfo(stats, "alpha"); } } }
int main( int argc, char *argv[] ) { int n; Arg Args[MAX_ARGS]; int i; Widget Text; Widget Window; Pixmap WindPixmap; Pixmap TextPixmap; CommonTestInit(argc, argv); /* Get the pixmaps for the backgrounds */ WindPixmap = XmGetPixmap(screen, WINDOW_PIXMAP, BlackPixelOfScreen(screen), WhitePixelOfScreen(screen)); TextPixmap = XmGetPixmap(screen, TEXT_PIXMAP, BlackPixelOfScreen(screen), WhitePixelOfScreen(screen)); if (!WindPixmap) { (void)printf("Can't make pixmap for file %s!\n", WINDOW_PIXMAP ); exit(1); } if (!TextPixmap) { (void)printf("Can't make pixmap for file %s!\n", TEXT_PIXMAP ); exit(1); } /* Make the ScrolledWindow and Text */ n = 0; XtSetArg( Args[n], XmNvalue, Strings ); n++; XtSetArg( Args[n], XmNeditable, False ); n++; XtSetArg( Args[n], XmNeditMode, XmMULTI_LINE_EDIT ); n++; Text = XmCreateScrolledText(Shell1, "Text", Args, n ); /* Get the Widget for the parent Scrolled Window */ Window = XtParent(Text); /* Set the Text Pixmap and color */ n = 0; XtSetArg(Args[n], XmNbackgroundPixmap, TextPixmap ); n++; XtSetValues( Text, Args, n ); SetWidgetColor( Text, "white" ); /* Set the Window Pixmap and color */ n = 0; XtSetArg(Args[n], XmNbackgroundPixmap, WindPixmap ); n++; XtSetValues( Window, Args, n ); SetWidgetColor( Window, "pink" ); XtManageChild(Text); XtManageChild(Window); /************* * Assertion 1. Now that the text and window have differing pixmaps, * lets dump the values for the child scrollbar values. */ PrintValues( Window, "Assertion 1" ); CommonPause(); /************* * Assertion 2. Now that the text and window have differing pixmaps, * lets dump the values for the child scrollbar values. */ SetWidgetColor( Text, "green" ); PrintValues( Window, "Assertion 2" ); CommonPause(); /* Cleanup Time */ XmDestroyPixmap( screen, WindPixmap ); XmDestroyPixmap( screen, TextPixmap ); XtDestroyWidget( XtParent(Text) ); CommonPause(); XtAppMainLoop(app_context); return 0; }
static void PrintExtraInfoLossy(const WebPPicture* const pic, int short_output, int full_details, const char* const file_name) { const WebPAuxStats* const stats = pic->stats; if (short_output) { fprintf(stderr, "%7d %2.2f\n", stats->coded_size, stats->PSNR[3]); } else { const int num_i4 = stats->block_count[0]; const int num_i16 = stats->block_count[1]; const int num_skip = stats->block_count[2]; const int total = num_i4 + num_i16; fprintf(stderr, "File: %s\n", file_name); fprintf(stderr, "Dimension: %d x %d%s\n", pic->width, pic->height, stats->alpha_data_size ? " (with alpha)" : ""); fprintf(stderr, "Output: " "%d bytes Y-U-V-All-PSNR %2.2f %2.2f %2.2f %2.2f dB\n", stats->coded_size, stats->PSNR[0], stats->PSNR[1], stats->PSNR[2], stats->PSNR[3]); if (total > 0) { int totals[4] = { 0, 0, 0, 0 }; fprintf(stderr, "block count: intra4: %d\n" " intra16: %d (-> %.2f%%)\n", num_i4, num_i16, 100.f * num_i16 / total); fprintf(stderr, " skipped block: %d (%.2f%%)\n", num_skip, 100.f * num_skip / total); fprintf(stderr, "bytes used: header: %6d (%.1f%%)\n" " mode-partition: %6d (%.1f%%)\n", stats->header_bytes[0], 100.f * stats->header_bytes[0] / stats->coded_size, stats->header_bytes[1], 100.f * stats->header_bytes[1] / stats->coded_size); if (stats->alpha_data_size > 0) { fprintf(stderr, " transparency: %6d (%.1f dB)\n", stats->alpha_data_size, stats->PSNR[4]); } if (stats->layer_data_size) { fprintf(stderr, " enhancement: %6d\n", stats->layer_data_size); } fprintf(stderr, " Residuals bytes " "|segment 1|segment 2|segment 3" "|segment 4| total\n"); if (full_details) { fprintf(stderr, " intra4-coeffs: "); PrintByteCount(stats->residual_bytes[0], stats->coded_size, totals); fprintf(stderr, " intra16-coeffs: "); PrintByteCount(stats->residual_bytes[1], stats->coded_size, totals); fprintf(stderr, " chroma coeffs: "); PrintByteCount(stats->residual_bytes[2], stats->coded_size, totals); } fprintf(stderr, " macroblocks: "); PrintPercents(stats->segment_size, total); fprintf(stderr, " quantizer: "); PrintValues(stats->segment_quant); fprintf(stderr, " filter level: "); PrintValues(stats->segment_level); if (full_details) { fprintf(stderr, "------------------+---------"); fprintf(stderr, "+---------+---------+---------+-----------------\n"); fprintf(stderr, " segments total: "); PrintByteCount(totals, stats->coded_size, NULL); } } if (stats->lossless_size > 0) { PrintFullLosslessInfo(stats, "alpha"); } } if (pic->extra_info != NULL) { const int mb_w = (pic->width + 15) / 16; const int mb_h = (pic->height + 15) / 16; const int type = pic->extra_info_type; int x, y; for (y = 0; y < mb_h; ++y) { for (x = 0; x < mb_w; ++x) { const int c = pic->extra_info[x + y * mb_w]; if (type == 1) { // intra4/intra16 printf("%c", "+."[c]); } else if (type == 2) { // segments printf("%c", ".-*X"[c]); } else if (type == 3) { // quantizers printf("%.2d ", c); } else if (type == 6 || type == 7) { printf("%3d ", c); } else { printf("0x%.2x ", c); } } printf("\n"); } } }
int main(void) { int choice; int ret; ret = eXdbmInit(); if(ret==-1) { ErrorMessage(); return(EXIT_FAILURE); } choice=-1; while(choice!=12) { choice = MainMenu(); switch(choice) { case 1 : OpenDatabase(); break; case 2 : NewDatabase(); break; case 3 : CloseDatabase(); break; case 4 : UpdateDatabase(); break; case 5 : BackupDatabase(); break; case 6 : ReloadDatabase(); break; case 7 : PrintDatabase(); break; case 8 : PrintValues(); break; case 9 : AddEntry(); break; case 10: ChangeEntry(); break; case 11 : DeleteEntry(); break; } } printf("\n\nBye bye ...\n"); return(1); }