[BACK]Return to extract_func.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / asir-doc

Diff for /OpenXM/src/asir-doc/extract_func.c between version 1.4 and 1.7

version 1.4, 2006/02/12 08:55:26 version 1.7, 2016/08/29 04:56:58
Line 1 
Line 1 
 /* $OpenXM: OpenXM/src/asir-doc/extract_func.c,v 1.3 2005/02/09 03:25:50 noro Exp $ */  /* $OpenXM: OpenXM/src/asir-doc/extract_func.c,v 1.6 2009/02/22 20:27:25 ohara Exp $ */
   
 #include <stdio.h>  #include <stdio.h>
 #include <string.h>  #include <string.h>
   #include <stdlib.h>
   #include <unistd.h>
   #include <ctype.h>
   #include <sys/stat.h>
   
   #if defined(__MINGW32__)
   #include <io.h>
   #define mkdir(d,m)   ((mkdir)((d)))
   #endif
   
   void create_dir(char *);
   int fname(char *,char **);
   
   int
 main(argc,argv)  main(argc,argv)
 int argc;  int argc;
 char **argv;  char **argv;
Line 67  char **argv;
Line 80  char **argv;
                                 } else                                  } else
                                         fputs(buf1,fp);                                          fputs(buf1,fp);
                         }                          }
                 } else if ( fp )                  } else if ( fp ) {
                         if ( buf[0] == 0x1f ) {                          if ( buf[0] == 0x1f ) {
                                 fclose(fp); fp = 0;                                  fclose(fp); fp = 0;
                                 if ( jis ) {                                  if ( jis ) {
Line 75  char **argv;
Line 88  char **argv;
                                                 fn,fn,fn,fn,fn);                                                  fn,fn,fn,fn,fn);
                                         system(cmd);                                          system(cmd);
                                 }                                  }
                         } else                          } else {
                                 fputs(buf,fp);                                  fputs(buf,fp);
                           }
                   }
         }          }
 }  }
   
 int create_dir(char *fname)  void create_dir(char *fname)
 {  {
         char *p;          char *p;
   
Line 103  char **name;
Line 118  char **name;
   
         if ( *buf != '`' ) {          if ( *buf != '`' ) {
                 /* skip X.X.X if exists */                  /* skip X.X.X if exists */
                 space = index(buf,' ');                  space = strchr(buf,' ');
                 if ( !space ) return 0;                  if ( !space ) return 0;
                 for ( p = buf; p < space; p++ )                  for ( p = buf; p < space; p++ )
                         if ( !isdigit(*p) && *p != '.' ) return 0;                          if ( !isdigit(*p) && *p != '.' ) return 0;
Line 111  char **name;
Line 126  char **name;
         }          }
         i = 0;          i = 0;
         while ( 1 ) {          while ( 1 ) {
                 /* search a back quote */      /* makeinfo v5 outputs 'fname', while makeinfo v4 output `fname' */
                 bquote = index(buf,'`' );                  /* search a (back) quote */
                   bquote = strchr(buf,'`' );
                 if ( !bquote )                  if ( !bquote )
                         return 0;        bquote = strchr(buf,'\'');
         if ( !bquote ) return 0;
                 buf = bquote+1;                  buf = bquote+1;
   
                 /* buf points to a function; search a quote */                  /* buf points to a function; search a quote */
                 quote = index(buf,'\'');                  quote = strchr(buf,'\'');
                 if ( !quote )                  if ( !quote )
                         return 0;                          return 0;
                 len = quote-buf;                  len = quote-buf;
Line 128  char **name;
Line 145  char **name;
                 i++;                  i++;
                 buf = quote+1;                  buf = quote+1;
                 /* buf points to ',' or a space char; search a comma */                  /* buf points to ',' or a space char; search a comma */
                 comma = index(buf,',');                  comma = strchr(buf,',');
                 if ( !comma ) {                  if ( !comma ) {
                         /* if the rest chars include a non-space char, then return 0 */                          /* if the rest chars include a non-space char, then return 0 */
                         while ( *buf && isspace(*buf) ) buf++;                          while ( *buf && isspace(*buf) ) buf++;

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

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