
Only in fastadg: subgetaa.c

diff -bwrc fasta20x3/altlib.h fastadg/altlib.h
*** fasta20x3/altlib.h	Sat Sep  2 18:52:54 1995
--- fastadg/altlib.h	Tue Sep  5 09:08:16 1995
***************
*** 1,4 ****
--- 1,6 ----
  
+ #define SUBSETLIB  /* addition for searching subsets of databanks, dgg */
+ 
  #ifdef UNIX
  #define NCBIBL13 11
  #define LASTLIB NCBIBL13+1
***************
*** 14,19 ****
--- 16,27 ----
  #define VMSPIR 5
  #define LASTTXT 5
  
+ #ifdef SUBSETLIB
+ #define SUBLIB  12
+ #undef  LASTLIB  
+ #define LASTLIB SUBLIB+1
+ #endif
+ 
  extern int (*getlib)(), (*ranlib)();
  
  int agetlib(),aranlib();	/* pearson fasta format */
***************
*** 22,32 ****
--- 30,45 ----
  int egetlib(),eranlib();	/* EMBL/SWISS-PROT EMBLSWISS */
  int igetlib(),iranlib();	/* Intelligenetics INTELLIG */
  int vgetlib(),vranlib();	/* PIR VMS format */
+ #ifdef SUBSETLIB
+ int subset_getlib(),subset_ranlib();	/* Subset indices into libraries format */
+ #endif  
  
  #ifdef BIGMEM
  extern int ncbl_getliba(), ncbl_ranlib(); /* ncbi blast 1.3 format */
  #endif
  
+ #ifndef XTERNAL
+ 
  int (*getliba[LASTLIB])()={
  	agetlib,lgetlib,pgetlib,egetlib,
  	igetlib,vgetlib,agetlib,agetlib,
***************
*** 34,39 ****
--- 47,58 ----
  #ifdef NCBIBL13
  	,agetlib,ncbl_getliba
  #endif
+ #ifdef SUBSETLIB
+ #ifndef NCBIBL13
+ 	,agetlib,agetlib
+ #endif
+ 	,subset_getlib
+ #endif
          };
          
  int (*ranliba[LASTLIB])()={
***************
*** 43,47 ****
--- 62,88 ----
  #ifdef NCBIBL13
  	,aranlib,ncbl_ranlib
  #endif
+ #ifdef SUBSETLIB
+ #ifndef NCBIBL13
+ 	,aranlib,aranlib
+ #endif
+ 	,subset_ranlib
+ #endif
          };
+         
+ #else
+ extern int (*getliba[LASTLIB])();
+ extern int (*ranliba[LASTLIB])();
+ #endif
+ 
+ 
+ #ifdef SUBSETLIB
+ #ifndef VMS
+ #define FILEtype FILE*
+ #else
+ #define FILEtype int
+ #endif
+ 
+ FILEtype setlib( FILEtype newlib); /* returns oldlib */ 
+ #endif  /*SUBSETLIB*/
  

diff -bwrc fasta20x3/fffasta.c fastadg/fffasta.c
*** fasta20x3/fffasta.c	Sat Sep  2 18:52:59 1995
--- fastadg/fffasta.c	Sat Sep  9 11:30:34 1995
***************
*** 156,162 ****
  #define RANLIB ranlib
  #endif
  
! char libstr[21];	/* partial title from library sequence */
  char name0[11], name1[11];	/* for labeling output */
  int ixstat;		/* >0 if annotations displayed */
  
--- 156,162 ----
  #define RANLIB ranlib
  #endif
  
! char libstr[81];	/* partial title from library sequence */
  char name0[11], name1[11];	/* for labeling output */
  int ixstat;		/* >0 if annotations displayed */
  
diff -bwrc fasta20x3/nxgetaa.c fastadg/nxgetaa.c
*** fasta20x3/nxgetaa.c	Sat Sep  2 18:53:05 1995
--- fastadg/nxgetaa.c	Tue Sep  5 09:08:17 1995
***************
*** 71,78 ****
--- 71,80 ----
  #include "upam.gbl"
  #undef XTERNAL
  
+ #ifndef TRUE
  #define TRUE 1
  #define FALSE 0
+ #endif
  #define MAXLINE 512
  
  #define MAXR 15
***************
*** 294,299 ****
--- 296,304 ----
  #ifdef NCBIBL13
  	else if (libtype==NCBIBL13) opnflg=(ncbl_openlib(libn)!= -1);
  #endif
+ #ifdef SUBSETLIB
+ 	else if (libtype==SUBLIB) opnflg= subset_openlib(libn);
+ #endif
  
  	if (!opnflg) {
  #else
***************
*** 324,329 ****
--- 329,347 ----
  	return 1;
  	}
  
+ 
+ #ifdef SUBSETLIB
+ FILEtype setlib(FILEtype newlib)
+ {
+ 	/* dgg -- this is just to allow use of the xranlib() functions from
+ 		another code section */
+ 	FILEtype oldlib= libf;
+ 	libf= newlib;
+ 	return oldlib;
+ }
+ #endif
+ 
+ 
  closelib()
  {
    if (libf!=NULL) {
***************
*** 330,335 ****
--- 348,356 ----
      fclose(libf);
      libf = NULL;
    }
+ #ifdef SUBSETLIB
+   subset_closelib();
+ #endif
  }
  
  GETLIB(seq,maxs,libstr,libpos,lcont)


