*** /tmp_mnt/home/stone/axel/shape/vetags/etags.c [1.0]	Thu Jan 20 20:10:15 1994
--- /tmp_mnt/home/stone/axel/shape/vetags/etags.c [1.1]	Thu Jan 20 20:10:17 1994
***************
*** 22,27 ****
--- 22,30 ----
  #include <stdio.h>
  #include <ctype.h>
  
+ #include <atfs.h>
+ #include <atfstk.h>
+ 
  /* Define the symbol ETAGS to make the program "etags",
   which makes emacs-style tag tables by default.
   Define CTAGS to make the program "ctags" compatible with the usual one.
***************
*** 36,41 ****
--- 39,48 ----
  #endif
  #endif
  
+ #ifndef ETAGS
+ #define ETAGS
+ #endif
+ 
  /* Exit codes for success and failure.  */
  
  #ifdef VMS
***************
*** 49,56 ****
--- 56,67 ----
  #define	reg	register
  #define	logical	char
  
+ #ifndef TRUE
  #define	TRUE	(1)
+ #endif
+ #ifndef FALSE
  #define	FALSE	(0)
+ #endif
  
  #define	iswhite(arg)	(_wht[arg])	/* T if char is white		*/
  #define	begtoken(arg)	(_btk[arg])	/* T if char can start token	*/
***************
*** 188,193 ****
--- 199,206 ----
    eflag = 0;
  #endif
  
+   atBindSetArgv(&ac, &av) ;
+ 
    while (ac > 1 && av[1][0] == '-')
      {
        for (i=1; av[1][i]; i++)
***************
*** 257,262 ****
--- 270,276 ----
        ac--; av++;
      }
  
+ 
    if (ac <= 1)
      {
      usage:
***************
*** 263,269 ****
  #ifdef VMS
        fprintf (stderr, "Usage: %s [-aetwvx] [-f outfile] file ...\n", progname);
  #else
!       fprintf (stderr, "Usage: %s [-BFaetuwvx] [-f outfile] file ...\n", progname);
  #endif
        exit(BAD);
      }
--- 277,283 ----
  #ifdef VMS
        fprintf (stderr, "Usage: %s [-aetwvx] [-f outfile] file ...\n", progname);
  #else
!       fprintf (stderr, "Usage: %s [vbind-options] [-BFaetuwvx] [-f outfile] file ...\n", progname);
  #endif
        exit(BAD);
      }
***************
*** 407,422 ****
  find_entries (file)
       char *file;
  {
!   char *cp;
  
!   if ((inf=fopen(file,"r")) == NULL)
      {
        fprintf (stderr, "%s: ", progname);
!       perror(file);
        return;
      }
!   curfile = savestr(file);
!   cp = rindex(file, '.');
    /* .tex, .aux or .bbl implies LaTeX source code */
    if (cp && (!strcmp (cp + 1, "tex") || !strcmp (cp + 1, "aux")
  	     || !strcmp (cp + 1, "bbl")))
--- 421,443 ----
  find_entries (file)
       char *file;
  {
!   char *cp, *unixfile;
!   Af_key *aso = atBindVersion (file, "");
  
!   if (!aso) {
!     af_perror (file);
!     return;
!   }
! 
!   if ((inf=af_open(aso,"r")) == NULL)
      {
        fprintf (stderr, "%s: ", progname);
!       af_perror(file);
        return;
      }
!   curfile = atRetAttr (aso, AF_ATTBOUND);
!   unixfile = atRetAttr (aso, AF_ATTUNIXNAME);
!   cp = rindex(unixfile, '.');
    /* .tex, .aux or .bbl implies LaTeX source code */
    if (cp && (!strcmp (cp + 1, "tex") || !strcmp (cp + 1, "aux")
  	     || !strcmp (cp + 1, "bbl")))
***************
*** 461,473 ****
      {
        if (PF_funcs(inf) != 0)
  	{
! 	  fclose(inf);
  	  return;
  	}
        rewind(inf);	/* no fortran tags found, try C */
      }
    C_entries();
!   fclose(inf);
  }
  
  /* Nonzero if string STR is composed of digits.  */
--- 482,494 ----
      {
        if (PF_funcs(inf) != 0)
  	{
! 	  af_close(inf);
  	  return;
  	}
        rewind(inf);	/* no fortran tags found, try C */
      }
    C_entries();
!   af_close(inf);
  }
  
  /* Nonzero if string STR is composed of digits.  */
