/* The title of the page, plus the user's HEADERFILE */ void xml_pagetitle(FILE *outf, Outchoices *od) { XML_TRACE(0); }
/* Single cell, listing percentage */ void xml_pccell(FILE *outf, Outchoices *od, choice rep, choice col, double n, double tot, unsigned int width) { XML_TRACE(0); XML_OUT( XMLDBG"<col name=\"%s\">%f</col>", strtolower(column_name[col]), tot>0 ? 100*n/tot : 0.0 ); }
/* End of a table row */ void xml_rowend(FILE *outf, Outchoices *od, choice rep) { XML_TRACE(0); XML_OUT(XMLDBG"</row>"); }
/* Name column */ void xml_namecell(FILE *outf, Outchoices *od, choice rep, char *name, choice source, unsigned int width, logical name1st, logical isfirst, logical rightalign, Alias *aliashead, Include *linkhead, logical ispage, unsigned int spaces, char *baseurl) { char *p, *q; int n; XML_TRACE(0); // no output aliasing is done yet. not sure it will be done either. // we don't care, but by testing it we avoid printing the column twice. if ( !isfirst && name ) { XML_OUT( XMLDBG "<col name=\"name\">" ); switch( rep) { case REP_MONTH: case REP_YEAR: case REP_WEEK: case REP_QUARTERLY: case REP_DAYREP: case REP_HOURREP: case REP_QUARTERREP: case REP_FIVEREP: case REP_DAYSUM: case REP_HOURSUM: case REP_QUARTERSUM: case REP_FIVESUM: case REP_WEEKHOUR: // this is split because strtok needs to be called in the right order. XML_OUT( "<timespan from=\"%s\" ", strtok(name," ") ); XML_OUT( "to=\"%s\" ", strtok( NULL," ") ); switch( rep ) { case REP_DAYSUM: XML_OUT( "dayofweek=\"%s\" />", strtok( NULL," ") ); break; case REP_HOURSUM: XML_OUT( "hour=\"%s\" />", strtok( NULL," ") ); break; case REP_QUARTERSUM: XML_OUT( "minute=\"%s\" />", strtok( NULL," ") ); break; case REP_FIVESUM: XML_OUT( "minute=\"%s\" />", strtok( NULL," ") ); break; case REP_WEEKHOUR: XML_OUT( "dayofweek=\"%s\" ", strtok( NULL," ") ); XML_OUT( "hour=\"%s\" />", strtok( NULL," ") ); break; default: XML_OUT( "/>" ); } break; case REP_CODE: strtok(name, " "); // assumption: name = "nnn text" XML_OUT( name ); break; // n=array_index++; // XML_OUT( "%d", (int)(opts->arraydata[rep-FIRST_ARRAYREP][n].threshold) ); // break; case REP_OS: // kludge: the hardcoded OS names from tree.c are turned into i18n // keys - hardly a well thought out interface, but the best we can do // for the moment. p=strtolower(name); // all lowercase while ( (q=strchr(p,' ')) ) *q='-'; // replace ' ' with '-' while ( (q=strchr(p,'/')) ) *q='-'; XML_OUT( "<i18n key=\"os-%s\"/>", p ); break; case REP_SIZE: case REP_PROCTIME: n=array_index++; XML_OUT( "%f", opts->arraydata[rep-FIRST_ARRAYREP][n].threshold ); break; case REP_DOM: case REP_TYPE: // kludge: if the string supplied is delimited by square brackets, // we turn it into an i18n key. if ( *name=='[' && *(name+strlen(name)-1)==']' ) { p=strtolower(name+1); *(p+strlen(p)-1)=0; while ( (q=strchr(p,' ')) ) *q='-'; XML_OUT( "<i18n key=\"%s-%s\"/>", rep==REP_DOM?"domain":"type", p ); break; } // this is a delibrate fall-thru. default: XML_OUT( "<![CDATA[%s]]>", cleanprint(name) ); break; } XML_OUT( "</col>" ); } #if 0 extern char *workspace; choice savemultibyte; logical linked; int i; if (name1st != isfirst) return; if (isfirst) matchlengthn(outf, od, width - od->outputter->strlen(name), ' '); savemultibyte = od->multibyte; if (rep == REP_SIZE || rep == REP_PROCTIME) /* Kludge: for these two reports, we know the texts are things like "< 1" and we want to convert > and < */ od->multibyte = FALSE; strcpy(workspace, name); do_aliasx(workspace, aliashead); if (!isfirst) { if (rightalign) i = (int)width - (int)od->outputter->strlen(workspace) - (int)spaces; else i = (int)spaces; matchlengthn(outf, od, i, ' '); } linked = (linkhead != NULL && included(name, ispage, linkhead)); if (linked) { /* We link to the unaliased name, because the OUTPUTALIAS is usually in the nature of an annotation. */ fputs("<a href=\"", outf); if (baseurl != NULL) htmlputs(outf, od, baseurl, IN_HREF); // xml_escfprintf(outf, name); fputs("\">", outf); } htmlputs(outf, od, workspace, UNTRUSTED); if (linked) fputs("</a>", outf); if (isfirst) fputs(": ", outf); od->multibyte = savemultibyte; /* restore multibyte */ #endif }
/* The top of the output if we are in CGI mode */ void xml_cgihead(FILE *outf, Outchoices *od) { XML_TRACE(0); }
/* Column header line: individual column */ void xml_colheadcol(FILE *outf, Outchoices *od, choice rep, choice col, unsigned int width, char *colname, logical unterminated) {XML_TRACE(0);}
/* End of column header underlining line */ void xml_colheaduend(FILE *outf, Outchoices *od, choice rep) { XML_TRACE(0); }
/* Report title */ void xml_reporttitle(FILE *outf, Outchoices *od, choice rep) { char *dir; XML_TRACE(0); assert( ((char*)od-(char*)opts)==offsetof(Options,outopts) ); array_index=0; XML_OUT( XMLDBG"<report name=\"%s\">", strtolower(report_name[rep]) ); this_report=rep; switch (rep) { case REP_GENSUM: break; case REP_YEAR: case REP_QUARTERLY: case REP_MONTH: case REP_WEEK: case REP_DAYREP: case REP_HOURREP: case REP_QUARTERREP: case REP_FIVEREP: XML_OUT( XMLDBG "<rowlimit count=\"%d\"/>", opts->outopts.rows[rep] ); case REP_DAYSUM: case REP_HOURSUM: case REP_WEEKHOUR: case REP_QUARTERSUM: case REP_FIVESUM: // only time reports (for the time being) have a 'back' setting to set their sort-order. XML_OUT( XMLDBG "<sort dir=\"%s\" by=\"\"/>", od->back[rep]? "descending" : "ascending" ); break; case REP_SIZE: case REP_PROCTIME: case REP_HOST: case REP_REDIRHOST: case REP_FAILHOST: case REP_VHOST: case REP_REDIRVHOST: case REP_FAILVHOST: case REP_USER: case REP_REDIRUSER: case REP_FAILUSER: case REP_SEARCHREP: case REP_SEARCHSUM: case REP_INTSEARCHREP: case REP_INTSEARCHSUM: case REP_BROWSUM: case REP_CODE: od->subsortby[rep]= od->subfloor[rep].floorby=UNSET; case REP_TYPE: // the following reports can also have subfloor/sort setting case REP_DIR: case REP_REQ: case REP_REDIR: case REP_FAIL: case REP_DOM: case REP_REF: case REP_BROWREP: case REP_OS: case REP_REDIRREF: case REP_FAILREF: case REP_ORG: case REP_REFSITE: dir="ascending"; // analog will sort all of these in ascending order. XML_OUT( XMLDBG "<sort dir=\"%s\" by=\"%s\"/>", dir, od->sortby[rep]==UNSET?"":criteria[od->sortby[rep]] ); // 5.90b1 there's something funky going on with subsortby // 5.90b2 ? assert( od->subsortby[rep]==UNSET || (od->subsortby[rep]>=REQUESTS && od->subsortby[rep]<=METHOD_NUMBER) ); if ( od->sortby[rep]!=UNSET ) if ( od->subsortby[rep]!=UNSET ) // is this dependable ?? // XML_OUT( XMLDBG "<sort dir=\"%s\" by=\"%s\"/>", dir, criteria[od->subsortby[rep]] ); XML_OUT( XMLDBG "<sort dir=\"%s\" by=\"%u\"/>", dir, od->subsortby[rep] ); // the *FLOOR setting XML_OUT( XMLDBG "<floor level=\"%f\" ", od->floor[rep].min ); if ( od->floor[rep].qual ) XML_OUT( "qual=\"%c\" ", od->floor[rep].qual ); XML_OUT( "by=\"%s\"/>", od->floor[rep].floorby==UNSET?"":criteria[od->floor[rep].floorby] ); if ( od->subfloor[rep].floorby!=UNSET ) { XML_OUT( XMLDBG "<floor level=\"%f\" ", od->subfloor[rep].min ); // if ( od->subfloor[rep].qual ) XML_OUT( "qual=\"%c\" ", od->subfloor[rep].qual ) XML_OUT( "by=\"%s\"/>", criteria[od->floor[rep].floorby] ); } break; default: puts(report_name[rep]); assert(0); break; } }
/* Report footer */ void xml_reportfooter(FILE *outf, Outchoices *od, choice rep) { XML_TRACE(0); }
/* The page footer, including the user's FOOTERFILE */ void xml_pagefoot(FILE *outf, Outchoices *od) { XML_TRACE(0); }
/* Footer material for this output style */ void xml_stylefoot(FILE *outf, Outchoices *od) { XML_TRACE(0); XML_OUT( XMLDBG"</analog-data>" ); }
/* The program run time */ void xml_runtime(FILE *outf, Outchoices *od, long secs) { XML_TRACE(0); // XML_OUT( XMLDBG"<property name=\"%s\" contents=\"%u\"/>", // "processingtime", secs); }
/* The credit line at the bottom of the page */ void xml_credit(FILE *outf, Outchoices *od) { XML_TRACE(0); }
/* Finishing the top of the page */ void xml_closehead(FILE *outf, Outchoices *od) { XML_TRACE(0); XML_OUT(XMLDBG"</analog>"); }
/* Allow month in dates? DO NOT enable for human-readable text because of i18n problems. */ logical xml_allowmonth(void) { XML_TRACE(0); return TRUE; }
/* Report description */ void xml_reportdesc(FILE *outf, Outchoices *od, choice rep) { XML_TRACE(0); }
/* "Each unit represents" line */ void xml_declareunit(FILE *outf, Outchoices *od, char graphby, double unit, unsigned int bmult) { XML_TRACE(0); }
/* General Summary footer */ void xml_gensumfoot(FILE *outf, Outchoices *od) { XML_TRACE(0); }
/* If column is terminated, set width and leave name blank; and conversely. */ void xml_colheadunderline(FILE *outf, Outchoices *od, choice rep, choice col, unsigned int width, char *name) {XML_TRACE(0);}
/* Start of a <pre> section */ void xml_prestart(FILE *outf, Outchoices *od) { XML_TRACE(0); }
/* Print level in hierarchy represented by this row */ void xml_levelcell(FILE *outf, Outchoices *od, choice rep, int level) { XML_TRACE(0); // XML_OUT( XMLDBG"<col name=\"COL_LEVEL\">%d</col>", level ); }
/* strlen */ size_t xml_strlength(const char *s) { XML_TRACE(0); return strlen(s); }
/* Page width */ unsigned int xml_pagewidth(Outchoices *od) { XML_TRACE(0); return 0; }
/* End of a <pre> section */ void xml_preend(FILE *outf, Outchoices *od) { XML_TRACE(0); }
/* Single cell, listing bytes */ void xml_bytescell(FILE *outf, Outchoices *od, choice rep, choice col, double b, double bmult, unsigned int width) { XML_TRACE(0); XML_OUT( XMLDBG"<col name=\"%s\">%f</col>", strtolower(column_name[col]), b ); }
/* An en dash */ char *xml_endash(void) { XML_TRACE(0); return "-"; }
/* Single cell, index */ void xml_indexcell(FILE *outf, Outchoices *od, choice rep, choice col, long index, unsigned int width) { XML_TRACE(0); XML_OUT( XMLDBG"<col name=\"%s\">%ld</col>", strtolower(column_name[col]), index ); }
/* putc with special characters escaped */ void xml_putch(FILE *outf, char c) { XML_TRACE(0); }
/* Blank line in time reports */ void xml_blankline(FILE *outf, Outchoices *od, choice *cols) { XML_TRACE(0); }
/* Include a header file or footer file */ void xml_includefile(FILE *outf, Outchoices *od, char *name, char type) { XML_TRACE(0); }