Annotation of OpenXM/src/asir-doc/html_tools/conv_toc.c, Revision 1.2
1.1 noro 1: #include <stdio.h>
1.2 ! noro 2: #include <string.h>
1.1 noro 3:
4: main ()
5: {
1.2 ! noro 6: char buf[BUFSIZ];
! 7: char *fname,*ptr,*ptr1;
! 8: int c;
! 9:
! 10: printf("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n");
! 11: printf("<HTML>\n<HEAD>\n");
! 12: printf("<meta name=\"GENERATOR\" content=\"Microsoft® HTML Help Workshop 4.1\">\n");
! 13: printf("<!-- Sitemap 1.0 -->\n</HEAD><BODY>\n");
! 14: printf("<OBJECT type=\"text/site properties\">\n");
! 15: printf("<param name=\"ImageType\" value=\"Folder\">\n");
! 16: printf("</OBJECT>\n<UL>\n");
1.1 noro 17:
18: while ( 1 ) {
1.2 ! noro 19: c = fgetc(stdin);
1.1 noro 20: if ( c == EOF )
1.2 ! noro 21: break;
! 22: ungetc(c,stdin);
! 23: fgets(buf,BUFSIZ,stdin);
! 24: if ( !strncmp(buf,"Jump to:",strlen("Jump to:")) )
! 25: break;
! 26: if ( fname = strstr(buf,"man_") ) {
! 27: ptr = strchr(buf,'#');
! 28: *ptr = 0;
! 29: ptr = strchr(ptr+1,'>');
! 30: ptr++;
! 31: ptr1 = strchr(ptr,'<');
! 32: *ptr1 = 0;
! 33: printf("<LI><OBJECT type=\"text/sitemap\">\n");
! 34: printf("<param name=\"Name\" value=\"%s\">\n",ptr);
! 35: printf("<param name=\"Local\" value=\"html\\%s\">\n",fname);
! 36: printf("</OBJECT>\n");
! 37: }
1.1 noro 38: }
1.2 ! noro 39: printf("</UL>\n</BODY></HTML>\n");
1.1 noro 40: }
41:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>