/*** analog 2.1 ***/
/* Please read Readme.html, or http://www.statslab.cam.ac.uk/~sret1/analog/ */
/*** formgen.c; generate a form for the analog form interface ***/
#include "analhea2.h"
void genopts(FILE *outf, char name[17], char plural[16], int sortby,
char codeletter)
{
fprintf(outf, "\n
%s options
\n\n", name);
fprintf(outf, "Sort the %s \n\n");
fprintf(outf, " (*) Include all %s with at least\n", plural);
fprintf(outf,
" requests%s\n",
codeletter,
(codeletter != 'B' && codeletter != 'b' && codeletter != 'f')?"/page requests":"");
fprintf(outf, "or the top ");
fprintf(outf, " %s.\n",
codeletter, plural);
fprintf(outf, " (+) Include all %s with at least\n", plural);
fprintf(outf, " bytes\n",
codeletter);
fprintf(outf, "transferred or the top ");
fprintf(outf, " %s.\n",
codeletter, plural);
}
void repchoice(FILE *outf, char name[MAXSTRINGLENGTH], char codeletter,
flag qq)
{
fprintf(outf, " [On] ",
codeletter, qq?" checked":"");
fprintf(outf, " [Off] %s\n",
codeletter, qq?"":" checked", name);
}
void formgen(void)
{
extern flag xq, mq, Wq, dq, Dq, hq, Hq, oq, Sq, iq, rq, tq, Bq, bq, fq, eq, cq;
extern char reportorder[];
extern int osortby, isortby, Ssortby, rsortby, fsortby, bsortby, Bsortby, tsortby;
extern int dirlevel;
extern char *hostname, *hosturl, *logourl, *commandname;
extern char *outfile;
extern struct timestruct fromtime, totime;
char *ro;
FILE *outf;
if (STREQ(outfile, "stdout"))
outf = stdout;
else if ((outf = fopen(outfile, "w")) == NULL) {
fprintf(stderr, "%s: Error: failed to open output file %s for writing.\n",
commandname, outfile);
exit(ERR); /* shouldn't get here because also tested at the beginning */
}
fprintf(outf, "\n");
fprintf(outf, "Analog form interface\n");
fprintf(outf, "\n\n");
fprintf(outf, "\n");
if (hosturl[0] == '-')
fprintf(outf, "