home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c160 / 1.ddi / SOURCE / D4INIT_U.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-11-19  |  1.3 KB  |  67 lines

  1.  
  2. /* d4init_u.c  (c)Copyright Sequiter Software Inc., 1987-1990.  All rights reserved. */
  3.  
  4. #include "d4all.h"
  5. #ifndef NOIO
  6. #include "w4.h"
  7. #endif
  8. #include "h4memory.h"
  9.  
  10. extern int     v4first ;
  11.  
  12. extern BASE   *v4base ;
  13. extern BLOCK  *v4block ;
  14.  
  15. extern X4FILTER *v4filter ;
  16. extern X4RELATE *v4relate ;
  17.  
  18.  
  19. d4init_undo()
  20. {
  21.    if ( v4first )  return 0 ;
  22.  
  23.    v4first =  1 ;
  24.  
  25.    if ( d4close_all() < 0 )  return -1 ;
  26.    if ( d4buf_init(0L,0L,0L) < 0 )  return -1 ;
  27.  
  28.    #ifndef SMALL
  29.    {
  30.       extern char       *v4eval_space ;
  31.       extern INDEX  *v4index ;
  32.  
  33.       h4free_memory( v4eval_space ) ;
  34.       v4eval_space =  (char *) 0 ;
  35.  
  36.       h4free_memory( (char *) v4index - sizeof(MEMORY) ) ;
  37.       v4index =  (INDEX *) 0 ;
  38.    }
  39.    #endif
  40.  
  41.    h4free_memory( (char *) v4base - sizeof(MEMORY) ) ;
  42.    v4base  =  (BASE *) 0 ;
  43.  
  44.    h4free_memory( (char *) v4block - sizeof(MEMORY) ) ;
  45.    v4block =  (BLOCK *) 0 ;
  46.  
  47.    if ( v4filter != (X4FILTER *) 0 )
  48.    {
  49.       h4free_memory( (char *) v4filter - sizeof(MEMORY) ) ;
  50.       v4filter =  (X4FILTER *) 0 ;
  51.    }
  52.  
  53.    if ( v4relate != (X4RELATE *) 0 )
  54.    {
  55.       h4free_memory( (char *) v4relate - sizeof(MEMORY) ) ;
  56.       v4relate =  (X4RELATE *) 0 ;
  57.    }
  58.  
  59.    #ifndef NOIO
  60.       w4init_undo() ;
  61.    #endif
  62.  
  63.    return 0 ;
  64. }
  65.  
  66.  
  67.