home *** CD-ROM | disk | FTP | other *** search
-
- /* (c)Copyright Sequiter Software Inc., 1987-1990. All rights reserved.
-
- d4buf_calc()
- */
-
- #include "d4all.h"
-
- extern BASE *v4base ;
- extern int v4cur_base ;
-
-
- int d4buf_calc()
- {
- int rc, ref_may_lend, base_on ;
- BASE *base_ptr ;
-
- d4buf_reset() ;
- ref_may_lend = -1 ;
- rc = 0 ;
-
- for ( base_on = h4first( (char **) &v4base, v4cur_base); base_on >= 0;
- base_on = base_ptr->next )
- {
- base_ptr = v4base + base_on ;
-
- if ( base_ptr->rec_tot <= 0L ) continue ;
-
- if ( ref_may_lend < 0 )
- if ( base_ptr->buf_may_lend )
- {
- ref_may_lend = base_on ;
- d4buf_sub_set() ; /* Specify lend position. */
- }
-
- base_ptr->buf_ptr = (char H_PTR) d4buf_alloc( base_ptr->rec_tot* base_ptr->buffer_len, 1 ) ;
- if ( base_ptr->buf_ptr == (char H_PTR) 0 )
- {
- base_ptr->n_bufs = 0 ;
- base_ptr->buf_status = 0 ;
- rc = 1 ;
- }
- }
-
- if ( ref_may_lend < 0 )
- d4buf_sub_set() ;
-
- return rc ;
- }
-
-
-
-