void run() { /* wyswietlanie przed sortowaniem */ printf("*** Plik przed sortowaniem: *** \n\n"); show_file(path_file); printf("\n\n"); /* działanie na rekordach */ algorithm(&path_file, show_steps); printf("\n"); /* wyswietlanie po sortowaniu */ /* printf("*** Plik po sortowaniu: *** \n\n"); */ printf("*** Plik out po sortowaniu: *** \n\n"); show_file(path_file); printf("\n\n"); tmpa_file = "tmpa.txt"; printf("*** Plik tmpa po sortowaniu: *** \n\n"); show_file(tmpa_file); printf("\n\n"); tmpb_file = "tmpb.txt"; printf("*** Plik tmpb po sortowaniu: *** \n\n"); show_file(tmpb_file); printf("\n\n"); printf("Liczba faz sortowan: %d\n", phases); printf("Liczba odczytow: %d\n", reads_file_oper); printf("Liczba zapisow: %d\n", writes_file_oper); exit(0); }
static void show_dynamic(const char *directory) { MY_DIR *dir= NULL; unsigned int i; char *plugin_dir= directory ? (char *)directory : getenv("MARIADB_PLUGIN_DIR"); if (!plugin_dir) plugin_dir= PLUGINDIR; printf("plugin_dir %s\n", plugin_dir); dir= my_dir(plugin_dir, 0); if (!dir || !dir->number_off_files) { printf("No plugins found in %s\n", plugin_dir); goto end; } for (i=0; i < dir->number_off_files; i++) { char *p= strstr(dir->dir_entry[i].name, SO_EXT); if (p) show_file(dir->dir_entry[i].name); } end: if (dir) my_dirend(dir); }
int show_80x24_screen(const char *filename) { clear(); // max 24 lines, holding one more line for pause/messages return show_file(filename, 0, 24, SHOWFILE_ALLOW_ALL); }
// TODO // move this function to vtuikit.c void show_helpfile(const char *helpfile) { clear(); show_file((char *)helpfile, 0, b_lines, SHOWFILE_ALLOW_ALL); PRESSANYKEY(); }
static void show_functions(const char *funcre) { if (funcre) show_file_re("available_filter_functions", funcre); else show_file("available_filter_functions"); }
int show_play_pic(int i) { /*休闲的图 */ char buf[256]; clrchyiuan(6, 18); #ifdef MAPLE sprintf(buf, "src/maple/pipgame/play/pic%d", i); #else sprintf(buf, "game/pipgame/play/pic%d", i); #endif // END MAPLE if (i == 0) show_file(buf, 2, 16, ONLY_COLOR); else show_file(buf, 6, 12, ONLY_COLOR); return 0; }
/* show_helpfile() - Displays a help file to the screen. Parameters: hlpname - Base name of the help file to show. Returns: Nothing. Notes: This function is really just a wrapper for show_file() that adds in the help prefix and suffix as well. */ void show_helpfile(unsigned char *hlpname) { top_output(OUT_SCREEN, getlang("HelpPrefix")); show_file(hlpname, SCRN_RESETCOL); top_output(OUT_SCREEN, getlang("HelpSuffix")); }
/* * Display the debug commands help file. */ static void do_cmd_wiz_help(void) { char buf[80]; strnfmt(buf, sizeof(buf), "debug.txt"); screen_save(); show_file(buf, NULL, 0, 0); screen_load(); }
static void show_textbox(const char *title, const char *text, int r, int c) { int fd; fd = creat(".help.tmp", 0777); write(fd, text, strlen(text)); close(fd); show_file(".help.tmp", title, r, c); unlink(".help.tmp"); }
/* * Peruse the On-Line-Help */ void do_cmd_help(void) { /* Save screen */ screen_save(); /* Peruse the main help file */ (void)show_file("help.hlp", NULL, 0, 0); /* Load screen */ screen_load(); }
int main(int argc,char *argv[]) { //////////////////////////////////////////////////////////////////////// // Native Language Support Int //////////////////////////////////////////////////////////////////////// #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); #endif //////////////////////////////////////////////////////////////////////// char* fchar = (char*) argv[1]; set_path_self(argv[0]); //////////////////////////////////////////////////////////////////////// /* GTK INIT */ //////////////////////////////////////////////////////////////////////// gtk_init(&argc,&argv); //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /* PATH SELF SET */ //////////////////////////////////////////////////////////////////////// //set_path_self(g_strdup(argv[0])); //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /* CONFIG Setup */ //////////////////////////////////////////////////////////////////////// config_setup(); ui_unity_init(); tpad_fp_init(); gtk_widget_show_all(GTK_WIDGET(tpad_new_ui())); new_file(); //////////////////////////////////////////////////////////////////////// // handle cl arguments //////////////////////////////////////////////////////////////////////// if (argc > 2){ int i=0; for (i = 2; i < argc; i += 1) new_thread_tpad ( g_strdup(argv[i])); } if(argc > 1) { show_file(g_strdup(fchar)); } //////////////////////////////////////////////////////////////////////// /* GTK MAIN */ //////////////////////////////////////////////////////////////////////// gtk_main(); //////////////////////////////////////////////////////////////////////// return (0); }
int main(int argc, char **argv) { if (argc > 2) { fprintf(stderr, "Bad args!"); return 1; } if (argc == 2) { return show_file(argv[1]); } else { return show_without_file(); } }
int show_job_pic(int i) { /* 打工的show图 */ char buf[256]; clrchyiuan(6, 18); #ifdef MAPLE sprintf(buf, "src/maple/pipgame/job/pic%d", i); #else sprintf(buf, "game/pipgame/job/pic%d", i); #endif // END MAPLE show_file(buf, 6, 12, ONLY_COLOR); return 0; }
int show_basic_pic(int i) { char buf[256]; clrchyiuan(6, 17); #ifdef MAPLE sprintf(buf, "src/maple/pipgame/basic/pic%d", i); #else sprintf(buf, "game/pipgame/basic/pic%d", i); #endif // END MAPLE show_file(buf, 6, 12, ONLY_COLOR); return 0; }
int show_weapon_pic(int i) { /* 武器用 */ char buf[256]; clrchyiuan(1, 10); #ifdef MAPLE sprintf(buf, "src/maple/pipgame/weapon/pic%d", i); #else sprintf(buf, "game/pipgame/weapon/pic%d", i); #endif // END MAPLE show_file(buf, 1, 10, ONLY_COLOR); return 0; }
int show_ending_pic(int i) { /*结束 */ char buf[256]; clrchyiuan(1, 23); #ifdef MAPLE sprintf(buf, "src/maple/pipgame/ending/pic%d", i); #else sprintf(buf, "game/pipgame/ending/pic%d", i); #endif // END MAPLE show_file(buf, 4, 16, ONLY_COLOR); return 0; }
int show_resultshow_pic(int i) { /*收获季 */ char buf[256]; clrchyiuan(0, 24); #ifdef MAPLE sprintf(buf, "src/maple/pipgame/resultshow/pic%d", i); #else sprintf(buf, "game/pipgame/resultshow/pic%d", i); #endif // END MAPLE show_file(buf, 0, 24, ONLY_COLOR); return 0; }
int show_badman_pic(int i) { /* 坏人 */ char buf[256]; clrchyiuan(6, 18); #ifdef MAPLE sprintf(buf, "src/maple/pipgame/badman/pic%d", i); #else sprintf(buf, "game/pipgame/badman/pic%d", i); #endif // END MAPLE show_file(buf, 6, 14, ONLY_COLOR); return 0; }
int show_die_pic(int i) { /*死亡 */ char buf[256]; clrchyiuan(0, 23); #ifdef MAPLE sprintf(buf, "src/maple/pipgame/die/pic%d", i); #else sprintf(buf, "game/pipgame/die/pic%d", i); #endif // END MAPLE show_file(buf, 0, 23, ONLY_COLOR); return 0; }
int show_palace_pic(int i) { /* 参见王臣用 */ char buf[256]; clrchyiuan(0, 13); #ifdef MAPLE sprintf(buf, "src/maple/pipgame/palace/pic%d", i); #else sprintf(buf, "game/pipgame/palace/pic%d", i); #endif // END MAPLE show_file(buf, 0, 11, ONLY_COLOR); return 0; }
HelpDialog::HelpDialog(QWidget *parent) : QDialog(parent), ui(new Ui::HelpDialog), _help_engine(QDir(QCoreApplication::applicationDirPath()) .absoluteFilePath("toney.qhc")) { ui->setupUi(this); _help_engine.registeredDocumentations(); // this does a magic ui->splitter->setStretchFactor(0,1); ui->splitter->setStretchFactor(1,3); ui->treeView->setModel(_help_engine.contentModel()); ui->helpBrowser->setHelpEngine(&_help_engine); connect(ui->treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(show_file(QModelIndex))); }
int main(int argc, char *argv[]) { int option_index= 0; int c; ma_progname= argv[0]; mysql_server_init(0, NULL, NULL); if (argc <= 1) { usage(); exit(1); } c= getopt_long(argc, argv, "bdapnvh?", long_options, &option_index); switch(c) { case 'a': /* all */ show_builtin(); show_dynamic(NULL); break; case 'b': /* builtin */ show_builtin(); break; case 'd': /* dynamic */ show_dynamic(NULL); break; case 'v': version(); break; case 'n': if (argc > 2) show_file(argv[2]); break; case 'p': if (argc > 2) show_dynamic(argv[2]); break; case '?': usage(); break; default: printf("unrecocognized option: %s", argv[1]); exit(1); } exit(0); }
/* * process_file() * show symbols in the file given as an argument. Accepts archive and * object files as input. */ int process_file(int count, const char *fname) { union hdr exec_head; FILE *fp; int retval; size_t bytes; char magic[SARMAG]; if (!(fp = fopen(fname, "r"))) { warn("cannot read %s", fname); return(1); } /* * first check whether this is an object file - read a object * header, and skip back to the beginning */ bzero(&exec_head, sizeof(exec_head)); bytes = fread((char *)&exec_head, 1, sizeof(exec_head), fp); if (bytes < sizeof(exec_head)) { if (bytes < sizeof(exec_head.aout) || IS_ELF(exec_head.elf32)) { warnx("%s: bad format", fname); (void)fclose(fp); return(1); } } rewind(fp); /* this could be an archive */ if (!IS_ELF(exec_head.elf32) && N_BADMAG(exec_head.aout)) { if (fread(magic, sizeof magic, 1, fp) != 1 || strncmp(magic, ARMAG, SARMAG)) { warnx("%s: not object file or archive", fname); (void)fclose(fp); return(1); } if (!issize && count > 1) (void)printf("\n%s:\n", fname); retval = show_archive(count, fname, fp); } else retval = show_file(count, 1, fname, fp, 0, &exec_head); (void)fclose(fp); return(retval); }
void show_directory( const fs::path& dirpath ) { fs::directory_iterator itr( dirpath ); fs::directory_iterator endItr; for ( ; itr != endItr; ++itr ) { if ( fs::is_regular_file( itr->status() ) ) { show_file( itr->path() ); } else if ( fs::is_directory( itr->status() ) ) { show_directory( itr->path() ); } } }
static void process_file_re(process_file_func func, const char *name, const char *re) { regex_t reg; char *path; char *buf = NULL; char *str; FILE *fp; ssize_t n; size_t l = strlen(re); /* Just in case :-p */ if (!re || l == 0) { show_file(name); return; } /* Handle the newline at end of names for the user */ str = malloc(l + 3); if (!str) die("Failed to allocate reg ex %s", re); strcpy(str, re); if (re[l-1] == '$') strcpy(&str[l-1], "\n*$"); if (regcomp(®, str, REG_ICASE|REG_NOSUB)) die("invalid function regex '%s'", re); free(str); path = tracecmd_get_tracing_file(name); fp = fopen(path, "r"); if (!fp) die("reading %s", path); tracecmd_put_tracing_file(path); do { n = getline(&buf, &l, fp); if (n > 0 && regexec(®, buf, 0, NULL, 0) == 0) func(buf, n); } while (n > 0); free(buf); fclose(fp); regfree(®); }
void Show_File(const char* file_name, bool pause_mode) { ifstream show_file(file_name, ios::in); if (show_file.is_open()) { char test; bool is_letter; bool is_number; bool is_special; cout << endl << "File Read Starts on Next Line: " << endl; while (!show_file.eof()) { show_file.get(test); is_letter = Is_Text(test); is_number = Is_Number(test); is_special = ( (test >= 32) && (test <= 47) ) || ( (test >= 58) && (test <= 64) ) || ( (test >= 91) && (test <= 96) ) || ( (test >= 123) && (test <= 126) ); //Additional ASCII characters that would be //output as characters, not ASCII integers. if (is_letter || is_number || is_special) { cout << test; } else { cout << int(test) << " "; } if (test == '\n') //Process the end of line. { cout << endl; if (pause_mode) { system("PAUSE"); } } } cout << endl << "End File Read!"; show_file.close(); } }
static void show_events(const char *eventre, int flags) { if (flags && !eventre) die("When specifying event files, an event must be named"); if (eventre) { if (flags & SHOW_EVENT_FORMAT) show_event_format_re(eventre); else if (flags & SHOW_EVENT_FILTER) show_event_filter_re(eventre); else if (flags & SHOW_EVENT_TRIGGER) show_event_trigger_re(eventre); else show_file_re("available_events", eventre); } else show_file("available_events"); }
void mut_do_cmd_knowledge(void) { FILE *fff; char file_name[1024]; /* Open a new file */ fff = my_fopen_temp(file_name, 1024); /* Dump the mutations to file */ if (fff) mut_dump_file(fff); /* Close the file */ my_fclose(fff); /* Display the file contents */ show_file(TRUE, file_name, T("Mutations", "突然変異"), 0, 0); /* Remove the file */ fd_kill(file_name); }
int main(int argc, char *argv[]) { int i, ret; debug_init(); if (argc < 2) { log_err("Usage: %s <state file>\n", argv[0]); return 1; } ret = 0; for (i = 1; i < argc; i++) { ret = show_file(argv[i]); if (ret) break; } return ret; }
/** * Handle keypresses for an option entry. */ static bool option_toggle_handle(struct menu *m, const ui_event *event, int oid) { bool next = false; if (event->type == EVT_SELECT) { /* Hack -- birth options can not be toggled after birth */ /* At birth, m->flags == MN_DBL_TAP. */ /* After birth, m->flags == MN_NO_TAGS */ if (!((option_type(oid) == OP_BIRTH) && (m->flags == MN_NO_TAGS))) { option_set(option_name(oid), !op_ptr->opt[oid]); } } else if (event->type == EVT_KBRD) { if (event->key.code == 'y' || event->key.code == 'Y') { option_set(option_name(oid), true); next = true; } else if (event->key.code == 'n' || event->key.code == 'N') { option_set(option_name(oid), false); next = true; } else if (event->key.code == 't' || event->key.code == 'T') { option_set(option_name(oid), !op_ptr->opt[oid]); } else if (event->key.code == '?') { screen_save(); show_file(format("option.txt#%s", option_name(oid)), NULL, 0, 0); screen_load(); } else { return false; } } else { return false; } if (next) { m->cursor++; m->cursor = (m->cursor + m->filter_count) % m->filter_count; } return true; }