[BACK]Return to oxweave.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / util

Diff for /OpenXM/src/util/oxweave.c between version 1.3 and 1.4

version 1.3, 2005/07/03 08:27:38 version 1.4, 2013/08/31 08:16:02
Line 15 
Line 15 
 \section{$BA0=q$-(B}  \section{$BA0=q$-(B}
 */  */
 /* OpenXM: OpenXM/src/kxx/oxweave.c,v 1.7 2001/05/06 07:53:01 takayama Exp  /* OpenXM: OpenXM/src/kxx/oxweave.c,v 1.7 2001/05/06 07:53:01 takayama Exp
    $OpenXM: OpenXM/src/util/oxweave.c,v 1.2 2003/08/22 16:08:23 ohara Exp $     $OpenXM: OpenXM/src/util/oxweave.c,v 1.3 2005/07/03 08:27:38 ohara Exp $
  */   */
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
Line 23 
Line 23 
   
 void usage();  void usage();
 void findEndTag(int tagc,char *tagv[],int rule);  void findEndTag(int tagc,char *tagv[],int rule);
   int findNextTag(int tagc, char *tagv[],int tagc2,char *tagv2[]);
 void skipToEndTag(int tagc,char *tagv[],int rule);  void skipToEndTag(int tagc,char *tagv[],int rule);
   int notEOF();
   void irregularExit();
   int wcmp(char *s);
   
 /* Modify here to change the begin tag and EndComment. Less than 9 characters.  /* Modify here to change the begin tag and EndComment. Less than 9 characters.
 */  */
Line 66  int OutputtingTaggedSegment = 0;
Line 70  int OutputtingTaggedSegment = 0;
 int BeginVerbatim = 0;  int BeginVerbatim = 0;
   
 /*&jp \section{$B%W%m%0%i%`K\BN(B} */  /*&jp \section{$B%W%m%0%i%`K\BN(B} */
   int
 main(int argc,char *argv[]) {  main(int argc,char *argv[]) {
   extern char *EndComment0;    extern char *EndComment0;
   extern char *EndComment1;    extern char *EndComment1;
Line 155  void usage() {
Line 160  void usage() {
 #define inc(a) ((a+1) % BSIZE)  #define inc(a) ((a+1) % BSIZE)
 /*&jp \noindent {\tt wread()} $B$O(B $BI8=`F~NO$h$j$N%G!<%?$rFI$a$k$@$1(B  /*&jp \noindent {\tt wread()} $B$O(B $BI8=`F~NO$h$j$N%G!<%?$rFI$a$k$@$1(B
 $B%j%s%0%P%C%U%!(B {\tt Buf} $B$XFI$_9~$`(B.*/  $B%j%s%0%P%C%U%!(B {\tt Buf} $B$XFI$_9~$`(B.*/
   int
 wread() {  wread() {
   int c,i;    int c,i;
   static int eof = 0;    static int eof = 0;
Line 198  int wgetc(int p) {
Line 204  int wgetc(int p) {
   $BL5;k$9$Y$-%?%0$N$H$-$O(B, $B%?%0FbIt$r%9%-%C%W$7$?$N$A(B    $BL5;k$9$Y$-%?%0$N$H$-$O(B, $B%?%0FbIt$r%9%-%C%W$7$?$N$A(B
   {\tt findNextTag} $B$r:F5"E*$K8F$V(B.    {\tt findNextTag} $B$r:F5"E*$K8F$V(B.
   */    */
   int
 findNextTag(int tagc, char *tagv[],int tagc2,char *tagv2[]) {  findNextTag(int tagc, char *tagv[],int tagc2,char *tagv2[]) {
   int i;    int i;
   int c,d;    int c,d;
Line 264  void findEndTag(int tagc,char *tagv[],int rule) {
Line 271  void findEndTag(int tagc,char *tagv[],int rule) {
       if (LevelState1 > 0 && Recursive) {        if (LevelState1 > 0 && Recursive) {
         wgetc(strlen(tagv[i]));          wgetc(strlen(tagv[i]));
         printf("%s",tagv[i]);          printf("%s",tagv[i]);
         return(findEndTag(tagc,tagv,rule));                  findEndTag(tagc,tagv,rule);
           return;
       }else{        }else{
         wgetc(strlen(tagv[i]));          wgetc(strlen(tagv[i]));
         if (strcmp(tagv[i],"\n")==0) putchar('\n');          if (strcmp(tagv[i],"\n")==0) putchar('\n');
Line 300  void skipToEndTag(int tagc,char *tagv[],int rule) {
Line 308  void skipToEndTag(int tagc,char *tagv[],int rule) {
         LevelState2--;          LevelState2--;
         if (LevelState2 > 0 && Recursive) {          if (LevelState2 > 0 && Recursive) {
           wgetc(strlen(EndComment0));            wgetc(strlen(EndComment0));
           return(skipToEndTag(tagc,tagv,rule));            skipToEndTag(tagc,tagv,rule);
             return;
         }else{          }else{
           wgetc(strlen(EndComment0));            wgetc(strlen(EndComment0));
           return;  /* our state is 0. */            return;  /* our state is 0. */
Line 311  void skipToEndTag(int tagc,char *tagv[],int rule) {
Line 320  void skipToEndTag(int tagc,char *tagv[],int rule) {
         LevelState2--;          LevelState2--;
         if (LevelState2 > 0 && Recursive) {          if (LevelState2 > 0 && Recursive) {
           wgetc(strlen(EndComment0));            wgetc(strlen(EndComment0));
           return(skipToEndTag(tagc,tagv,rule));            skipToEndTag(tagc,tagv,rule);
             return;
         }else{          }else{
           wgetc(strlen(EndComment1));            wgetc(strlen(EndComment1));
           return;  /* our state is 0. */            return;  /* our state is 0. */
Line 323  void skipToEndTag(int tagc,char *tagv[],int rule) {
Line 333  void skipToEndTag(int tagc,char *tagv[],int rule) {
           LevelState2--;            LevelState2--;
           if (LevelState2 > 0 && Recursive) {            if (LevelState2 > 0 && Recursive) {
             wgetc(strlen(EndComment0));              wgetc(strlen(EndComment0));
             return(skipToEndTag(tagc,tagv,rule));              skipToEndTag(tagc,tagv,rule);
               return;
           }else{            }else{
             wgetc(strlen(tagv[i]));              wgetc(strlen(tagv[i]));
             return;  /* our state is 0. */              return;  /* our state is 0. */
Line 350  void skipToEndTag(int tagc,char *tagv[],int rule) {
Line 361  void skipToEndTag(int tagc,char *tagv[],int rule) {
 {\tt s} $B$,(B 0xa,0 $B$N$H$-$O(B, Buf[Head] $B$,(B 0xa $B$J$i(B, 0 $B$rLa$9(B.  {\tt s} $B$,(B 0xa,0 $B$N$H$-$O(B, Buf[Head] $B$,(B 0xa $B$J$i(B, 0 $B$rLa$9(B.
 $B$=$&$G$J$$$J$i(B, -1 $B$rLa$9(B.  $B$=$&$G$J$$$J$i(B, -1 $B$rLa$9(B.
 */  */
   int
 wcmp(char *s) {  wcmp(char *s) {
   int n;    int n;
   int i,j;    int i,j;
Line 371  wcmp(char *s) {
Line 383  wcmp(char *s) {
   } else return(1);    } else return(1);
 }  }
   
   int
 notEOF() {  notEOF() {
   wread();    wread();
   if (Buf[Head] != -1) return(1);    if (Buf[Head] != -1) return(1);
   else return(0);    else return(0);
 }  }
   
   void
 irregularExit() {  irregularExit() {
   if (BeginVerbatim == 1) {    if (BeginVerbatim == 1) {
     if (!Plain) printf("\\end{verbatim\x07d}\n");      if (!Plain) printf("\\end{verbatim\x07d}\n");

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>