Line 5... |
Line 5... |
int table = 0;
|
int table = 0;
|
int tableend = 0;
|
int tableend = 0;
|
int bq = 0;
|
int bq = 0;
|
int bqend = 0;
|
int bqend = 0;
|
int did_main2start;
|
int did_main2start;
|
|
int desc = 0;
|
|
|
#define MAIN1_FILE "tmp/main1.html"
|
#define MAIN1_FILE "tmp/main1.html"
|
#define MAIN2_FILE "tmp/main2.html"
|
#define MAIN2_FILE "tmp/main2.html"
|
#define HF_FILE "tmp/hf.html"
|
#define HF_FILE "tmp/hf.html"
|
#define ISAHTMLSRC_FILE "tmp/isa.html"
|
#define ISAHTMLSRC_FILE "tmp/isa.html"
|
Line 53... |
Line 54... |
perror("do_main2start()/fopen:");
|
perror("do_main2start()/fopen:");
|
exit(1);
|
exit(1);
|
}
|
}
|
|
|
did_main2start = 1;
|
did_main2start = 1;
|
/* fprintf(f, "<div class=ISA%d style='text-align:justify'><br><br>\n", section);*/
|
|
fprintf(f, "<div class=ISA%d style='text-align:left'><br><br>\n", section);
|
fprintf(f, "<div class=ISA%d style='text-align:left'><br><br>\n", section);
|
fclose(f);
|
fclose(f);
|
}
|
}
|
|
|
void do_main2end()
|
void do_main2end()
|
Line 80... |
Line 80... |
}
|
}
|
|
|
void do_main2(char *line)
|
void do_main2(char *line)
|
{
|
{
|
FILE *f;
|
FILE *f;
|
|
char *bqp1, *bqp2;
|
|
char tmpbuf[4100];
|
|
char bq_str[50] = "<blockquote>";
|
|
char justify_str[100] = " style='text-align:justify'";
|
|
|
f = fopen(MAIN2_FILE, "a");
|
f = fopen(MAIN2_FILE, "a");
|
if (!f) {
|
if (!f) {
|
perror("do_main2()/fopen:");
|
perror("do_main2()/fopen:");
|
exit(1);
|
exit(1);
|
}
|
}
|
|
|
|
if (strstr(line, "Description:"))
|
|
desc = 1;
|
|
|
|
if (desc && (bqp1 = strstr(line, bq_str))) {
|
|
strcpy(tmpbuf, line);
|
|
bqp2 = strstr(tmpbuf, bq_str);
|
|
strcpy(bqp2 + strlen(bq_str) - 1, justify_str);
|
|
strcpy(bqp2 + strlen(bq_str) + strlen(justify_str) - 1, bqp1 + strlen(bq_str) - 1);
|
|
strcpy(line, tmpbuf);
|
|
desc = 0;
|
|
}
|
|
|
fprintf(f, "%s\n", line);
|
fprintf(f, "%s\n", line);
|
fclose(f);
|
fclose(f);
|
}
|
}
|
|
|
void create_main2()
|
void create_main2()
|
Line 174... |
Line 190... |
exit(1);
|
exit(1);
|
}
|
}
|
|
|
fprintf(f, "<div style='mso-element:header' id=ISA%dh><p class=MsoHeader>\n", section);
|
fprintf(f, "<div style='mso-element:header' id=ISA%dh><p class=MsoHeader>\n", section);
|
fprintf(f, "OpenCores<span style='mso-tab-count:1'> </span>\n");
|
fprintf(f, "OpenCores<span style='mso-tab-count:1'> </span>\n");
|
fprintf(f, "OpenRISC 1000 System Architecture Manual<span style='mso-tab-count:1'> </span>\n");
|
fprintf(f, "OpenRISC 1000 Architecture Manual<span style='mso-tab-count:1'> </span>\n");
|
fprintf(f, "<!--[if supportFields]><span style='mso-element:field-begin'>\n");
|
fprintf(f, "<!--[if supportFields]><span style='mso-element:field-begin'>\n");
|
fprintf(f, "</span> TIME \\@ "MMMM d, yyyy" <span style='mso-element:field-separator'>\n");
|
fprintf(f, "</span> TIME \\@ "MMMM d, yyyy" <span style='mso-element:field-separator'>\n");
|
fprintf(f, "</span><![endif]-->July 2, 2001<!--[if supportFields]><span\n");
|
fprintf(f, "</span><![endif]-->July 2, 2001<!--[if supportFields]><span\n");
|
fprintf(f, "style='mso-element:field-end'></span><![endif]--><br><br>\n");
|
fprintf(f, "style='mso-element:field-end'></span><![endif]--><br><br>\n");
|
|
|
Line 195... |
Line 211... |
exit(1);
|
exit(1);
|
}
|
}
|
|
|
fprintf(f, "<br><a href=\"http://www.opencores.org/\">www.opencores.org</a><span\n");
|
fprintf(f, "<br><a href=\"http://www.opencores.org/\">www.opencores.org</a><span\n");
|
fprintf(f, "style='mso-tab-count:\n");
|
fprintf(f, "style='mso-tab-count:\n");
|
fprintf(f, "1'> </span>Rev 0.5 <span style='color:red'>Preliminary Draft <span\n");
|
fprintf(f, "1'> </span>Rev 1.0 <span\n");
|
fprintf(f, "style='mso-tab-count:1'> </span></span><!--[if supportFields]><span\n");
|
fprintf(f, "style='mso-tab-count:1'> </span><!--[if supportFields]><span\n");
|
fprintf(f, "class=MsoPageNumber><span style='mso-element:field-begin'></span><span\n");
|
fprintf(f, "class=MsoPageNumber><span style='mso-element:field-begin'></span><span\n");
|
fprintf(f, "style=\"mso-spacerun: yes\"> </span>PAGE <span \n");
|
fprintf(f, "style=\"mso-spacerun: yes\"> </span>PAGE <span \n");
|
fprintf(f, "style='mso-element:field-separator'></span></span><![endif]--><span\n");
|
fprintf(f, "style='mso-element:field-separator'></span></span><![endif]--><span\n");
|
fprintf(f, "class=MsoPageNumber>1</span><!--[if supportFields]><span class=MsoPageNumber><span\n");
|
fprintf(f, "class=MsoPageNumber>1</span><!--[if supportFields]><span class=MsoPageNumber><span\n");
|
fprintf(f, "style='mso-element:field-end'></span></span><![endif]--><span\n");
|
fprintf(f, "style='mso-element:field-end'></span></span><![endif]--><span\n");
|
Line 241... |
Line 257... |
|
|
fprintf(f, "</p></div>\n");
|
fprintf(f, "</p></div>\n");
|
fclose(f);
|
fclose(f);
|
}
|
}
|
|
|
void do_hf(char * line)
|
void do_hf(char * line, int type)
|
{
|
{
|
FILE *f;
|
FILE *f;
|
|
char *tbp1, *tbp2;
|
|
char tmpbuf[4100];
|
|
char tb_str[50] = "<table";
|
|
char ins_str[100] = " width=100%";
|
|
|
f = fopen(HF_FILE, "a");
|
f = fopen(HF_FILE, "a");
|
if (!f) {
|
if (!f) {
|
perror("do_hf()/fopen:");
|
perror("do_hf()/fopen:");
|
exit(1);
|
exit(1);
|
}
|
}
|
|
|
|
if ((table < 3) && (tbp1 = strstr(line, tb_str))) {
|
|
strcpy(tmpbuf, line);
|
|
tbp2 = strstr(tmpbuf, tb_str);
|
|
strcpy(tbp2 + strlen(tb_str), ins_str);
|
|
strcpy(tbp2 + strlen(tb_str) + strlen(ins_str), tbp1 + strlen(tb_str));
|
|
strcpy(line, tmpbuf);
|
|
}
|
|
|
fprintf(f, "%s\n", line);
|
fprintf(f, "%s\n", line);
|
fclose(f);
|
fclose(f);
|
}
|
}
|
|
|
void processline(char *line)
|
void processline(char *line)
|
Line 281... |
Line 309... |
}
|
}
|
|
|
if (strstr(line, "</table>")) {
|
if (strstr(line, "</table>")) {
|
tableend++;
|
tableend++;
|
if (tableend == HEND) {
|
if (tableend == HEND) {
|
do_hf(line);
|
do_hf(line, table);
|
do_hfend();
|
do_hfend();
|
}
|
}
|
if (tableend == FEND) {
|
if (tableend == FEND) {
|
do_hf(line);
|
do_hf(line, table);
|
do_bottomline();
|
do_bottomline();
|
do_hfend();
|
do_hfend();
|
}
|
}
|
} else
|
} else
|
if ((tableend == HEND) && (table == HEND)) {
|
if ((tableend == HEND) && (table == HEND)) {
|
Line 321... |
Line 349... |
else
|
else
|
do_main2(line);
|
do_main2(line);
|
}
|
}
|
|
|
if (((table == HSTART) || (table == HEND)) && (tableend < HEND))
|
if (((table == HSTART) || (table == HEND)) && (tableend < HEND))
|
do_hf(line);
|
do_hf(line, table);
|
|
|
if (table == FSTART)
|
if (table == FSTART)
|
do_hf(line);
|
do_hf(line, table);
|
|
|
}
|
}
|
|
|
void readsrc(char *filename)
|
void readsrc(char *filename)
|
{
|
{
|
FILE *f;
|
FILE *f;
|