version 1.4, 2013/09/02 20:08:41 |
version 1.6, 2017/08/31 06:42:51 |
|
|
/* $OpenXM: OpenXM/src/asir-doc/html_tools/gen_hh.c,v 1.3 2013/08/31 13:45:59 ohara Exp $ */ |
/* $OpenXM: OpenXM/src/asir-doc/html_tools/gen_hh.c,v 1.5 2017/08/31 03:53:00 ohara Exp $ */ |
|
|
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
|
|
#include <windows.h> |
#include <windows.h> |
#endif |
#endif |
|
|
|
#define HEADER_INDEX \ |
|
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n" \ |
|
"<HTML>\n<HEAD>\n" \ |
|
"<meta name=\"GENERATOR\" content=\"Microsoft® HTML Help Workshop 4.1\">\n" \ |
|
"<!-- Sitemap 1.0 -->\n</HEAD><BODY>\n" |
|
|
|
#define HEADER_TOC \ |
|
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n" \ |
|
"<HTML>\n<HEAD>\n" \ |
|
"<meta name=\"GENERATOR\" content=\"Microsoft® HTML Help Workshop 4.1\">\n" \ |
|
"<!-- Sitemap 1.0 -->\n</HEAD><BODY>\n" \ |
|
"<OBJECT type=\"text/site properties\">\n" \ |
|
"<param name=\"ImageType\" value=\"Folder\">\n" \ |
|
"</OBJECT>\n<UL>\n" |
|
|
void gen_hhp(char *out, int n, char *indir, char *prefix_, char *help) |
void gen_hhp(char *out, int n, char *indir, char *prefix_, char *help) |
{ |
{ |
int i; |
int i; |
Line 40 void conv_toc(char *in, char *out, char *prefix_, char |
|
Line 55 void conv_toc(char *in, char *out, char *prefix_, char |
|
|
|
inf = fopen(in,"r"); |
inf = fopen(in,"r"); |
outf = fopen(out,"w"); |
outf = fopen(out,"w"); |
fprintf(outf,"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n"); |
fputs(HEADER_TOC,outf); |
fprintf(outf,"<HTML>\n<HEAD>\n"); |
|
fprintf(outf,"<meta name=\"GENERATOR\" content=\"Microsoft® HTML Help Workshop 4.1\">\n"); |
|
fprintf(outf,"<!-- Sitemap 1.0 -->\n</HEAD><BODY>\n"); |
|
fprintf(outf,"<OBJECT type=\"text/site properties\">\n"); |
|
fprintf(outf,"<param name=\"ImageType\" value=\"Folder\">\n"); |
|
fprintf(outf,"</OBJECT>\n<UL>\n"); |
|
|
|
while ( 1 ) { |
while ( 1 ) { |
c = fgetc(inf); |
c = fgetc(inf); |
Line 58 void conv_toc(char *in, char *out, char *prefix_, char |
|
Line 67 void conv_toc(char *in, char *out, char *prefix_, char |
|
break; |
break; |
if ( fname = strstr(buf,prefix_) ) { |
if ( fname = strstr(buf,prefix_) ) { |
ptr = strchr(buf,'#'); |
ptr = strchr(buf,'#'); |
|
if(!ptr) continue; |
*ptr = 0; |
*ptr = 0; |
ptr = strchr(ptr+1,'>'); |
ptr = strchr(ptr+1,'>'); |
ptr++; |
ptr++; |
if ( *ptr == '<' ) |
if ( *ptr == '<' ) |
ptr = strchr(ptr+1,'>')+1; |
ptr = strchr(ptr+1,'>')+1; |
ptr1 = strchr(ptr,'<'); |
ptr1 = strchr(ptr,'<'); |
*ptr1 = 0; |
if(ptr1) *ptr1 = 0; |
fprintf(outf,"<LI><OBJECT type=\"text/sitemap\">\n"); |
fprintf(outf,"<LI><OBJECT type=\"text/sitemap\">\n"); |
fprintf(outf,"<param name=\"Name\" value=\"%s\">\n",ptr); |
fprintf(outf,"<param name=\"Name\" value=\"%s\">\n",ptr); |
fprintf(outf,"<param name=\"Local\" value=\"%s\\%s\">\n",indir,fname); |
fprintf(outf,"<param name=\"Local\" value=\"%s\\%s\">\n",indir,fname); |
Line 83 void conv_index(char *in, char *out, char *prefix_, ch |
|
Line 93 void conv_index(char *in, char *out, char *prefix_, ch |
|
inf = fopen(in,"r"); |
inf = fopen(in,"r"); |
outf = fopen(out,"w"); |
outf = fopen(out,"w"); |
|
|
fprintf(outf,"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n"); |
fputs(HEADER_INDEX, outf); |
fprintf(outf,"<HTML>\n<HEAD>\n"); |
|
fprintf(outf,"<meta name=\"GENERATOR\" content=\"Microsoft® HTML Help Workshop 4.1\">\n"); |
|
fprintf(outf,"<!-- Sitemap 1.0 -->\n</HEAD><BODY>\n"); |
|
fprintf(outf,"</HEAD><BODY>\n"); |
|
|
|
while ( 1 ) { |
while ( 1 ) { |
fgets(buf,BUFSIZ,inf); |
fgets(buf,BUFSIZ,inf); |
Line 100 void conv_index(char *in, char *out, char *prefix_, ch |
|
Line 106 void conv_index(char *in, char *out, char *prefix_, ch |
|
break; |
break; |
if ( fname = strstr(buf,prefix_) ) { |
if ( fname = strstr(buf,prefix_) ) { |
ptr = strchr(buf,'#'); |
ptr = strchr(buf,'#'); |
|
if(!ptr) continue; |
*ptr = 0; |
*ptr = 0; |
ptr = strchr(ptr+1,'>'); |
ptr = strchr(ptr+1,'>'); |
ptr++; |
ptr++; |
if ( *ptr == '<' ) |
if ( *ptr == '<' ) |
ptr = strchr(ptr+1,'>')+1; |
ptr = strchr(ptr+1,'>')+1; |
ptr1 = strchr(ptr,'<'); |
ptr1 = strchr(ptr,'<'); |
*ptr1 = 0; |
if(ptr1) *ptr1 = 0; |
fprintf(outf,"<LI><OBJECT type=\"text/sitemap\">\n"); |
fprintf(outf,"<LI><OBJECT type=\"text/sitemap\">\n"); |
fprintf(outf,"<param name=\"Name\" value=\"%s\">\n",ptr); |
fprintf(outf,"<param name=\"Name\" value=\"%s\">\n",ptr); |
fprintf(outf,"<param name=\"Local\" value=\"%s\\%s\">\n",indir,fname); |
fprintf(outf,"<param name=\"Local\" value=\"%s\\%s\">\n",indir,fname); |