[ltd dump html, by player name quozl@us.netrek.org**20090203084720] { hunk ./Vanilla/tools/ltd_dump_html.c 2 - * - * Dave Ahn - * - * LTD stats dump utility program. - * + * Dave Ahn, LTD stats dump utility program. + * James Cameron, HTML output, query by player hunk ./Vanilla/tools/ltd_dump_html.c 13 -#include hunk ./Vanilla/tools/ltd_dump_html.c 14 -#include -#include hunk ./Vanilla/tools/ltd_dump_html.c 16 + hunk ./Vanilla/tools/ltd_dump_html.c 25 +static void dump_full_header() { + fprintf(fp, "

LTD Extended Player Statistics Dump

\n\n"); +} + hunk ./Vanilla/tools/ltd_dump_html.c 234 - hunk ./Vanilla/tools/ltd_dump_html.c 235 - int plf; hunk ./Vanilla/tools/ltd_dump_html.c 239 - hunk ./Vanilla/tools/ltd_dump_html.c 246 - hunk ./Vanilla/tools/ltd_dump_html.c 247 - hunk ./Vanilla/tools/ltd_dump_html.c 250 - hunk ./Vanilla/tools/ltd_dump_html.c 251 + off_t position; hunk ./Vanilla/tools/ltd_dump_html.c 254 - hunk ./Vanilla/tools/ltd_dump_html.c 256 - if (argc == 2) - plf = open(argv[1], O_RDONLY, 0744); - else - plf = open(PlayerFile, O_RDONLY, 0744); - - if (argc == 3) - who = (char *)argv[2]; - else - who = NULL; - - if (plf <= -1) { - - fprintf(stderr, "ltd_dump_html: can't open playerfile\n"); - exit(-1); - - } - - fprintf(fp, "

LTD Starbase Statistics

\n"); - - dump_sb_header1(); - - while (read(plf, &p, sizeof(struct statentry)) > 1) { - - for (race=0; race\n\n"); - - dump_sb_header2(); - - while (read(plf, &p, sizeof(struct statentry)) > 1) { - - for (race=0; race\n\n"); - fprintf(fp, "

LTD Extended Player Statistics Dump

\n\n"); - - if (lseek(plf, 0, SEEK_SET) == -1) { - - fprintf(stderr, "ltd_dump_html: lseek failed\n"); - exit(-1); - + position = findplayer(who, &p, 0); + if (position < 0) { + fprintf(stderr, "ltd_dump_html: can't find %s, or index missing\n", who); + exit(-2); hunk ./Vanilla/tools/ltd_dump_html.c 267 - - while (read(plf, &p, sizeof(struct statentry)) > 1) { - - - for (race=0; race