Exemple #1
0
int CMSaveSimulation::ReliabilitySeries(const CMString& fname)
{
	unsigned i;

	if (!open_file(fname))
   	return -1;
	wchar_t buffer[128];
	get_data_from_simulation();
	int oldformat = CMTime::SetOutputFormat(simincunits);

	long row=0;

   long nrows = 1 + relseries_records;

	for (i=0;i<reliability->Targets();i++) {
		const wchar_t* tname = reliability->Target(i)->GetString().c_str();
		for (CMTime tm=outbeg;tm<=outend;tm.inc(simincsteps,simincunits),row++) {
		   output_item(OutReliabilitySeries,tname,row,0,maxtargetlength,0);
		   output_item(OutReliabilitySeries,_wtof(tm.GetString(buffer, 128)),row,1,fieldwidth,0);
		   output_item(OutReliabilitySeries,reliability->FailPct(tm,i),row,2,fieldwidth,1);
         output_record_end(row);
      }
   }

	output_footer(OutReliabilitySeries);

	CMTime::SetOutputFormat(oldformat);
   delete fout;
   fout=0;
   return 0;
}
Exemple #2
0
int CMSaveSimulation::Outcomes(const CMString& fname)
{
	if (!open_file(fname))
		return -1;

	if (_aggresults) delete[] _aggresults;
	if (_aggindex) 	 delete[] _aggindex;

	_aggresults = new float[arrayindex.Count()];
	_aggindex = new unsigned[arrayindex.Count()];

	get_data_from_simulation();

	output_item(OutRealizations, L"Trial", 0, 0, fieldwidth, 0);
	output_item(OutRealizations, L"Period", 0, 1, fieldwidth, 0);

	long row = 0;

	for (unsigned i = 0; i < arrayindex.Count(); i++) {
		_aggindex[i] = arrayindex[i]->GetIndex();
		output_item(OutRealizations, array->GetVariableName(arrayindex[i]->GetIndex()).c_str(), 0, i + 2, fieldwidth, arrayindex[i]->IsCostVariable() ? _costPrecision : _precision);
	}

	output_record_end(row++);

	int oldformat = CMTime::SetOutputFormat(outincunits);

	long nrows = 1 + realization_records;

	long trialno;

	CMTime tm;

	if (state & rSortByTrial) {
		for (trialno = trialbeg; trialno <= trialend; trialno++) {
			for (tm = outbeg; tm <= outend; tm.inc(outincsteps, outincunits))
				output_realizations_record(tm, trialno, row++);
		}
	}
	else {
		for (tm = outbeg; tm <= outend; tm.inc(outincsteps, outincunits)) {
			for (trialno = trialbeg; trialno <= trialend; trialno++)
				output_realizations_record(tm, trialno, row++);
		}
	}

	output_footer(OutRealizations);

	delete[] _aggresults;
	delete[] _aggindex;
	_aggresults = 0;
	_aggindex = 0;
	delete fout;
	fout = 0;
	CMNotifier::Notify(CMNotifier::INFO, L"");
	CMTime::SetOutputFormat(oldformat);
	return 0;
}
Exemple #3
0
int CMSaveSimulation::Summary(const CMString& fname)
{
	unsigned i;

	if (!open_file(fname))
		return -1;
	wchar_t buffer[128];
	get_data_from_simulation();

	long row = 0;

	int oldformat = CMTime::SetOutputFormat(simincunits);
	long nrows = 1 + summary_records;

	for (i = 0; i < accumindex.Count(); i++) {
		double val;
		unsigned varindex = accumindex[i]->GetIndex();
		const wchar_t* vname = _accum->GetVariableName(varindex).c_str();
		for (CMTime tm = outbeg; tm <= outend; tm.inc(simincsteps, simincunits), row++) {
			output_item(OutSummary, vname, row, 0, maxnamelength, 0);
			output_item(OutSummary, _wtof(tm.GetString(buffer, 128)), row, 1, fieldwidth, 0);
			for (int j = 0; j < 4; j++) {
				switch (j) {
				case 0: val = _accum->Mean(tm, varindex); break;
				case 1: val = _accum->StdDev(tm, varindex); break;
				case 2: val = _accum->Min(tm, varindex); break;
				case 3: val = _accum->Max(tm, varindex); break;
				}
				output_item(OutSummary, val, row, j + 2, fieldwidth, accumindex[i]->IsCostVariable() ? _costPrecision : _precision);
			}
			output_record_end(row);
		}
	}

	output_footer(OutSummary);

	CMTime::SetOutputFormat(oldformat);
	delete fout;
	fout = 0;
	return 0;
}
int main(int argc, char *argv[])
{
    DIR *dir;
    struct dirent *entry;
    struct stat st;
    FTPWhoEntry *scanned_entry;
    int locked;
    int delete_file;
    const char *state;
    time_t now;
    int fodder;

#ifndef NON_ROOT_FTP
    if (geteuid() != (uid_t) 0) {
        puts("You must be root to run this. Sorry.");
        return 1;
    }
#endif
    if (argc < 0) {
        return -1;
    }
    if (closedesc_but1() < 0) {
        return -2;
    }
#ifdef HAVE_SETLOCALE
# ifdef LC_MESSAGES
    (void) setlocale(LC_MESSAGES, "");
# endif
# ifdef LC_CTYPE
    (void) setlocale(LC_CTYPE, "");
# endif
# ifdef LC_COLLATE
    (void) setlocale(LC_COLLATE, "");
# endif
#endif    
    
    fixlimits();
# ifdef SIGFPE
    signal(SIGFPE, sigfpe);
# endif
# ifdef SIGSEGV
    signal(SIGSEGV, sigsegv);
# endif
    
    if (getenv("GATEWAY_INTERFACE") != NULL) {
        html_cgi = 1;
        output_header = html_output_header;
        output_line = html_output_line;            
        output_footer = html_output_footer;        
    }
    while ((fodder = getopt(argc, argv, "CchHnpsvwWx")) != -1) {
        switch(fodder) {
        case 'h' :
            help();
            /* doesn't return */
        case 'n' :
        case 'H' :
            dont_resolve_ip++;
            break;
        case 'C' :
        case 'c' :
            html_cgi++;
        case 'W' :
            html_raw++;
        case 'w' :
            output_header = html_output_header;
            output_line = html_output_line;            
            output_footer = html_output_footer;
            break;
        case 'p' :
            output_header = plist_output_header;
            output_line = plist_output_line;
            output_footer = plist_output_footer;
            break;
        case 's' :
            output_header = shell_output_header;
            output_line = shell_output_line;            
            output_footer = shell_output_footer;
            break;            
        case 'x' :
            output_header = xml_output_header;
            output_line = xml_output_line;            
            output_footer = xml_output_footer;
            break;            
        case 'v' :
            verbose++;
            break;
        case '?' :
            help();
        }
    }    
    now = time(NULL);
    if (chdir(SCOREBOARD_PATH) != 0 ||
        (dir = opendir(".")) == NULL) {
        fprintf(stderr, "Unable to open the ftpwho scoreboard.\n"
                "Make sure that the [" SCOREBOARD_PATH "/] directory exists,\n"
                "Or wait until a client connects, so that it gets\n"
                "automatically created. This message doesn't mean that your\n"
                "server didn't start properly. It probably just means that\n"
                "you are running it with ftpwho for the first time.\n");
        return -1;
    }
    lock.l_whence = SEEK_SET;
    lock.l_start = (off_t) 0;
    lock.l_len = (off_t) 0;
    lock.l_pid = getpid();    
    output_header();
    while ((entry = readdir(dir)) != NULL) {
        mmap_fd = -1;
        locked = 0;
        delete_file = 0;
        scanned_entry = NULL;
        if (strncmp(entry->d_name, SCOREBOARD_PREFIX,
                    sizeof SCOREBOARD_PREFIX - 1U) != 0) {
            goto nextone;
        }
        if ((mmap_fd = open(entry->d_name, O_RDWR | O_NOFOLLOW)) == -1) {
            goto nextone;
        }
        if (fstat(mmap_fd, &st) != 0 || !S_ISREG(st.st_mode) ||
            (st.st_mode & 0600) != 0600 || 
            st.st_size != (off_t) sizeof (FTPWhoEntry) ||
#ifdef NON_ROOT_FTP
            st.st_uid != geteuid()
#else
            st.st_uid != (uid_t) 0
#endif
            ) {
            goto nextone;
        }
        ftpwho_lock();
        locked++;
        if ((scanned_entry =
             (FTPWhoEntry *) mmap(NULL, sizeof (FTPWhoEntry),
                                  PROT_READ, 
                                  MAP_SHARED | MAP_FILE, 
                                  mmap_fd, (off_t) 0)) == (void *) MAP_FAILED) {
            goto nextone;
        }
        if (checkproc(scanned_entry->pid) == 0) {
            /* still in the scoreboard, but no more process */
            delete_file++;
            goto nextone;
        }        
        if (scanned_entry->state != FTPWHO_STATE_FREE) {
            unsigned long since;
            unsigned long xfer_since;
            char local_port[NI_MAXSERV];
            char local_hbuf[NI_MAXHOST];            
            char hbuf[NI_MAXHOST];

            switch (scanned_entry->state) {
            case FTPWHO_STATE_IDLE :
                state = "IDLE";
                break;
            case FTPWHO_STATE_DOWNLOAD :
                state = " DL ";
                break;
            case FTPWHO_STATE_UPLOAD :
                state = " UL ";
                break;
            default :
                state = "ERR!";
            }
            if (scanned_entry->date < now) {
                since = (unsigned long) (now - scanned_entry->date);
            } else {
                since = 0UL;
            }
            if (scanned_entry->xfer_date > (time_t) 0 &&
                scanned_entry->xfer_date < now) {
                xfer_since = (unsigned long) (now - scanned_entry->xfer_date);
            } else {
                xfer_since = 0UL;
            }
            for (;;) {
                int eai;
                                
                if ((eai = getnameinfo
                     ((struct sockaddr *) &scanned_entry->addr,
                      STORAGE_LEN(scanned_entry->addr),
                      hbuf, sizeof hbuf, NULL, (size_t) 0U,
                      dont_resolve_ip != 0 ? NI_NUMERICHOST : 0)) == 0) {
                    break;
                }
#if defined(EAI_NONAME) && defined(EAI_SYSTEM)
                if ((eai == EAI_NONAME || eai == EAI_SYSTEM) &&
                    dont_resolve_ip == 0 &&
                    getnameinfo
                    ((struct sockaddr *) &scanned_entry->addr,
                     STORAGE_LEN(scanned_entry->addr),
                     hbuf, sizeof hbuf, NULL, (size_t) 0U,
                     NI_NUMERICHOST) == 0) {
                    break;
                }                
#endif
                goto nextone;
            }
            for (;;) {
                int eai;
                
                if ((eai = getnameinfo
                     ((struct sockaddr *) &scanned_entry->local_addr,
                      STORAGE_LEN(scanned_entry->addr),
                      local_hbuf, sizeof local_hbuf,
                      local_port, sizeof local_port,
                      dont_resolve_ip != 0 ? (NI_NUMERICHOST | NI_NUMERICSERV) :
                      NI_NUMERICSERV)) == 0) {
                    break;
                }
#if defined(EAI_NONAME) && defined(EAI_SYSTEM)
                if ((eai == EAI_NONAME || eai == EAI_SYSTEM) &&
                    dont_resolve_ip == 0 &&
                    getnameinfo
                    ((struct sockaddr *) &scanned_entry->local_addr,
                     STORAGE_LEN(scanned_entry->addr),
                     local_hbuf, sizeof local_hbuf,
                     local_port, sizeof local_port,
                     NI_NUMERICHOST | NI_NUMERICSERV) == 0) {
                    break;
                }
#endif
                goto nextone;
            }
            output_line(scanned_entry->pid, scanned_entry->account,
                        since, xfer_since, state, scanned_entry->filename, 
                        hbuf, local_hbuf, local_port,
                        (scanned_entry->restartat <= 
                         scanned_entry->download_current_size) ?
                        scanned_entry->restartat : (off_t) 0,
                        (scanned_entry->state == FTPWHO_STATE_DOWNLOAD) ?
                        scanned_entry->download_total_size : (off_t) 0,
                        (scanned_entry->state == FTPWHO_STATE_DOWNLOAD ||
                         scanned_entry->state == FTPWHO_STATE_UPLOAD) ?
                        scanned_entry->download_current_size : (off_t) 0);
        }
        nextone:
        if (locked != 0 && mmap_fd != -1) {
            ftpwho_unlock();
        }
        if (scanned_entry != NULL) {
            (void) munmap((void *) scanned_entry, sizeof (FTPWhoEntry));
        }
        if (mmap_fd != -1) {
            close(mmap_fd);
        }
        if (delete_file != 0) {
            unlink(entry->d_name);
        }
    }    
    output_footer();
    
    return 0;
}
int main(int argc, char **argv)
{
	char *descriptor;
	char *curpos; /* current position in input string */
	struct keyval *parser_id; /* the parser we are creating output for */
	FILE *outputf;
	struct keyval *rkv; /* current read key:val */
	struct keyval_list *curlist;
	bool do_token_check = true; /* if the check for valid tokens is done */
	bool only_ident = true; /* if the only token type is ident */
	bool is_generic = false;

	struct keyval_list base;
	struct keyval_list IDENT;
	struct keyval_list IDENT_LIST;
	struct keyval_list LENGTH_UNIT;
	struct keyval_list URI;
	struct keyval_list WRAP;
	struct keyval_list NUMBER;
	struct keyval_list COLOR;


	if (argc < 2) {
		fprintf(stderr,"Usage: %s [-o <filename>] <descriptor>\n", argv[0]);
		return 1;
	}

	if ((argv[1][0] == '-') && (argv[1][1] == 'o')) {
		if (argc != 4) {
			fprintf(stderr,"Usage: %s [-o <filename>] <descriptor>\n", argv[0]);
			return 1;
		}
		outputf = fopen(argv[2], "w");
		if (outputf == NULL) {
			perror("unable to open file");
		}
		descriptor = strdup(argv[3]);
	} else {
		outputf = stdout;
		descriptor = strdup(argv[1]);
	}
	curpos = descriptor;

	base.count = 0;
	IDENT.count = 0;
	URI.count = 0;
	WRAP.count = 0;
	NUMBER.count = 0;
	COLOR.count = 0;
	LENGTH_UNIT.count = 0;
	IDENT_LIST.count = 0;

	curlist = &base;

	while (*curpos != 0) {
		rkv = get_keyval(&curpos);
		if (rkv == NULL) {
			fprintf(stderr,"Token error at offset %ld\n", curpos - descriptor);
			fclose(outputf);
			return 2;
		}

		if (strcmp(rkv->key, "WRAP") == 0) {
			WRAP.item[WRAP.count++] = rkv;
			only_ident = false;
		} else if (strcmp(rkv->key, "NUMBER") == 0) {
			if (rkv->val[0] == '(') {
				curlist = &NUMBER;
			} else if (rkv->val[0] == ')') {
				curlist = &base;
			} else {
				NUMBER.item[NUMBER.count++] = rkv;
			}
			only_ident = false;
		} else if (strcmp(rkv->key, "IDENT") == 0) {
			if (rkv->val[0] == '(') {
				curlist = &IDENT;
			} else if (rkv->val[0] == ')') {
				curlist = &base;
			} else if (strcmp(rkv->val, str_INHERIT) == 0) {
				IDENT.item[IDENT.count++] = &ident_inherit;
			}
		} else if (strcmp(rkv->key, "IDENT_LIST") == 0) {
			if (rkv->val[0] == '(') {
				curlist = &IDENT_LIST;
			} else if (rkv->val[0] == ')') {
				curlist = &base;
			} 
		} else if (strcmp(rkv->key, "LENGTH_UNIT") == 0) {
			if (rkv->val[0] == '(') {
				curlist = &LENGTH_UNIT;
			} else if (rkv->val[0] == ')') {
				curlist = &base;
			} 
			only_ident = false;
			do_token_check = false;
		} else if (strcmp(rkv->key, "COLOR") == 0) {
			COLOR.item[COLOR.count++] = rkv;
			do_token_check = false;
			only_ident = false;
		} else if (strcmp(rkv->key, "URI") == 0) {
			URI.item[URI.count++] = rkv;
			only_ident = false;
		} else if (strcmp(rkv->key, "GENERIC") == 0) {
			is_generic = true;
		} else {
			/* just append to current list */
			curlist->item[curlist->count++] = rkv;
		}
	}

	if (base.count != 1) {
		fprintf(stderr,"Incorrect base element count (got %d expected 1)\n", base.count);
		fclose(outputf);
		return 3;
	}


	/* header */
output_header(outputf, descriptor, base.item[0], is_generic);

	if (WRAP.count > 0) {
		output_wrap(outputf, base.item[0], &WRAP);
	} else {
		/* check token type is correct */
		output_token_type_check(outputf, do_token_check,  &IDENT, &URI, &NUMBER);

		if (IDENT.count > 0)
			output_ident(outputf, only_ident, base.item[0], &IDENT);

		if (URI.count > 0)
			output_uri(outputf, base.item[0], &URI);

		if (NUMBER.count > 0)
			output_number(outputf, base.item[0], &NUMBER);

		/* terminal blocks, these end the ladder ie no trailing else */
		if (COLOR.count > 0) {
			output_color(outputf, base.item[0], &COLOR);
		} else if (LENGTH_UNIT.count > 0) {
			output_length_unit(outputf, base.item[0], &LENGTH_UNIT);
		} else if (IDENT_LIST.count > 0) {
			output_ident_list(outputf, base.item[0], &IDENT_LIST);
		} else {
			output_invalidcss(outputf);
		}

		output_footer(outputf);

	}

	fclose(outputf);

	return 0;
}
Exemple #6
0
int CMSaveSimulation::ReliabilityDetail(const CMString& fname)
{
	if (!open_file(fname))
   	return -1;
	get_data_from_simulation();
	int oldformat = CMTime::SetOutputFormat(outincunits);

   int i,j;
   int step;

	if (!reldetailtargets)
		return 0;

   long row = 0;
   CMTime tm;

	long** bins = new long*[reldetailtargets*outtimesteps];
	for (i=0;i<outtimesteps;i++)
   	bins[i] = new long[20];
	double* expected = new double[reldetailtargets*outtimesteps];
 	double* maxshortage = new double[reldetailtargets*outtimesteps];

	for (i=0;i<(int)reldetailtargets*outtimesteps;i++) {
	  	expected[i]=0;
   	maxshortage[i]=100;
      for (j=0;j<20;j++)
			bins[i][j] = 0;
	}

   step = 0;

	for (tm=outbeg;tm<=outend;tm.inc(outincsteps,outincunits),step++) {
		for (long trial=trialbeg;trial<=trialend;trial++) {
			for (i=0;i<(int)reldetailtargets;i++) {
				CMReliabilityTarget* target = reliability->Target(reldetailindex[i]);
				unsigned sindex = array->VariableIndex(target->ShortageVariable());
				unsigned pindex = array->VariableIndex(target->PercentageVariable());
				int ispercent = (target->IsPercent() && pindex<array->Variables());
				double sval;
				if (!ispercent && sindex<array->Variables()) {
					maxshortage[step*reldetailtargets+i]=0;
					for (long tr=trialbeg;tr<=trialend;tr++) {
						sval = target->ShortageSign() * get_realization(tm,sindex,tr);
            	   if (sval > maxshortage[step*reldetailtargets+i]) maxshortage[step*reldetailtargets+i] = sval;
	            }
   	      }
      	   sval=0;
				if (sindex<array->Variables()) {
					sval = target->ShortageSign() * get_realization(tm,sindex,trial);
					double pval = (ispercent) ? (target->PercentSign()*get_realization(tm,pindex,trial)) : 0;
					if (pval != 0) sval *= (100/pval);
				}
				if (sval>1e-9) {
					expected[step*reldetailtargets+i] += sval;
					int binno = ispercent ? (int)(sval/5) : (int)(20*sval/maxshortage[step*reldetailtargets+i]);
					if (binno>=20) binno=19;
					bins[step*reldetailtargets+i][binno]++;
				}
			}
      }
	}

   for (step=0;step<(int)outtimesteps;step++)
		for (i=0;i<(int)reldetailtargets;i++)
			for (j=18;j>=0;j--)
				bins[step*reldetailtargets+i][j] += bins[step*reldetailtargets+i][j+1];

	step = 0;
	for (tm=outbeg;tm<=outend;tm.inc(outincsteps,outincunits),step++) {
		for (i=0;i<(int)reldetailtargets;i++,row++) {
   		long col = 0;
		   output_item(OutReliabilityDetail,reliability->Target(reldetailindex[i])->GetString().c_str(),row,col++,maxtargetlength,0);
		   output_item(OutReliabilityDetail,last_timestep_in_interval(tm),row,col++,fieldwidth,0);
         for (j=0;j<20;j++)
				output_item(OutReliabilityDetail,100*(double)bins[step*reldetailtargets+i][j]/_outtrials,row,col++,fieldwidth,1);
			output_item(OutReliabilityDetail,100*(double)bins[step*reldetailtargets+i][0]/_outtrials,row,col++,fieldwidth,1);
			output_item(OutReliabilityDetail,expected[step*reldetailtargets+i]/_outtrials,row,col++,fieldwidth,1);
         output_record_end(row);
      }
   }

	output_footer(OutReliabilityDetail);

	delete [] expected;
	delete [] maxshortage;
	for (i=0;i<outtimesteps;i++)
   	delete [] bins[i];
	delete [] bins;
   delete fout;
   fout = 0;

   CMTime::SetOutputFormat(oldformat);
   return 0;
}
Exemple #7
0
void OutputTableHTML(void)
{
	int i, j, k;
	int melo = 0 - 1;

	void output_header();
	if (center_tables)
	{
		printf("<CENTER>");
		do_cr();
	}

	SetupExtraction();

	/* Here's where we dump the Html Page out */
	for (i=first_sheet; i<=last_sheet; i++)	/* For each worksheet */
	{
		update_default_font(i);
		if (ws_array[i] == 0)
			continue;
		if ((ws_array[i]->biggest_row == -1)||(ws_array[i]->biggest_col == -1))
			continue;
		if (ws_array[i]->c_array == 0)
			continue;
		trim_sheet_edges(i);

		/* Print its name */
		if (next_ws_title > 0)
		{
			if (ws_array[i]->ws_title.str)
			{
				printf("<H1><CENTER>");
				OutputString(&ws_array[i]->ws_title);
				printf("</CENTER></H1><br>");
				do_cr();
			}
			else
			{
				printf("<H1><CENTER>(Unknown Page)</CENTER></H1><br>");
				do_cr();
			}
		}

		/* Now dump the table */
		printf("<FONT FACE=\"");
		OutputString(&default_font);
		if (default_fontsize != 3)
			printf("\" SIZE=\"%d", default_fontsize);
		printf("\">");
		do_cr();
		printf("<TABLE BORDER=\"1\" CELLSPACING=\"2\">");
		do_cr();
		
		for (j=ws_array[i]->first_row; j<=ws_array[i]->biggest_row; j++)
		{
			update_default_alignment(i, j);
			melo++;
			printf("<TR   title=\"%u\" ",melo);
			if (null_string((U8 *)default_alignment))
				printf(">");
			else
			{
				if (strcmp(default_alignment, "left") != 0)
					printf(" ALIGN=\"%s\"", default_alignment);
				if (!aggressive)
					printf(" VALIGN=\"bottom\">\n");
				else
					printf(">");
			}
			for (k=ws_array[i]->first_col; k<=ws_array[i]->biggest_col; k++)
			{
				output_cell(ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k],0); /* This stuff happens for each cell... */
				if (ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k])
				{
					if (ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]->colspan != 0)
						 k += ws_array[i]->c_array[(j*ws_array[i]->max_cols)+k]->colspan-1;
				}
			}

			if (!aggressive)
				printf("</TR>\n");
		}
		printf("</table></FONT><HR>");
		do_cr();
	}

	if (center_tables)
	{
		printf("</CENTER>");
		do_cr();
	}

	/* Print the author's name in itallics... */
	if (author.str)
	{
		printf("<FONT SIZE=-1><I>Spreadsheet's Author:&nbsp;");
		OutputString(&author);
		printf("</I></FONT><br>");
		do_cr();
	}
	
	
	printf("<FONT SIZE=8><I>Total rows = %u + 1 header ",melo);
	printf("</I></FONT><br>");
	do_cr();

	/* Print when & how the file was last updated. */
	printf("<FONT SIZE=-1><I>Last Updated ");
	if (lastUpdated)
		printf("%s&nbsp; ", lastUpdated);
	switch (file_version)
	{
		case EXCEL95:
			printf("with Excel 5.0 or 95");
			break;
		case EXCEL97:
			printf("with Excel 97");
			break;
		default:
			printf("with Excel ????");
			break;
	}
	printf("</I></FONT><br>");
	do_cr();

	/* Next print Disclaimers... */
	if (NoFormat)
	{
		printf("<br>* This cell's format is not supported.<br>");
		do_cr();
	}
	if ((notAccurate)&&(formula_warnings))
	{
		printf("<br>** This cell's data may not be accurate.<br>");
		do_cr();
	}
	if (NotImplemented)
	{
		printf("<br>*** This cell's data type will be supported in the future.<br>");
		do_cr();
	}
	if (Unsupported)
	{
		printf("<br>**** This cell's type is unsupported.<br>");
		do_cr();
	}

	/* Now out exceeded capacity warnings... */
	if (MaxWorksheetsExceeded || MaxRowExceeded || MaxColExceeded || MaxStringsExceeded ||
		MaxFontsExceeded || MaxPalExceeded || MaxXFExceeded || MaxFormatsExceeded )
		printf("<FONT COLOR=\"%s\">", colorTab[0x0A]);
	if (MaxWorksheetsExceeded)
	{
		printf("The Maximum Number of Worksheets was exceeded, you might want to increase it.<br>");
		do_cr();
	}
	if (MaxRowExceeded)
	{
		printf("The Maximum Number of Rows was exceeded, you might want to increase it.<br>");
		do_cr();
	}
	if (MaxColExceeded)
	{
		printf("The Maximum Number of Columns was exceeded, you might want to increase it.<br>");
		do_cr();
	}
	if (MaxStringsExceeded)
	{
		printf("The Maximum Number of Strings was exceeded, you might want to increase it.<br>");
		do_cr();
	}
	if (MaxFontsExceeded)
	{
		printf("The Maximum Number of Fonts was exceeded, you might want to increase it.<br>");
		do_cr();
	}
	if (MaxPalExceeded)
	{
		printf("The Maximum Number of Color Palettes was exceeded, you might want to increase it.<br>");
		do_cr();
	}
	if (MaxXFExceeded)
	{
		printf("The Maximum Number of Extended Formats was exceeded, you might want to increase it.<br>");
		do_cr();
	}
	if (MaxFormatsExceeded)
	{
		printf("The Maximum Number of Formats was exceeded, you might want to increase it.<br>");
		do_cr();
	}
	if (MaxWorksheetsExceeded || MaxRowExceeded || MaxColExceeded || MaxStringsExceeded ||
		MaxFontsExceeded || MaxPalExceeded || MaxXFExceeded || MaxFormatsExceeded )
		printf("</FONT>");

	printf("&nbsp;<br>");
	do_cr();

	/* Output Credit */
	printf("<hr><FONT SIZE=-1>Created with <a href=\"http://chicago.sf.net/xlhtml\">xlhtml %s</a></FONT><br>", VERSION);
	do_cr();

	/* Output Tail */
	output_footer();
}