diff -bwrc fasta20x3/Makefile fastadg/Makefile
*** fasta20x3/Makefile	Sat Sep  2 18:52:53 1995
--- fastadg/Makefile	Tue Sep  5 09:17:35 1995
***************
*** 29,39 ****
  clean-up : 
  	rm *.o $(PROGS)
  
! fasta : ifastaf.o pam.o zgmata.o f_band.o l_band.o g_band.o llmax.o scaleswf.o getaa.o ndispn.o ncbl_lib.o time.o 
! 	$(CC) ifastaf.o pam.o zgmata.o scaleswf.o getaa.o ndispn.o ncbl_lib.o time.o f_band.o l_band.o g_band.o llmax.o  $(LFLAGS) fasta
  
! tfasta : tfasta.o faatran.o pam.o zgmata.o f_band.o l_band.o g_band.o llmax.o scaleswf.o tgetaa.o ndispn.o ncbl_lib.o time.o
! 	$(CC) tfasta.o faatran.o pam.o zgmata.o f_band.o l_band.o g_band.o llmax.o scaleswf.o tgetaa.o ndispn.o ncbl_lib.o time.o $(LFLAGS) tfasta
  
  lfasta : lfasta.o pam.o zlgmata.o ll_band.o g_band.o lgetaa.o ndispn.o crck.o time.o
  	$(CC) lfasta.o pam.o zlgmata.o ll_band.o g_band.o lgetaa.o ndispn.o crck.o time.o $(LFLAGS) lfasta
--- 29,39 ----
  clean-up : 
  	rm *.o $(PROGS)
  
! fasta : ifastaf.o pam.o zgmata.o f_band.o l_band.o g_band.o llmax.o scaleswf.o getaa.o subgetaa.o ndispn.o ncbl_lib.o time.o 
! 	$(CC) ifastaf.o pam.o zgmata.o scaleswf.o getaa.o subgetaa.o ndispn.o ncbl_lib.o time.o f_band.o l_band.o g_band.o llmax.o  $(LFLAGS) fasta
  
! tfasta : tfasta.o faatran.o pam.o zgmata.o f_band.o l_band.o g_band.o llmax.o scaleswf.o tgetaa.o subgetaa.o ndispn.o ncbl_lib.o time.o
! 	$(CC) tfasta.o faatran.o pam.o zgmata.o f_band.o l_band.o g_band.o llmax.o scaleswf.o tgetaa.o subgetaa.o ndispn.o ncbl_lib.o time.o $(LFLAGS) tfasta
  
  lfasta : lfasta.o pam.o zlgmata.o ll_band.o g_band.o lgetaa.o ndispn.o crck.o time.o
  	$(CC) lfasta.o pam.o zlgmata.o ll_band.o g_band.o lgetaa.o ndispn.o crck.o time.o $(LFLAGS) lfasta
***************
*** 70,77 ****
  pclalign : plalign.o pam.o plsim.o lgetaa.o pcldispn.o time.o
  	$(CC) plalign.o pam.o plsim.o lgetaa.o pcldispn.o time.o $(LFLAGS) pclalign
  
! ssearch : ssearch.o pam.o sgmata.o llmax.o scalesws.o getaa.o ncbl_lib.o ndispn.o time.o
! 	$(CC) ssearch.o pam.o sgmata.o llmax.o scalesws.o getaa.o ncbl_lib.o ndispn.o time.o $(LFLAGS) ssearch
  
  relate : relate.o pam.o lgetaa.o time.o
  	$(CC) relate.o pam.o lgetaa.o time.o -o relate -lm
--- 70,77 ----
  pclalign : plalign.o pam.o plsim.o lgetaa.o pcldispn.o time.o
  	$(CC) plalign.o pam.o plsim.o lgetaa.o pcldispn.o time.o $(LFLAGS) pclalign
  
! ssearch : ssearch.o pam.o sgmata.o llmax.o scalesws.o getaa.o subgetaa.o ncbl_lib.o ndispn.o time.o
! 	$(CC) ssearch.o pam.o sgmata.o llmax.o scalesws.o getaa.o subgetaa.o ncbl_lib.o ndispn.o time.o $(LFLAGS) ssearch
  
  relate : relate.o pam.o lgetaa.o time.o
  	$(CC) relate.o pam.o lgetaa.o time.o -o relate -lm
***************
*** 181,186 ****
--- 181,190 ----
  getaa.o : nxgetaa.c upam.gbl uascii.gbl altlib.h
  	$(CC) $(CFLAGS) -c nxgetaa.c 
  	mv nxgetaa.o getaa.o
+ 
+ # subgetaa -- dgg added
+ subgetaa.o : subgetaa.c upam.gbl uascii.gbl altlib.h
+ 	$(CC) $(CFLAGS) -c subgetaa.c
    
  lgetaa.o : nxgetaa.c upam.gbl uascii.gbl  altlib.h
  	$(CC) $(CFLAGS) -DNOLIB -c nxgetaa.c
.
