这篇教程C++ tty_printf函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中tty_printf函数的典型用法代码示例。如果您正苦于以下问题:C++ tty_printf函数的具体用法?C++ tty_printf怎么用?C++ tty_printf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了tty_printf函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: overwrite_filep/* * Check whether FNAME exists and ask if it's okay to overwrite an * existing one. * Returns: True: it's okay to overwrite or the file does not exist * False: Do not overwrite */intoverwrite_filep( const char *fname ){ if ( iobuf_is_pipe_filename (fname) ) return 1; /* Writing to stdout is always okay. */ if ( access( fname, F_OK ) ) return 1; /* Does not exist. */ if ( !compare_filenames (fname, NAME_OF_DEV_NULL) ) return 1; /* Does not do any harm. */ if (opt.answer_yes) return 1; if (opt.answer_no || opt.batch) return 0; /* Do not overwrite. */ tty_printf (_("File '%s' exists. "), fname); if (cpr_enabled ()) tty_printf ("/n"); if (cpr_get_answer_is_yes ("openfile.overwrite.okay", _("Overwrite? (y/N) ")) ) return 1; return 0;}
开发者ID:0ndorio,项目名称:gnupg,代码行数:31,
示例2: __attribute____attribute__((constructor)) void prime(){ unsigned prime[MAX]; unsigned tested_value = 2; unsigned next_empty_slot = 0; unsigned is_prime; unsigned i; tty_printf("*** Starting Prime Computation ***/n/n"); while (1) { is_prime = TRUE; for( i=0 ; i<next_empty_slot ; i++ ) { if( tested_value%prime[i] == 0 ) is_prime = FALSE; } if ( is_prime ) { prime[next_empty_slot] = tested_value; tty_printf("prime[%d] = %d/n", next_empty_slot, tested_value); next_empty_slot++; if( next_empty_slot == MAX) { tty_printf("prime table full/n"); exit(); } } tested_value++; }} // end main
开发者ID:Masshat,项目名称:Mp-Soc,代码行数:31,
示例3: gather_random/**************** * Note: Using a level of 0 should never block and better add nothing * to the pool. This is easy to accomplish with /dev/urandom. */static intgather_random( void (*add)(const void*, size_t, int), int requester, size_t length, int level ){ static int fd_urandom = -1; static int fd_random = -1; int fd; int n; int warn=0; byte buffer[768]; if( level >= 2 ) { if( fd_random == -1 ) fd_random = open_device( NAME_OF_DEV_RANDOM, 8 ); fd = fd_random; } else { /* this will also be used for elve 0 but by using /dev/urandom * we can be sure that oit will never block. */ if( fd_urandom == -1 ) fd_urandom = open_device( NAME_OF_DEV_URANDOM, 9 ); fd = fd_urandom; } #if 0 #ifdef HAVE_DEV_RANDOM_IOCTL g10_log_info("entropy count of %d is %lu/n", fd, get_entropy_count(fd) ); #endif #endif while( length ) { fd_set rfds; struct timeval tv; int rc; FD_ZERO(&rfds); FD_SET(fd, &rfds); tv.tv_sec = 3; tv.tv_usec = 0; if( !(rc=select(fd+1, &rfds, NULL, NULL, &tv)) ) { if( !warn ) #ifdef IS_MODULE fprintf(stderr, #else tty_printf( #endif_("/n""Not enough random bytes available. Please do some other work to give/n""the OS a chance to collect more entropy! (Need %d more bytes)/n"), length ); warn = 1; continue; } else if( rc == -1 ) { #ifdef IS_MODULE fprintf(stderr, #else tty_printf( #endif "select() error: %s/n", strerror(errno)); continue; }
开发者ID:BridgeNY,项目名称:purdue,代码行数:64,
示例4: update_splitstatic voidupdate_split (const WDialog * h){ /* Check split has to be done before testing if it changed, since it can change due to calling check_split() as well */ check_split (&panels_layout); if (panels_layout.horizontal_split) check_options[0].widget->state = panels_layout.horizontal_equal ? 1 : 0; else check_options[0].widget->state = panels_layout.vertical_equal ? 1 : 0; widget_redraw (WIDGET (check_options[0].widget)); tty_setcolor (check_options[0].widget->state & C_BOOL ? DISABLED_COLOR : COLOR_NORMAL); widget_move (h, 6, 5); if (panels_layout.horizontal_split) tty_printf ("%03d", panels_layout.top_panel_size); else tty_printf ("%03d", panels_layout.left_panel_size); widget_move (h, 6, 17); if (panels_layout.horizontal_split) tty_printf ("%03d", height - panels_layout.top_panel_size); else tty_printf ("%03d", COLS - panels_layout.left_panel_size); widget_move (h, 6, 12); tty_print_char ('=');}
开发者ID:m32,项目名称:mc,代码行数:30,
示例5: overwrite_filep/**************** * Check whether FNAME exists and ask if it's okay to overwrite an * existing one. * Returns: True: it's okay to overwrite or the file does not exist * False: Do not overwrite */intoverwrite_filep( const char *fname ){ if( iobuf_is_pipe_filename (fname) ) return 1; /* Writing to stdout is always okay */ if( access( fname, F_OK ) ) return 1; /* does not exist */#ifndef HAVE_DOSISH_SYSTEM if ( !strcmp ( fname, "/dev/null" ) ) return 1; /* does not do any harm */#endif#ifdef HAVE_W32_SYSTEM if ( !strcmp ( fname, "nul" ) ) return 1;#endif /* fixme: add some backup stuff in case of overwrite */ if( opt.answer_yes ) return 1; if( opt.answer_no || opt.batch ) return 0; /* do not overwrite */ tty_printf(_("File `%s' exists. "), fname); if( cpr_enabled () ) tty_printf ("/n"); if( cpr_get_answer_is_yes("openfile.overwrite.okay", _("Overwrite? (y/N) ")) ) return 1; return 0;}
开发者ID:FROSTEROID,项目名称:gpg2-with-big-max-rsa-keys,代码行数:38,
示例6: do_we_trust_pre/**************** * wrapper around do_we_trust, so we can ask whether to use the * key anyway. */static intdo_we_trust_pre( PKT_public_key *pk, unsigned int trustlevel ){ int rc; rc = do_we_trust( pk, trustlevel ); if( !opt.batch && !rc ) { print_pubkey_info(NULL,pk); print_fingerprint (pk, NULL, 2); tty_printf("/n"); tty_printf( _("It is NOT certain that the key belongs to the person named/n" "in the user ID. If you *really* know what you are doing,/n" "you may answer the next question with yes./n")); tty_printf("/n"); if( cpr_get_answer_is_yes("untrusted_key.override", _("Use this key anyway? (y/N) ")) ) rc = 1; /* Hmmm: Should we set a flag to tell the user about * his decision the next time he encrypts for this recipient? */ } return rc;}
开发者ID:jameshilliard,项目名称:bhr4_release_1.3.0.47.64,代码行数:35,
示例7: loadvoid load(){ int image = 0; tty_printf(" !!! Processor %d running !!!/n", procid()); while(image < NIMAGES) { while ( buf_in_empty == FALSE ) {} // synchro tty_printf("/n *** Starting load for image %d *** at cycle %d /n", image, proctime()); if( ioc_read(image*NBLOCKS, buf_in, NBLOCKS) ) { tty_printf("echec ioc_read /n"); exit(); } if ( ioc_completed() ) { tty_printf("echec ioc_completed/n"); exit(); } buf_in_empty = FALSE; tty_printf(" *** Completing load for image %d *** at cycle %d /n", image, proctime()); image++; } // end while image exit();} // end load()
开发者ID:walafc0,项目名称:soclib,代码行数:29,
示例8: keycode_runstatic voidkeycode_run(){ for (;;) { halt(); key_t key; bool avail; while ((avail = kb_getkey(&key)) != false) { if (key.ch) { tty_printf( TTY_CONSOLE, "Keycode: /033[%c]%02x/033[-] meta=%02x '%c'/n", key.brk == KEYBRK_UP ? 'e' : '2', key.code, key.meta, key.ch); } else { tty_printf( TTY_CONSOLE, "Keycode: /033[%c]%02x/033[-] meta=%02x/n", key.brk == KEYBRK_UP ? 'e' : '2', key.code, key.meta); } if ((key.brk == KEYBRK_UP) && (key.meta & META_ALT) && (key.code == KEY_TAB)) { switch_mode(&mode_command); return; } } }}
开发者ID:beevik,项目名称:MonkOS,代码行数:34,
示例9: transposevoid transpose(){ int l,p; int image = 0; tty_printf(" !!! Processor %d running !!!/n", procid()); while( image < NIMAGES ) { while( (buf_in_empty == TRUE) || (buf_out_empty == FALSE) ) {} // synchro tty_printf("/n *** Starting transpose for image %d *** at cycle %d /n", image, proctime()); for( l=0 ; l<NLINES ; l++) { for( p=0 ; p<NPIXELS ; p++) { buf_out[l][p] = buf_in[p][l]; } } buf_in_empty = TRUE; buf_out_empty = FALSE; tty_printf(" *** Completing transpose for image %d *** at cycle %d /n", image, proctime()); image++; } // end while image exit();} // end transpose
开发者ID:walafc0,项目名称:soclib,代码行数:28,
示例10: map_show/* * show automatic map (latest steps) in the form s2ews14n */void map_show(void){ char lastdir; int count = 0; int i; if (mapstart == mapend) { PRINTF("#map empty/n"); } else { PRINTF("#map: "); lastdir = mappath[mapstart]; for (i = mapstart; i != mapend; i = MAPINDEX(i + 1)) { if (mappath[i] != lastdir) { if (count > 1) tty_printf("%d", count); tty_putc(lastdir); count = 1; lastdir = mappath[i]; } else count++; } if (count > 1) tty_printf("%d", count); tty_printf("%c/n", lastdir); }}
开发者ID:MUME,项目名称:powwow,代码行数:33,
示例11: mainint main(int argc, char *argv[]) { char rxChar; char txChar; printf("Acme Serial Test (press ctrl-c to exit)/n"); if (tty_open(argv[1])<0) { fprintf (stderr,"tty open error %s/n", strerror(errno)); exit(EXIT_FAILURE); } if (stdin_init()<0) { printf("stdin init error %s/n", strerror(errno)); exit(EXIT_FAILURE); } if (signal (SIGINT, termination_handler) == SIG_IGN) signal (SIGINT, SIG_IGN); if (signal (SIGHUP, termination_handler) == SIG_IGN) signal (SIGHUP, SIG_IGN); if (signal (SIGTERM, termination_handler) == SIG_IGN) signal (SIGTERM, SIG_IGN); while (1) { if (read (STDIN_FILENO, &txChar, 1)>0) { tty_printf("TX: 0x%02X",txChar); if (txChar>=32 && txChar<=126) tty_printf(" [%c]",txChar); tty_printf("/n"); } if (read(tty_fd,&rxChar,1)>0) { printf("RX = 0x%02X",rxChar); if (rxChar>=32 && rxChar<=126) printf(" [%c]",rxChar); printf("/n"); } } return EXIT_SUCCESS;}
开发者ID:clacarbone,项目名称:saettanetus,代码行数:35,
示例12: __P1/* * process suboptions. * so far, only terminal type is processed but future extensions are * window size, X display location, etc. */static void dosubopt __P1 (byte *,str){ char buf[256], *term; int len, err; if (str[0] == TELOPT_TTYPE) { if (str[1] == 1) { /* 1 == SEND */#ifdef TELOPTS tty_printf("[got SB TERMINAL TYPE SEND]/n");#endif if (!(term = getenv("TERM"))) term = "unknown"; sprintf(buf, "%c%c%c%c%.*s%c%c", IAC, SB, TELOPT_TTYPE, 0, 256-7, term, IAC, SE); /* 0 == IS */ len = strlen(term) + 6; while ((err = write(tcp_fd, buf, len)) < 0 && errno == EINTR) ; if (err != len) { errmsg("write subopt to socket"); return; }#ifdef TELOPTS tty_printf("[sent SB TERMINAL TYPE IS %s]/n", term);#endif } }}
开发者ID:esirola,项目名称:powwow,代码行数:33,
示例13: transposevoid transpose(int image){ int dx,dy,g; int l,p;// int image = 0;// while( image < NMAX ) { while( (buf_in_empty == TRUE) || (buf_out_empty == FALSE) ) {} // synchro tty_printf("/n *** Starting transpose for image %d *** at cycle %d /n", image, proctime()); for( l=0 ; l<NLINES ; l++) { for( p=0 ; p<NPIXELS ; p++) {/* if ( (l==NLINES-1) || (l==0) || (p==NPIXELS-1) || (p==0) ) { buf_out[l][p] = 0; } else { // derivee en x dx = (int)buf_in[l-1][p-1] + (int)buf_in[l][p-1]*2 + (int)buf_in[l+1][p-1] - (int)buf_in[l-1][p+1] - (int)buf_in[l][p+1]*2 - (int)buf_in[l+1][p+1]; dy = (int)buf_in[l-1][p-1] + (int)buf_in[l-1][p]*2 + (int)buf_in[l-1][p+1] - (int)buf_in[l+1][p-1] - (int)buf_in[l+1][p]*2 - (int)buf_in[l+1][p+1]; if ( dy < 0 ) dy = -dy; g = dx + dy; if ( g > 255 ) g = 255; buf_out[l][p] = g; }*/ buf_out[l][p] = buf_out[p][l]; } // end for p } // end for l buf_in_empty = TRUE; buf_out_empty = FALSE; tty_printf(" *** Completing transpose for image %d *** at cycle %d /n", image, proctime());// image++; } // end while image// exit();} // end transpose
开发者ID:walafc0,项目名称:soclib,代码行数:54,
示例14: buttonbar_callbackstatic cb_ret_tbuttonbar_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data){ WButtonBar *bb = BUTTONBAR (w); int i; const char *text; switch (msg) { case MSG_FOCUS: return MSG_NOT_HANDLED; case MSG_HOTKEY: for (i = 0; i < BUTTONBAR_LABELS_NUM; i++) if (parm == KEY_F (i + 1) && buttonbar_call (bb, i)) return MSG_HANDLED; return MSG_NOT_HANDLED; case MSG_DRAW: if (bb->visible) { buttonbar_init_button_positions (bb); widget_move (w, 0, 0); tty_setcolor (DEFAULT_COLOR); tty_printf ("%-*s", w->cols, ""); widget_move (w, 0, 0); for (i = 0; i < BUTTONBAR_LABELS_NUM; i++) { int width; width = buttonbar_get_button_width (bb, i); if (width <= 0) break; tty_setcolor (BUTTONBAR_HOTKEY_COLOR); tty_printf ("%2d", i + 1); tty_setcolor (BUTTONBAR_BUTTON_COLOR); text = (bb->labels[i].text != NULL) ? bb->labels[i].text : ""; tty_print_string (str_fit_to_term (text, width - 2, J_LEFT_FIT)); } } return MSG_HANDLED; case MSG_DESTROY: for (i = 0; i < BUTTONBAR_LABELS_NUM; i++) g_free (bb->labels[i].text); return MSG_HANDLED; default: return widget_default_callback (w, sender, msg, parm, data); }}
开发者ID:GalaxyTab4,项目名称:workbench,代码行数:54,
示例15: mcview_display_statusstatic voidmcview_display_status (WView * view){ const screen_dimen top = view->status_area.top; const screen_dimen left = view->status_area.left; const screen_dimen width = view->status_area.width; const screen_dimen height = view->status_area.height; const char *file_label; if (height < 1) return; tty_setcolor (STATUSBAR_COLOR); tty_draw_hline (WIDGET (view)->y + top, WIDGET (view)->x + left, ' ', width); file_label = view->filename_vpath != NULL ? vfs_path_get_last_path_str (view->filename_vpath) : view->command != NULL ? view->command : ""; if (width > 40) { widget_move (view, top, width - 32); if (view->hex_mode) tty_printf ("0x%08" PRIxMAX, (uintmax_t) view->hex_cursor); else { char buffer[BUF_TRUNC_LEN + 1]; size_trunc_len (buffer, BUF_TRUNC_LEN, mcview_get_filesize (view), 0, panels_options.kilobyte_si); tty_printf ("%9" PRIuMAX "/%s%s %s", (uintmax_t) view->dpy_end, buffer, mcview_may_still_grow (view) ? "+" : " ",#ifdef HAVE_CHARSET mc_global.source_codepage >= 0 ? get_codepage_id (mc_global.source_codepage) :#endif ""); } } widget_move (view, top, left); if (width > 40) tty_print_string (str_fit_to_term (file_label, width - 34, J_LEFT_FIT)); else tty_print_string (str_fit_to_term (file_label, width - 5, J_LEFT_FIT)); if (width > 26) mcview_display_percent (view, view->hex_mode ? view->hex_cursor : view->dpy_end);}
开发者ID:Acidburn0zzz,项目名称:mc,代码行数:48,
示例16: mcview_percentvoidmcview_percent (mcview_t * view, off_t p){ const screen_dimen top = view->status_area.top; const screen_dimen right = view->status_area.left + view->status_area.width; const screen_dimen height = view->status_area.height; int percent; off_t filesize; if (height < 1 || right < 4) return; if (mcview_may_still_grow (view)) return; filesize = mcview_get_filesize (view); if (filesize == 0 || view->dpy_end == filesize) percent = 100; else if (p > (INT_MAX / 100)) percent = p / (filesize / 100); else percent = p * 100 / filesize; widget_move (view, top, right - 4); tty_printf ("%3d%%", percent);}
开发者ID:artzub,项目名称:mc,代码行数:25,
示例17: sal_vprintfint sal_vprintf(const char *fmt, va_list varg){ int retv = 0;#ifndef SAL_THREAD_NAME_PRINT_DISABLE char thread_name[80]; sal_thread_t thread; thread = sal_thread_self(); thread_name[0] = 0; if (thread != sal_thread_main_get()) { sal_thread_name(thread, thread_name, sizeof (thread_name)); }#endif /* !SAL_THREAD_NAME_PRINT_DISABLE */#ifndef SAL_THREAD_NAME_PRINT_DISABLE if (thread_name[0] != 0) { (void) tty_printf("[%s]", thread_name); }#endif /* !SAL_THREAD_NAME_PRINT_DISABLE */#ifndef SAL_NO_TTY retv = tty_vprintf(fmt, varg);#endif return retv;}
开发者ID:ariavie,项目名称:bcm,代码行数:27,
示例18: gather_fakedstatic intgather_faked( void (*add)(const void*, size_t, int), int requester, size_t length, int level ){ static int initialized=0; size_t n; char *buffer, *p; if( !initialized ) { log_info(_("WARNING: using insecure random number generator!!/n")); tty_printf(_("The random number generator is only a kludge to let/n" "it run - it is in no way a strong RNG!/n/n" "DON'T USE ANY DATA GENERATED BY THIS PROGRAM!!/n/n")); initialized=1; #ifdef HAVE_RAND srand(make_timestamp()*getpid()); #else srandom(make_timestamp()*getpid()); #endif } p = buffer = m_alloc( length ); n = length; #ifdef HAVE_RAND while( n-- ) *p++ = ((unsigned)(1 + (int) (256.0*rand()/(RAND_MAX+1.0)))-1); #else while( n-- ) *p++ = ((unsigned)(1 + (int) (256.0*random()/(RAND_MAX+1.0)))-1); #endif add_randomness( buffer, length, requester ); m_free(buffer); return 0; /* okay */}
开发者ID:BackupTheBerlios,项目名称:secser,代码行数:34,
示例19: tty_kill_promptvoidtty_kill_prompt(){ if ( no_terminal ) return; if( !initialized ) init_ttyfp(); if( batchmode ) last_prompt_len = 0; if( !last_prompt_len ) return;#ifdef USE_W32_CONSOLE tty_printf("/r%*s/r", last_prompt_len, "");#else { int i; putc('/r', ttyfp); for(i=0; i < last_prompt_len; i ++ ) putc(' ', ttyfp); putc('/r', ttyfp); fflush(ttyfp); }#endif last_prompt_len = 0;}
开发者ID:0ndorio,项目名称:gnupg,代码行数:27,
示例20: tty_print_utf8_string2voidtty_print_utf8_string2( const byte *p, size_t n, size_t max_n ){ size_t i; char *buf; if (no_terminal) return; /* we can handle plain ascii simpler, so check for it first */ for(i=0; i < n; i++ ) { if( p[i] & 0x80 ) break; } if( i < n ) { buf = utf8_to_native( (const char *)p, n, 0 ); if( max_n && (strlen( buf ) > max_n )) { buf[max_n] = 0; } /*(utf8 conversion already does the control character quoting)*/ tty_printf("%s", buf ); xfree( buf ); } else { if( max_n && (n > max_n) ) { n = max_n; } tty_print_string( p, n ); }}
开发者ID:GroovIM,项目名称:transport,代码行数:30,
示例21: chown_refreshstatic void chown_refresh (void){ common_dialog_repaint (ch_dlg); tty_setcolor (COLOR_NORMAL); dlg_move (ch_dlg, BY - 1, 8); tty_print_string (_("owner")); dlg_move (ch_dlg, BY - 1, 16); tty_print_string (_("group")); dlg_move (ch_dlg, BY - 1, 24); tty_print_string (_("other")); dlg_move (ch_dlg, BY - 1, 35); tty_print_string (_("owner")); dlg_move (ch_dlg, BY - 1, 53); tty_print_string (_("group")); dlg_move (ch_dlg, 3, 4); tty_print_string (_("On")); dlg_move (ch_dlg, BY + 1, 4); tty_print_string (_("Flag")); dlg_move (ch_dlg, BY + 2, 4); tty_print_string (_("Mode")); if (!single_set){ dlg_move (ch_dlg, 3, 54); tty_printf (_("%6d of %d"), files_on_begin - (current_panel->marked) + 1, files_on_begin); } print_flags ();}
开发者ID:sfionov,项目名称:mc-dev,代码行数:34,
示例22: mcview_display_statusstatic voidmcview_display_status (mcview_t * view){ const screen_dimen top = view->status_area.top; const screen_dimen left = view->status_area.left; const screen_dimen width = view->status_area.width; const screen_dimen height = view->status_area.height; const char *file_label; screen_dimen file_label_width; if (height < 1) return; tty_setcolor (STATUSBAR_COLOR); widget_move (view, top, left); tty_draw_hline (-1, -1, ' ', width); file_label = view->filename ? view->filename : view->command ? view->command : ""; file_label_width = str_term_width1 (file_label) - 2; if (width > 40) { char buffer[BUF_TINY]; widget_move (view, top, width - 32); if (view->hex_mode) tty_printf ("0x%08" PRIxMAX, (uintmax_t) view->hex_cursor); else { size_trunc_len (buffer, 5, mcview_get_filesize (view), 0, panels_options.kilobyte_si); tty_printf ("%9" PRIuMAX "/%s%s %s", (uintmax_t) view->dpy_end, buffer, mcview_may_still_grow (view) ? "+" : " ",#ifdef HAVE_CHARSET mc_global.source_codepage >= 0 ? get_codepage_id (mc_global.source_codepage) : ""#else ""#endif ); } } widget_move (view, top, left); if (width > 40) tty_print_string (str_fit_to_term (file_label, width - 34, J_LEFT_FIT)); else tty_print_string (str_fit_to_term (file_label, width - 5, J_LEFT_FIT)); if (width > 26) mcview_percent (view, view->hex_mode ? view->hex_cursor : view->dpy_end);}
开发者ID:ilia-maslakov,项目名称:mc,代码行数:47,
示例23: update_modestatic void update_mode (Dlg_head * h){ print_flags (); tty_setcolor (COLOR_NORMAL); dlg_move (h, BY + 2, 9); tty_printf ("%12o", get_mode ()); send_message (h->current, WIDGET_FOCUS, 0);}
开发者ID:sfionov,项目名称:mc-dev,代码行数:8,
示例24: show_sha1_fprstatic voidshow_sha1_fpr (const unsigned char *fpr){ int i; if (fpr) { for (i=0; i < 20 ; i+=2, fpr += 2 ) { if (i == 10 ) tty_printf (" "); tty_printf (" %02X%02X", *fpr, fpr[1]); } } else tty_printf (" [none]"); tty_printf ("/n");}
开发者ID:CryptoBITDigital,项目名称:gnupg-1,代码行数:18,
示例25: do_we_trust_pre/**************** * wrapper around do_we_trust, so we can ask whether to use the * key anyway. */static intdo_we_trust_pre( PKT_public_key *pk, unsigned int trustlevel ){ int rc; rc = do_we_trust( pk, trustlevel ); if( !opt.batch && !rc ) { print_pubkey_info(NULL,pk); print_fingerprint (pk, 2); tty_printf("/n"); tty_printf( _("It is NOT certain that the key belongs to the person named/n" "in the user ID. If you *really* know what you are doing,/n" "you may answer the next question with yes./n")); tty_printf("/n"); if (is_status_enabled ()) { u32 kid[2]; char *hint_str; keyid_from_pk (pk, kid); hint_str = get_long_user_id_string ( kid ); write_status_text ( STATUS_USERID_HINT, hint_str ); xfree (hint_str); } if( cpr_get_answer_is_yes("untrusted_key.override", _("Use this key anyway? (y/N) ")) ) rc = 1; /* Hmmm: Should we set a flag to tell the user about * his decision the next time he encrypts for this recipient? */ } return rc;}
开发者ID:FMayzek,项目名称:gnupg,代码行数:47,
示例26: display_online_helpvoiddisplay_online_help( const char *keyword ){ tty_kill_prompt(); if( !keyword ) tty_printf(_("No help available") ); else { const char *p; int i; for(i=0; (p=helptexts[i].key) && strcmp( p, keyword ); i++ ) ; if( !p || !*helptexts[i].help ) tty_printf(_("No help available for `%s'"), keyword ); else tty_printf("%s", _(helptexts[i].help) ); } tty_printf("/n");}
开发者ID:Deliverability,项目名称:parley,代码行数:20,
注:本文中的tty_printf函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ tty_putcode函数代码示例 C++ tty_print_string函数代码示例 |