Annotation of OpenXM/src/asir-doc/html_tools/conv_toc.c, Revision 1.1
1.1 ! noro 1: #include <stdio.h>
! 2:
! 3: main ()
! 4: {
! 5: int c,c1,i,j;
! 6: char buf[BUFSIZ],fname[BUFSIZ],kname[BUFSIZ];
! 7:
! 8: while ( 1 ) {
! 9: c = getchar();
! 10: if ( c == EOF )
! 11: exit(0);
! 12: if ( c == '<' ) {
! 13: c1 = getchar();
! 14: if ( c1 == 'A' ) {
! 15: fgets(buf,BUFSIZ,stdin);
! 16: for ( i = 0; buf[i] != '='; i++ );
! 17: i++;
! 18: for ( ; buf[i] != '='; i++ );
! 19: i++; i++;
! 20: for ( j = 0; buf[i] != '#'; i++, j++ ) fname[j] = buf[i];
! 21: fname[j] = 0;
! 22: for ( ; buf[i] != '>'; i++ );
! 23: i++;
! 24: if ( buf[i] == '<' ) {
! 25: for ( ; buf[i] != '>'; i++ );
! 26: i++;
! 27: }
! 28: for ( j = 0; buf[i] != '<'; i++, j++ ) kname[j] = buf[i];
! 29: kname[j] = 0;
! 30: printf("<OBJECT type=\"text/sitemap\">\n");
! 31: printf("<param name=\"Name\" value=\"%s\">\n",kname);
! 32: printf("<param name=\"Local\" value=\"html\\%s\">\n",fname);
! 33: printf("</OBJECT>\n");
! 34: } else {
! 35: putchar(c);
! 36: putchar(c1);
! 37: do putchar(c=getchar()); while ( c != '>' );
! 38: }
! 39: } else putchar(c);
! 40: }
! 41: }
! 42:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>