int main(int argc, char* argv[]) { START_TRACE(); ribi::xml::Test(); const std::vector<std::string> args { ribi::MenuDialog::ConvertArguments(argc,argv) }; return ribi::TestDrawCanvasMenuDialog().Execute(args); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); START_TRACE(); TRACE("Creating QtResources"); ribi::Chess::QtResources(); TRACE("Testing Score"); ribi::Chess::Score::Test(); TRACE("Testing Square"); ribi::Chess::Square::Test(); TRACE("Testing BitBoard"); ribi::Chess::BitBoard::Test(); TRACE("Testing Move"); ribi::Chess::Move::Test(); TRACE("Testing Piece"); ribi::Chess::Piece::Test(); ribi::QtTestChessMenuDialog w; w.show(); return a.exec(); }
NCURSES_SP_NAME(filter) (NCURSES_SP_DCL0) { START_TRACE(); T((T_CALLED("filter"))); _nc_prescreen.filter_mode = TRUE; returnVoid; }
filter(void) { START_TRACE(); T((T_CALLED("filter"))); _nc_prescreen.filter_mode = TRUE; returnVoid; }
int main(int argc, char **argv) { START_TRACE(); ribi::WtAutoConfig::SaveDefaultStylesheet(); ribi::WtAutoConfig a(argc,argv,createApplication); return a.Run(); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); START_TRACE(); //Perform tests #ifndef NDEBUG std::clog << "DEBUG mode" << std::endl; QtPvdbMenuDialog::Test(); //Tests all #else std::clog << "RELEASE mode" << std::endl; assert(1==2 && "Assume debugging is really disabled"); #endif //Delete the test file std::remove(pvdb::File::GetTempFileName().c_str()); //QtPvdbMenuDialog::Test(); a.setStyleSheet(CreateStyleSheet().c_str()); a.setWindowIcon(QIcon(":/images/R.png")); QtPvdbMenuDialog d; d.show(); a.exec(); }
nofilter(void) { START_TRACE(); T((T_CALLED("nofilter()"))); _nc_prescreen.filter_mode = FALSE; returnVoid; }
int main(int argc, char *argv[]) { QApplication a(argc, argv); START_TRACE(); ribi::QtCreateGlossaryMenuDialog w; w.show(); return a.exec(); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); START_TRACE(); ribi::QtTestQuestionMenuDialog w; w.show(); return a.exec(); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); START_TRACE(); ribi::QtSimMysteryMachineMenuDialog w; w.show(); return a.exec(); }
int main(int argc, char* argv[]) { //Create a new empty trace file START_TRACE(); const auto args = ribi::ktclc::menu_dialog::convert_arguments(argc,argv); return ribi::ktclc::menu_dialog().execute(args); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); START_TRACE(); //a.setStyleSheet(CreateStyleSheet().c_str()); ribi::QtToolTestApproximatorMenuDialog d; d.show(); return a.exec(); }
use_extended_names(bool flag) { int oldflag = _nc_user_definable; START_TRACE(); T((T_CALLED("use_extended_names(%d)"), flag)); _nc_user_definable = flag; returnBool(oldflag); }
int main(int argc, char *argv[]) { std::signal(SIGABRT,OnAbort); QApplication a(argc, argv); START_TRACE(); ribi::QtCreateQtProjectZipFileMenuDialog w; w.show(); return a.exec(); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); START_TRACE(); a.setStyleSheet(CreateStyleSheet().c_str()); a.setWindowIcon(QIcon(":/images/R.png")); pvdb::File::Test(); QtPvdbConceptMapDialog d; d.show(); a.exec(); }
initscr(void) { WINDOW *result; START_TRACE(); T((T_CALLED("initscr()"))); _nc_init_pthreads(); _nc_lock_global(curses); /* Portable applications must not call initscr() more than once */ if (!_nc_globals.init_screen) { NCURSES_CONST char *name; _nc_globals.init_screen = TRUE; if ((name = getenv("TERM")) == 0 || *name == '\0') name = "unknown"; #ifdef __CYGWIN__ /* * 2002/9/21 * Work around a bug in Cygwin. Full-screen subprocesses run from * bash, in turn spawned from another full-screen process, will dump * core when attempting to write to stdout. Opening /dev/tty * explicitly seems to fix the problem. */ if (NC_ISATTY(fileno(stdout))) { FILE *fp = fopen("/dev/tty", "w"); if (fp != 0 && NC_ISATTY(fileno(fp))) { fclose(stdout); dup2(fileno(fp), STDOUT_FILENO); stdout = fdopen(STDOUT_FILENO, "w"); } } #endif if (newterm(name, stdout, stdin) == 0) { fprintf(stderr, "Error opening terminal: %s.\n", name); exit(EXIT_FAILURE); } /* def_shell_mode - done in newterm/_nc_setupscreen */ #if NCURSES_SP_FUNCS NCURSES_SP_NAME(def_prog_mode) (CURRENT_SCREEN); #else def_prog_mode(); #endif } result = stdscr; _nc_unlock_global(curses); returnWin(result); }
NCURSES_SP_NAME(nofilter) (NCURSES_SP_DCL0) { START_TRACE(); T((T_CALLED("nofilter(%p)"), (void *) SP_PARM)); #if NCURSES_SP_FUNCS if (IsPreScreen(SP_PARM)) { SP_PARM->_filtered = FALSE; } #else _nc_prescreen.filter_mode = FALSE; #endif returnVoid; }
initscr(void) { static bool initialized = FALSE; NCURSES_CONST char *name; int value; START_TRACE(); T((T_CALLED("initscr()"))); /* Portable applications must not call initscr() more than once */ if (!initialized) { initialized = TRUE; if ((name = getenv("TERM")) == 0 || *name == '\0') name = "unknown"; #ifdef __CYGWIN__ /* * 2002/9/21 * Work around a bug in Cygwin. Full-screen subprocesses run from * bash, in turn spawned from another full-screen process, will dump * core when attempting to write to stdout. Opening /dev/tty * explicitly seems to fix the problem. */ if (isatty(fileno(stdout))) { FILE *fp = fopen("/dev/tty", "w"); if (fp != 0 && isatty(fileno(fp))) { fclose(stdout); dup2(fileno(fp), STDOUT_FILENO); stdout = fdopen(STDOUT_FILENO, "w"); } } #endif if (newterm(name, stdout, stdin) == 0) { fprintf(stderr, "Error opening terminal: %s.\n", name); exit(EXIT_FAILURE); } /* allow user to set maximum escape delay from the environment */ if ((value = _nc_getenv_num("ESCDELAY")) >= 0) { ESCDELAY = value; } /* def_shell_mode - done in newterm/_nc_setupscreen */ def_prog_mode(); } returnWin(stdscr); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); START_TRACE(); #ifndef NDEBUG std::clog << "DEBUG mode" << std::endl; //QtPvdbMenuDialog::Test(); #else std::clog << "RELEASE mode" << std::endl; assert(1==2 && "Assume debugging is really disabled"); #endif ribi::ruco::QtRubiksClockMenuDialog d; d.show(); return a.exec(); }
int main() { //Guidelines: // - a line must have about 60 chars // - level = number_of_chars / 2 // - word length = 2 + (level / 3) // - a level must have about 10 lines // - every level must have about two new characters // - I do not care if words exist // - if a C++ construct exists, add it // - use all keys in the final level START_TRACE(); RandomizeTimer(); const auto v = KTouchLecture().ToXml(); std::ofstream f("cpp.ktouch.xml"); std::copy(v.begin(),v.end(),std::ostream_iterator<std::string>(f,"\n")); }
void HPL_pdpanel_init ( HPL_T_grid * GRID, HPL_T_palg * ALGO, const int M, const int N, const int JB, const int NB, HPL_T_pmat * A, const int IA, const int JA, const int TAG, HPL_T_panel * PANEL ) { /* * Purpose * ======= * * HPL_pdpanel_init initializes a panel data structure. * * * Arguments * ========= * * GRID (local input) HPL_T_grid * * On entry, GRID points to the data structure containing the * process grid information. * * ALGO (global input) HPL_T_palg * * On entry, ALGO points to the data structure containing the * algorithmic parameters. * * M (local input) const int * On entry, M specifies the global number of rows of the panel. * M must be at least zero. * * N (local input) const int * On entry, N specifies the global number of columns of the * panel and trailing submatrix. N must be at least zero. * * JB (global input) const int * On entry, JB specifies is the number of columns of the panel. * JB must be at least zero. * * A (local input/output) HPL_T_pmat * * On entry, A points to the data structure containing the local * array information. * * IA (global input) const int * On entry, IA is the global row index identifying the panel * and trailing submatrix. IA must be at least zero. * * JA (global input) const int * On entry, JA is the global column index identifying the panel * and trailing submatrix. JA must be at least zero. * * TAG (global input) const int * On entry, TAG is the row broadcast message id. * * PANEL (local input/output) HPL_T_panel * * On entry, PANEL points to the data structure containing the * panel information. * * --------------------------------------------------------------------- */ START_TRACE( PDPANEL_INIT ) /* * .. Local Variables .. */ size_t dalign; int icurcol, icurrow, ii, itmp1, jj, lwork, ml2, mp, mycol, myrow, npcol, nprow, nq, nu; int i; /* .. * .. Executable Statements .. */ PANEL->grid = GRID; /* ptr to the process grid */ PANEL->algo = ALGO; /* ptr to the algo parameters */ PANEL->pmat = A; /* ptr to the local array info */ myrow = GRID->myrow; mycol = GRID->mycol; nprow = GRID->nprow; npcol = GRID->npcol; HPL_infog2l( IA, JA, NB, NB, 0, 0, myrow, mycol, nprow, npcol, &ii, &jj, &icurrow, &icurcol, GRID ); mp = HPL_numrowI( M, IA, NB, myrow, nprow ); nq = HPL_numcolI( N, JA, NB, mycol, GRID ); /* ptr to trailing part of A */ PANEL->A = Mptr( (double *)(A->A), ii, jj, A->ld ); /* * Workspace pointers are initialized to NULL. */ PANEL->L2 = NULL; PANEL->L1 = NULL; PANEL->DPIV = NULL; PANEL->DINFO = NULL; PANEL->U = NULL; /* * Local lengths, indexes process coordinates */ PANEL->nb = NB; /* distribution blocking factor */ PANEL->jb = JB; /* panel width */ PANEL->m = M; /* global # of rows of trailing part of A */ PANEL->n = N; /* global # of cols of trailing part of A */ PANEL->ia = IA; /* global row index of trailing part of A */ PANEL->ja = JA; /* global col index of trailing part of A */ PANEL->mp = mp; /* local # of rows of trailing part of A */ PANEL->nq = nq; /* local # of cols of trailing part of A */ PANEL->ii = ii; /* local row index of trailing part of A */ PANEL->jj = jj; /* local col index of trailing part of A */ PANEL->lda = A->ld; /* local leading dim of array A */ PANEL->prow = icurrow; /* proc row owning 1st row of trailing A */ PANEL->pcol = icurcol; /* proc col owning 1st col of trailing A */ PANEL->msgid = TAG; /* message id to be used for panel bcast */ /* * Initialize ldl2 and len to temporary dummy values and Update tag for * next panel */ PANEL->ldl2 = 0; /* local leading dim of array L2 */ PANEL->len = 0; /* length of the buffer to broadcast */ /* * Figure out the exact amount of workspace needed by the factorization * and the update - Allocate that space - Finish the panel data structu- * re initialization. * * L1: JB x JB in all processes * DPIV: JB in all processes * DINFO: 1 in all processes * * We make sure that those three arrays are contiguous in memory for the * later panel broadcast. We also choose to put this amount of space * right after L2 (when it exist) so that one can receive a contiguous * buffer. */ dalign = ALGO->align * sizeof( double ); if( npcol == 1 ) /* P x 1 process grid */ { /* space for L1, DPIV, DINFO */ lwork = ALGO->align + ( PANEL->len = JB * JB + JB + 1 ); if( nprow > 1 ) /* space for U */ { nu = nq - JB; if (nu % 8) nu += 8 - nu % 8; if (nu % 16 == 0) nu += 8; lwork += JB * Mmax( 0, nu ) + ALGO->align; } //printf("WORK1 %d of %d\n", (int) lwork, (int) panel_max_lwork); if (lwork > PANEL->memalloc) { for (i = 0;i < PANEL_PREALLOC_COUNT;i++) { if (p_lwork[i] != NULL && lwork <= panel_max_lwork) { PANEL->WORK = p_lwork[i]; PANEL->memalloc = panel_max_lwork; p_lwork[i] = NULL; break; } } if (i == PANEL_PREALLOC_COUNT) { HPL_pabort( __LINE__, "HPL_pdpanel_init", "Problem with preallocated panel memory"); } /* if (PANEL->WORK) { CALDGEMM_free(PANEL->WORK); fprintf(STD_OUT, "WARNING, reallocating Panel memory\n"); } if( !( PANEL->WORK = (void *) CALDGEMM_alloc( (size_t)(lwork) * sizeof( double ), 0) ) ) { HPL_pabort( __LINE__, "HPL_pdpanel_init", "Memory allocation failed" ); } PANEL->memalloc = lwork;*/ } /* * Initialize the pointers of the panel structure - Always re-use A in * the only process column */ PANEL->L2 = PANEL->A + ( myrow == icurrow ? JB : 0 ); PANEL->ldl2 = A->ld; PANEL->L1 = (double *)HPL_PTR( PANEL->WORK, dalign ); PANEL->DPIV = PANEL->L1 + JB * JB; PANEL->DINFO = PANEL->DPIV + JB; *(PANEL->DINFO) = 0.0; PANEL->U = ( nprow > 1 ? (double*) HPL_PTR( (PANEL->DINFO + 1), dalign ) : NULL ); } else { /* space for L2, L1, DPIV */ ml2 = ( myrow == icurrow ? mp - JB : mp ); ml2 = Mmax( 0, ml2 ); PANEL->len = ml2*JB + ( itmp1 = JB*JB + JB + 1 ); #ifdef HPL_COPY_L lwork = ALGO->align + PANEL->len; #else lwork = ALGO->align + ( mycol == icurcol ? itmp1 : PANEL->len ); #endif if( nprow > 1 ) /* space for U */ { nu = ( mycol == icurcol ? nq - JB : nq ); if (nu % 8) nu += 8 - nu % 8; if (nu % 16 == 0) nu += 8; lwork += JB * Mmax( 0, nu ) + ALGO->align; } //printf("WORK2 %d of %d\n", (int) lwork, (int) panel_max_lwork); if (lwork > PANEL->memalloc) { for (i = 0;i < PANEL_PREALLOC_COUNT;i++) { if (p_lwork[i] != NULL && lwork <= panel_max_lwork) { PANEL->WORK = p_lwork[i]; PANEL->memalloc = panel_max_lwork; p_lwork[i] = NULL; break; } } if (i == PANEL_PREALLOC_COUNT) { HPL_pabort( __LINE__, "HPL_pdpanel_init", "Problem with preallocated panel memory"); } /* if (PANEL->WORK) { CALDGEMM_free(PANEL->WORK); fprintf(STD_OUT, "WARNING, reallocating Panel memory\n"); } if( !( PANEL->WORK = (void *) CALDGEMM_alloc( (size_t)(lwork) * sizeof( double ),0 ) ) ) { HPL_pabort( __LINE__, "HPL_pdpanel_init", "Memory allocation failed" ); } PANEL->memalloc = lwork;*/ } /* * Initialize the pointers of the panel structure - Re-use A in the cur- * rent process column when HPL_COPY_L is not defined. */ #ifdef HPL_COPY_L PANEL->L2 = (double *)HPL_PTR( PANEL->WORK, dalign ); PANEL->ldl2 = Mmax( 1, ml2 ); PANEL->L1 = PANEL->L2 + ml2 * JB; #else if( mycol == icurcol ) { PANEL->L2 = PANEL->A + ( myrow == icurrow ? JB : 0 ); PANEL->ldl2 = A->ld; PANEL->L1 = (double *)HPL_PTR( PANEL->WORK, dalign ); } else { PANEL->L2 = (double *)HPL_PTR( PANEL->WORK, dalign ); PANEL->ldl2 = Mmax( 1, ml2 ); PANEL->L1 = PANEL->L2 + ml2 * JB; } #endif PANEL->DPIV = PANEL->L1 + JB * JB; PANEL->DINFO = PANEL->DPIV + JB; *(PANEL->DINFO) = 0.0; if (nprow > 1) { PANEL->U = (double *)HPL_PTR( (PANEL->DINFO + 1), dalign ); } } /* * If nprow is 1, we just allocate an array of JB integers for the swap. * When nprow > 1, we allocate the space for the index arrays immediate- * ly. The exact size of this array depends on the swapping routine that * will be used, so we allocate the maximum: * * IWORK[0] is of size at most 1 + * IPL is of size at most 1 + * IPID is of size at most 4 * JB + * * For HPL_pdlaswp00: * lindxA is of size at most 2 * JB + * lindxAU is of size at most 2 * JB + * llen is of size at most NPROW + * llen_sv is of size at most NPROW. * * For HPL_pdlaswp01: * ipA is of size ar most 1 + * lindxA is of size at most 2 * JB + * lindxAU is of size at most 2 * JB + * iplen is of size at most NPROW + 1 + * ipmap is of size at most NPROW + * ipmapm1 is of size at most NPROW + * permU is of size at most JB + * iwork is of size at most MAX( 2*JB, NPROW+1 ). * * that is 3 + 8*JB + MAX(2*NPROW, 3*NPROW+1+JB+MAX(2*JB,NPROW+1)) * = 4 + 9*JB + 3*NPROW + MAX( 2*JB, NPROW+1 ). * * We use the fist entry of this to work array to indicate whether the * the local index arrays have already been computed, and if yes, by * which function: * IWORK[0] = -1: no index arrays have been computed so far; * IWORK[0] = 0: HPL_pdlaswp00 already computed those arrays; * IWORK[0] = 1: HPL_pdlaswp01 already computed those arrays; * This allows to save some redundant and useless computations. */ if( nprow == 1 ) { lwork = JB; } else { itmp1 = (JB << 1); lwork = nprow + 1; itmp1 = Mmax( itmp1, lwork ); lwork = 4 + (9 * JB) + (3 * nprow) + itmp1; } //printf("IWORK3 %d of %d\n", (int) lwork, (int) panel_max_ilwork); if (lwork > PANEL->memallocI) { /*if (PANEL->IWORK) { CALDGEMM_free(PANEL->IWORK); fprintf(STD_OUT, "WARNING, reallocating Panel memory\n"); } PANEL->IWORK = (int *) CALDGEMM_alloc( (size_t)(lwork) * sizeof( int ), 0 ); PANEL->memallocI = lwork;*/ for (i = 0;i < PANEL_PREALLOC_COUNT;i++) { if (p_ilwork[i] != NULL && lwork <= panel_max_ilwork) { PANEL->IWORK = (int*) p_ilwork[i]; PANEL->memallocI = panel_max_ilwork; p_ilwork[i] = NULL; break; } } if (i == PANEL_PREALLOC_COUNT) { HPL_pabort( __LINE__, "HPL_pdpanel_init", "Problem with preallocated panel memory"); } } if( PANEL->IWORK == NULL ) { HPL_pabort( __LINE__, "HPL_pdpanel_init", "Memory allocation failed" ); } /* Initialize the first entry of the workarray */ *(PANEL->IWORK) = -1; END_TRACE /* * End of HPL_pdpanel_init */ }
NCURSES_SP_NAME(newterm) (NCURSES_SP_DCLx NCURSES_CONST char *name, FILE *ofp, FILE *ifp) { int value; int errret; SCREEN *result = 0; SCREEN *current; TERMINAL *its_term; FILE *_ofp = ofp ? ofp : stdout; FILE *_ifp = ifp ? ifp : stdin; int cols; int slk_format; int filter_mode; TERMINAL *new_term = 0; START_TRACE(); T((T_CALLED("newterm(%p, \"%s\", %p,%p)"), (void *) SP_PARM, name, (void *) ofp, (void *) ifp)); #if NCURSES_SP_FUNCS assert(SP_PARM != 0); if (SP_PARM == 0) returnSP(SP_PARM); #endif _nc_init_pthreads(); _nc_lock_global(curses); current = CURRENT_SCREEN; its_term = (current ? current->_term : 0); INIT_TERM_DRIVER(); /* this loads the capability entry, then sets LINES and COLS */ if ( #if NCURSES_SP_FUNCS SP_PARM->_prescreen && #endif TINFO_SETUP_TERM(&new_term, name, fileno(_ofp), &errret, FALSE) != ERR) { _nc_set_screen(0); #ifdef USE_TERM_DRIVER assert(new_term != 0); #endif #if NCURSES_SP_FUNCS slk_format = SP_PARM->slk_format; filter_mode = SP_PARM->_filtered; #else slk_format = _nc_globals.slk_format; filter_mode = _nc_prescreen.filter_mode; #endif /* * This actually allocates the screen structure, and saves the original * terminal settings. */ if (NCURSES_SP_NAME(_nc_setupscreen) ( #if NCURSES_SP_FUNCS &SP_PARM, #endif *(ptrLines(SP_PARM)), *(ptrCols(SP_PARM)), _ofp, filter_mode, slk_format) == ERR) { _nc_set_screen(current); result = 0; } else { #ifdef USE_TERM_DRIVER TERMINAL_CONTROL_BLOCK *TCB; #elif !NCURSES_SP_FUNCS SP_PARM = CURRENT_SCREEN; #endif assert(SP_PARM != 0); cols = *(ptrCols(SP_PARM)); #ifdef USE_TERM_DRIVER _nc_set_screen(SP_PARM); TCB = (TERMINAL_CONTROL_BLOCK *) new_term; TCB->csp = SP_PARM; #endif /* * In setupterm() we did a set_curterm(), but it was before we set * CURRENT_SCREEN. So the "current" screen's terminal pointer was * overwritten with a different terminal. Later, in * _nc_setupscreen(), we set CURRENT_SCREEN and the terminal * pointer in the new screen. * * Restore the terminal-pointer for the pre-existing screen, if * any. */ if (current) current->_term = its_term; #ifdef USE_TERM_DRIVER SP_PARM->_term = new_term; #else new_term = SP_PARM->_term; #endif /* allow user to set maximum escape delay from the environment */ if ((value = _nc_getenv_num("ESCDELAY")) >= 0) { NCURSES_SP_NAME(set_escdelay) (NCURSES_SP_ARGx value); } /* if the terminal type has real soft labels, set those up */ if (slk_format && NumLabels > 0 && SLK_STDFMT(slk_format)) _nc_slk_initialize(StdScreen(SP_PARM), cols); SP_PARM->_ifd = fileno(_ifp); NCURSES_SP_NAME(typeahead) (NCURSES_SP_ARGx fileno(_ifp)); #ifdef TERMIOS SP_PARM->_use_meta = ((new_term->Ottyb.c_cflag & CSIZE) == CS8 && !(new_term->Ottyb.c_iflag & ISTRIP)); #else SP_PARM->_use_meta = FALSE; #endif SP_PARM->_endwin = FALSE; #ifndef USE_TERM_DRIVER /* * Check whether we can optimize scrolling under dumb terminals in * case we do not have any of these capabilities, scrolling * optimization will be useless. */ SP_PARM->_scrolling = ((scroll_forward && scroll_reverse) || ((parm_rindex || parm_insert_line || insert_line) && (parm_index || parm_delete_line || delete_line))); #endif NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG); /* sets a field in the screen structure */ SP_PARM->_keytry = 0; /* compute movement costs so we can do better move optimization */ #ifdef USE_TERM_DRIVER TCBOf(SP_PARM)->drv->scinit(SP_PARM); #else /* * Check for mismatched graphic-rendition capabilities. Most SVr4 * terminfo trees contain entries that have rmul or rmso equated to * sgr0 (Solaris curses copes with those entries). We do this only * for curses, since many termcap applications assume that * smso/rmso and smul/rmul are paired, and will not function * properly if we remove rmso or rmul. Curses applications * shouldn't be looking at this detail. */ #define SGR0_TEST(mode) (mode != 0) && (exit_attribute_mode == 0 || strcmp(mode, exit_attribute_mode)) SP_PARM->_use_rmso = SGR0_TEST(exit_standout_mode); SP_PARM->_use_rmul = SGR0_TEST(exit_underline_mode); /* compute movement costs so we can do better move optimization */ _nc_mvcur_init(); /* initialize terminal to a sane state */ _nc_screen_init(); #endif /* Initialize the terminal line settings. */ _nc_initscr(NCURSES_SP_ARG); _nc_signal_handler(TRUE); result = SP_PARM; } } _nc_unlock_global(curses); returnSP(result); }
int main(int argc, char* argv[]) { START_TRACE(); const std::vector<std::string> args { ribi::MenuDialog::ConvertArguments(argc,argv) }; return ribi::TestQtCreatorProFileMenuDialog().Execute(args); }
void HPL_dtrsv ( const enum HPL_ORDER ORDER, const enum HPL_UPLO UPLO, const enum HPL_TRANS TRANS, const enum HPL_DIAG DIAG, const int N, const double * A, const int LDA, double * X, const int INCX ) { /* * Purpose * ======= * * HPL_dtrsv solves one of the systems of equations * * A * x = b, or A^T * x = b, * * where b and x are n-element vectors and A is an n by n non-unit, or * unit, upper or lower triangular matrix. * * No test for singularity or near-singularity is included in this * routine. Such tests must be performed before calling this routine. * * Arguments * ========= * * ORDER (local input) const enum HPL_ORDER * On entry, ORDER specifies the storage format of the operands * as follows: * ORDER = HplRowMajor, * ORDER = HplColumnMajor. * * UPLO (local input) const enum HPL_UPLO * On entry, UPLO specifies whether the upper or lower * triangular part of the array A is to be referenced. When * UPLO==HplUpper, only the upper triangular part of A is to be * referenced, otherwise only the lower triangular part of A is * to be referenced. * * TRANS (local input) const enum HPL_TRANS * On entry, TRANS specifies the equations to be solved as * follows: * TRANS==HplNoTrans A * x = b, * TRANS==HplTrans A^T * x = b. * * DIAG (local input) const enum HPL_DIAG * On entry, DIAG specifies whether A is unit triangular or * not. When DIAG==HplUnit, A is assumed to be unit triangular, * and otherwise, A is not assumed to be unit triangular. * * N (local input) const int * On entry, N specifies the order of the matrix A. N must be at * least zero. * * A (local input) const double * * On entry, A points to an array of size equal to or greater * than LDA * n. Before entry with UPLO==HplUpper, the leading * n by n upper triangular part of the array A must contain the * upper triangular matrix and the strictly lower triangular * part of A is not referenced. When UPLO==HplLower on entry, * the leading n by n lower triangular part of the array A must * contain the lower triangular matrix and the strictly upper * triangular part of A is not referenced. * * Note that when DIAG==HplUnit, the diagonal elements of A * not referenced either, but are assumed to be unity. * * LDA (local input) const int * On entry, LDA specifies the leading dimension of A as * declared in the calling (sub) program. LDA must be at * least MAX(1,n). * * X (local input/output) double * * On entry, X is an incremented array of dimension at least * ( 1 + ( n - 1 ) * abs( INCX ) ) that contains the vector x. * Before entry, the incremented array X must contain the n * element right-hand side vector b. On exit, X is overwritten * with the solution vector x. * * INCX (local input) const int * On entry, INCX specifies the increment for the elements of X. * INCX must not be zero. * * --------------------------------------------------------------------- */ START_TRACE( DTRSV ) cblas_dtrsv( ORDER, UPLO, TRANS, DIAG, N, A, LDA, X, INCX ); END_TRACE /* * End of HPL_dtrsv */ }
newterm(NCURSES_CONST char *name, FILE *ofp, FILE *ifp) { int value; int errret; SCREEN *current; SCREEN *result = 0; TERMINAL *its_term; START_TRACE(); T((T_CALLED("newterm(\"%s\",%p,%p)"), name, ofp, ifp)); _nc_init_pthreads(); _nc_lock_global(curses); current = SP; its_term = (SP ? SP->_term : 0); /* this loads the capability entry, then sets LINES and COLS */ if (setupterm(name, fileno(ofp), &errret) != ERR) { int slk_format = _nc_globals.slk_format; /* * This actually allocates the screen structure, and saves the original * terminal settings. */ _nc_set_screen(0); /* allow user to set maximum escape delay from the environment */ if ((value = _nc_getenv_num("ESCDELAY")) >= 0) { set_escdelay(value); } if (_nc_setupscreen(LINES, COLS, ofp, _nc_prescreen.filter_mode, slk_format) == ERR) { _nc_set_screen(current); result = 0; } else { assert(SP != 0); /* * In setupterm() we did a set_curterm(), but it was before we set * SP. So the "current" screen's terminal pointer was overwritten * with a different terminal. Later, in _nc_setupscreen(), we set * SP and the terminal pointer in the new screen. * * Restore the terminal-pointer for the pre-existing screen, if * any. */ if (current) current->_term = its_term; /* if the terminal type has real soft labels, set those up */ if (slk_format && num_labels > 0 && SLK_STDFMT(slk_format)) _nc_slk_initialize(stdscr, COLS); SP->_ifd = fileno(ifp); typeahead(fileno(ifp)); #ifdef TERMIOS SP->_use_meta = ((cur_term->Ottyb.c_cflag & CSIZE) == CS8 && !(cur_term->Ottyb.c_iflag & ISTRIP)); #else SP->_use_meta = FALSE; #endif SP->_endwin = FALSE; /* * Check whether we can optimize scrolling under dumb terminals in * case we do not have any of these capabilities, scrolling * optimization will be useless. */ SP->_scrolling = ((scroll_forward && scroll_reverse) || ((parm_rindex || parm_insert_line || insert_line) && (parm_index || parm_delete_line || delete_line))); baudrate(); /* sets a field in the SP structure */ SP->_keytry = 0; /* * Check for mismatched graphic-rendition capabilities. Most SVr4 * terminfo trees contain entries that have rmul or rmso equated to * sgr0 (Solaris curses copes with those entries). We do this only * for curses, since many termcap applications assume that * smso/rmso and smul/rmul are paired, and will not function * properly if we remove rmso or rmul. Curses applications * shouldn't be looking at this detail. */ #define SGR0_TEST(mode) (mode != 0) && (exit_attribute_mode == 0 || strcmp(mode, exit_attribute_mode)) SP->_use_rmso = SGR0_TEST(exit_standout_mode); SP->_use_rmul = SGR0_TEST(exit_underline_mode); /* compute movement costs so we can do better move optimization */ _nc_mvcur_init(); /* initialize terminal to a sane state */ _nc_screen_init(); /* Initialize the terminal line settings. */ _nc_initscr(); _nc_signal_handler(TRUE); result = SP; } } _nc_unlock_global(curses); returnSP(result); }
tgetent(char *bufp, const char *name) { int errcode; int n; bool found_cache = FALSE; START_TRACE(); T((T_CALLED("tgetent()"))); _nc_setupterm((NCURSES_CONST char *) name, STDOUT_FILENO, &errcode, TRUE); /* * In general we cannot tell if the fixed sgr0 is still used by the * caller, but if tgetent() is called with the same buffer, that is * good enough, since the previous data would be invalidated by the * current call. * * bufp may be a null pointer, e.g., GNU termcap. That allocates data, * which is good until the next tgetent() call. The conventional termcap * is inconvenient because of the fixed buffer size, but because it uses * caller-supplied buffers, can have multiple terminal descriptions in * use at a given time. */ for (n = 0; n < TGETENT_MAX; ++n) { bool same_result = (MyCache[n].last_used && MyCache[n].last_bufp == bufp); if (same_result) { CacheInx = n; if (FIX_SGR0 != 0) { FreeAndNull(FIX_SGR0); } /* * Also free the terminfo data that we loaded (much bigger leak). */ if (LAST_TRM != 0 && LAST_TRM != cur_term) { TERMINAL *trm = LAST_TRM; del_curterm(LAST_TRM); for (CacheInx = 0; CacheInx < TGETENT_MAX; ++CacheInx) if (LAST_TRM == trm) LAST_TRM = 0; CacheInx = n; } found_cache = TRUE; break; } } if (!found_cache) { int best = 0; for (CacheInx = 0; CacheInx < TGETENT_MAX; ++CacheInx) { if (LAST_SEQ < MyCache[best].sequence) { best = CacheInx; } } CacheInx = best; } LAST_TRM = cur_term; LAST_SEQ = ++CacheSeq; PC = 0; UP = 0; BC = 0; FIX_SGR0 = 0; /* don't free it - application may still use */ if (errcode == 1) { if (cursor_left) if ((backspaces_with_bs = (char) !strcmp(cursor_left, "\b")) == 0) backspace_if_not_bs = cursor_left; /* we're required to export these */ if (pad_char != NULL) PC = pad_char[0]; if (cursor_up != NULL) UP = cursor_up; if (backspace_if_not_bs != NULL) BC = backspace_if_not_bs; if ((FIX_SGR0 = _nc_trim_sgr0(&(cur_term->type))) != 0) { if (!strcmp(FIX_SGR0, exit_attribute_mode)) { if (FIX_SGR0 != exit_attribute_mode) { free(FIX_SGR0); } FIX_SGR0 = 0; } } LAST_BUF = bufp; LAST_USE = TRUE; SetNoPadding(SP); (void) baudrate(); /* sets ospeed as a side-effect */ /* LINT_PREPRO #if 0*/ #include <capdefaults.c> /* LINT_PREPRO #endif*/ } #ifdef FREEBSD_NATIVE /* * This is a REALLY UGLY hack. Basically, if we originate with * a termcap source, try and copy it out. */ if (bufp && _nc_termcap[0]) strncpy(bufp, _nc_termcap, 1024); #endif returnCode(errcode); }
int main(int argc, char* argv[]) { START_TRACE(); // Declare the supported options. boost::program_options::options_description d("Allowed options for CreateQtProjectZipFile"); std::string source_folder; std::string target_filename; d.add_options() ("about","displays the 'About' information") ("help","produce this help message") ("source_folder", boost::program_options::value<std::string>(&source_folder), "Source folder containing one or more .pro files, must start with '../../'") ("target_filename", boost::program_options::value<std::string>(&target_filename)->default_value("zip.sh"), "the generated script's designed filename") ("version","displays the version") ; boost::program_options::variables_map m; boost::program_options::store( boost::program_options::parse_command_line( argc, argv, d), m); boost::program_options::notify(m); if (m.count("help")) { std::cout << d << "\n"; std::cout << "\n" << "Example use: \n" << "./ToolCreateQtProjectZipFileConsole --source_folder ../../Projects/ProjectRichelBilderbeek\n"; return 0; } if (m.count("about")) { std::cout << CreateQtProjectZipFile::MenuDialog::GetAbout() << "\n"; return 0; } if (m.count("version")) { std::cout << CreateQtProjectZipFile::MenuDialog::GetVersion() << "\n"; return 0; } if (source_folder.empty()) { std::cout << "Please submit a source folder or use '--help'.\n"; std::cout << "\n" << "Example use: \n" << "./ToolCreateQtProjectZipFileConsole --source_folder ../../Projects/ProjectRichelBilderbeek\n"; return 0; } if (source_folder.size() < 6 || source_folder.substr(0,6) != std::string("../../")) { std::cout << "Please submit a source folder that starts with '../../'.\n"; std::cout << "\n" << "Example use: \n" << "./ToolCreateQtProjectZipFileConsole --source_folder ../../Projects/ProjectRichelBilderbeek\n"; return 0; } const std::string script = QtCreatorProFileZipScript::CreateScript(source_folder); std::ofstream f(target_filename.c_str()); f << script; #ifndef NDEBUG std::cout << f; #endif }
NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) { int rc = ERR; int n; bool found_cache = FALSE; #ifdef USE_TERM_DRIVER TERMINAL *termp = 0; #endif START_TRACE(); T((T_CALLED("tgetent()"))); TINFO_SETUP_TERM(&termp, (NCURSES_CONST char *) name, STDOUT_FILENO, &rc, TRUE); #ifdef USE_TERM_DRIVER if (termp == 0 || !((TERMINAL_CONTROL_BLOCK *) termp)->drv->isTerminfo) returnCode(rc); #endif /* * In general we cannot tell if the fixed sgr0 is still used by the * caller, but if tgetent() is called with the same buffer, that is * good enough, since the previous data would be invalidated by the * current call. * * bufp may be a null pointer, e.g., GNU termcap. That allocates data, * which is good until the next tgetent() call. The conventional termcap * is inconvenient because of the fixed buffer size, but because it uses * caller-supplied buffers, can have multiple terminal descriptions in * use at a given time. */ for (n = 0; n < TGETENT_MAX; ++n) { bool same_result = (MyCache[n].last_used && MyCache[n].last_bufp == bufp); if (same_result) { CacheInx = n; if (FIX_SGR0 != 0) { FreeAndNull(FIX_SGR0); } /* * Also free the terminfo data that we loaded (much bigger leak). */ if (LAST_TRM != 0 && LAST_TRM != TerminalOf(SP_PARM)) { TERMINAL *trm = LAST_TRM; NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx LAST_TRM); for (CacheInx = 0; CacheInx < TGETENT_MAX; ++CacheInx) if (LAST_TRM == trm) LAST_TRM = 0; CacheInx = n; } found_cache = TRUE; break; } } if (!found_cache) { int best = 0; for (CacheInx = 0; CacheInx < TGETENT_MAX; ++CacheInx) { if (LAST_SEQ < MyCache[best].sequence) { best = CacheInx; } } CacheInx = best; } if (rc == 1) { LAST_TRM = TerminalOf(SP_PARM); LAST_SEQ = ++CacheSeq; } else { LAST_TRM = 0; } PC = 0; UP = 0; BC = 0; FIX_SGR0 = 0; /* don't free it - application may still use */ if (rc == 1) { if (cursor_left) if ((backspaces_with_bs = (char) !strcmp(cursor_left, "\b")) == 0) backspace_if_not_bs = cursor_left; /* we're required to export these */ if (pad_char != NULL) PC = pad_char[0]; if (cursor_up != NULL) UP = cursor_up; if (backspace_if_not_bs != NULL) BC = backspace_if_not_bs; if ((FIX_SGR0 = _nc_trim_sgr0(&TerminalType(TerminalOf(SP_PARM)))) != 0) { if (!strcmp(FIX_SGR0, exit_attribute_mode)) { if (FIX_SGR0 != exit_attribute_mode) { free(FIX_SGR0); } FIX_SGR0 = 0; } } LAST_BUF = bufp; LAST_USE = TRUE; SetNoPadding(SP_PARM); (void) NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG); /* sets ospeed as a side-effect */ /* LINT_PREPRO #if 0*/ #include <capdefaults.c> /* LINT_PREPRO #endif*/ } returnCode(rc); }
int HPL_sdrv ( double * SBUF, int SCOUNT, int STAG, double * RBUF, int RCOUNT, int RTAG, int PARTNER, MPI_Comm COMM ) { /* * Purpose * ======= * * HPL_sdrv is a simple wrapper around MPI_Sendrecv. Its main purpose is * to allow for some experimentation and tuning of this simple function. * Messages of length less than or equal to zero are not sent nor * received. Successful completion is indicated by the returned error * code HPL_SUCCESS. * * Arguments * ========= * * SBUF (local input) double * * On entry, SBUF specifies the starting address of buffer to be * sent. * * SCOUNT (local input) int * On entry, SCOUNT specifies the number of double precision * entries in SBUF. SCOUNT must be at least zero. * * STAG (local input) int * On entry, STAG specifies the message tag to be used for the * sending communication operation. * * RBUF (local output) double * * On entry, RBUF specifies the starting address of buffer to be * received. * * RCOUNT (local input) int * On entry, RCOUNT specifies the number of double precision * entries in RBUF. RCOUNT must be at least zero. * * RTAG (local input) int * On entry, RTAG specifies the message tag to be used for the * receiving communication operation. * * PARTNER (local input) int * On entry, PARTNER specifies the rank of the collaborative * process in the communication space defined by COMM. * * COMM (local input) MPI_Comm * The MPI communicator identifying the communication space. * * --------------------------------------------------------------------- */ START_TRACE( SDRV ) /* * .. Local Variables .. */ #ifdef HPL_USE_MPI_DATATYPE MPI_Datatype type[2]; #endif MPI_Request request; MPI_Status status; int ierr; /* .. * .. Executable Statements .. */ if( RCOUNT > 0 ) { if( SCOUNT > 0 ) { #ifdef HPL_USE_MPI_DATATYPE /* * Post asynchronous receive */ ierr = MPI_Type_contiguous( RCOUNT, MPI_DOUBLE, &type[0] ); if( ierr == MPI_SUCCESS ) { ierr = MPI_Type_commit( &type[0] ); } if( ierr == MPI_SUCCESS ) { ierr = MPI_Irecv( (void *)(RBUF), 1, type[0], PARTNER, RTAG, COMM, &request ); } /* * Blocking send */ if( ierr == MPI_SUCCESS ) { ierr = MPI_Type_contiguous( SCOUNT, MPI_DOUBLE, &type[1] ); } if( ierr == MPI_SUCCESS ) { ierr = MPI_Type_commit( &type[1] ); } if( ierr == MPI_SUCCESS ) { ierr = MPI_Send( (void *)(SBUF), 1, type[1], PARTNER, STAG, COMM ); } if( ierr == MPI_SUCCESS ) { ierr = MPI_Type_free( &type[1] ); } /* * Wait for the receive to complete */ if( ierr == MPI_SUCCESS ) { ierr = MPI_Wait( &request, &status ); } if( ierr == MPI_SUCCESS ) { ierr = MPI_Type_free( &type[0] ); } #else /* * Post asynchronous receive */ ierr = MPI_Irecv( (void *)(RBUF), RCOUNT, MPI_DOUBLE, PARTNER, RTAG, COMM, &request ); /* * Blocking send */ if( ierr == MPI_SUCCESS ) { ierr = MPI_Send( (void *)(SBUF), SCOUNT, MPI_DOUBLE, PARTNER, STAG, COMM ); } /* * Wait for the receive to complete */ if( ierr == MPI_SUCCESS ) { ierr = MPI_Wait( &request, &status ); } #endif } else { /* * Blocking receive */ #ifdef HPL_USE_MPI_DATATYPE ierr = MPI_Type_contiguous( RCOUNT, MPI_DOUBLE, &type[0] ); if( ierr == MPI_SUCCESS ) { ierr = MPI_Type_commit( &type[0] ); } if( ierr == MPI_SUCCESS ) { ierr = MPI_Recv( (void *)(RBUF), 1, type[0], PARTNER, RTAG, COMM, &status ); } if( ierr == MPI_SUCCESS ) { ierr = MPI_Type_free( &type[0] ); } #else ierr = MPI_Recv( (void *)(RBUF), RCOUNT, MPI_DOUBLE, PARTNER, RTAG, COMM, &status ); #endif } } else if( SCOUNT > 0 ) { /* * Blocking send */ #ifdef HPL_USE_MPI_DATATYPE ierr = MPI_Type_contiguous( SCOUNT, MPI_DOUBLE, &type[1] ); if( ierr == MPI_SUCCESS ) { ierr = MPI_Type_commit( &type[1] ); } if( ierr == MPI_SUCCESS ) { ierr = MPI_Send( (void *)(SBUF), 1, type[1], PARTNER, STAG, COMM ); } if( ierr == MPI_SUCCESS ) { ierr = MPI_Type_free( &type[1] ) ); }
int main(int argc, char* argv[]) { START_TRACE(); const std::vector<std::string> args { ribi::MenuDialog::ConvertArguments(argc,argv) }; return ribi::c2h::CodeToHtmlMenuDialog().Execute(args); }