

            ldseg$ (6) --- load a SEG runfile into memory            01/06/83


            _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

                 subroutine ldseg$ (rvec, name, len, code)
                 integer rvec (9), name (ARB), len, code

                 Library:  vswtlb (standard Subsystem library)


            _F_u_n_c_t_i_o_n

                 'Ldseg$'  first  attempts  to  open  the  file 'name' in the
                 current directory, using 'len' as the length  of  the  name.
                 If the open is successful, and the file is a SEG run file of
                 recent  (Primos revision 17 or later) origin, 'ldseg$' loads
                 the private segments of the file into memory and sets 'rvec'
                 to the initial save vector of the program.  If the  load  is
                 successful,  'ldseg$'  returns  a  code of 0; otherwise, the
                 Primos error code E$BPAR is returned.


            _I_m_p_l_e_m_e_n_t_a_t_i_o_n

                 'Ldseg$' first opens the segment directory and file 0 in the
                 directory.   Using  calls  to  the  Primos  routine  PRWF$$,
                 'ldseg$'  reads  and  checks the revision flag, segment map,
                 segment bit map, save vector, time vector, and symbol table.
                 Using this information, 'ldseg$' traverses the symbol table,
                 loading  initialized  chunks  of  segments  with  calls   to
                 'chunk$'  and  zeroing  uninitialized segments with calls to
                 'zmem$'.    Completely   uninitialized    segments    remain
                 unmodified.   After  loading  is complete, 'ldseg$' sets the
                 values in 'rvec' and returns with a code of 0.


            _A_r_g_u_m_e_n_t_s _M_o_d_i_f_i_e_d

                 rvec, code


            _C_a_l_l_s

                 chunk$, print, zmem$, Primos errpr$, Primos  srch$$,  Primos
                 prwf$$


            _S_e_e _A_l_s_o

                 call$$ (6)










            ldseg$ (6)                    - 1 -                    ldseg$ (6)


