


LDLREAD(3X)      MISCELLANEOUS LIBRARY FUNCTIONS      LDLREAD(3X)



NAME
     ldlread, ldlinit, ldlitem - manipulate line  number  entries
     of a COFF file function

SYNOPSIS
     #include <stdio.h>
     #include <filehdr.h>
     #include <linenum.h>
     #include <ldfcn.h>

     int ldlread(ldptr, fcnindx, linenum, linent)
     LDFILE *ldptr;
     long fcnindx;
     unsigned short linenum;
     LINENO *linent;

     int ldlinit(ldptr, fcnindx)
     LDFILE *ldptr;
     long fcnindx;

     int ldlitem(ldptr, linenum, linent)
     LDFILE *ldptr;
     unsigned short linenum;
     LINENO *linent;

AVAILABILITY
     Available only on Sun 386i systems  running  a  SunOS  4.0._x
     release or earlier.  Not a SunOS 4.1 release feature.

DESCRIPTION
     ldlread() searches the line number entries of the COFF  file
     currently  associated  with  _l_d_p_t_r.   ldlread()  begins  its
     search with the line number entry for  the  beginning  of  a
     function and confines its search to the line numbers associ-
     ated with a single function.  The function is identified  by
     _f_c_n_i_n_d_x,  the  index  of its entry in the object file symbol
     table.  ldlread() reads the entry  with  the  smallest  line
     number  equal  to  or  greater  than _l_i_n_e_n_u_m into the memory
     beginning at _l_i_n_e_n_t.

     ldlinit() and ldlitem() together perform  exactly  the  same
     function  as  ldlread().  After an initial call to ldlread()
     or ldlinit(), ldlitem() may be used to retrieve a series  of
     line  number  entries  associated  with  a  single function.
     ldlinit() simply locates the line  number  entries  for  the
     function  identified  by  _f_c_n_i_n_d_x. ldlitem() finds and reads
     the entry with the smallest line number equal to or  greater
     than _l_i_n_e_n_u_m into the memory beginning at linent().

     ldlread(), ldlinit(), and ldlitem() each return either  SUC-
     CESS  or  FAILURE.  ldlread() will fail if there are no line
     number entries in the object file, if _f_c_n_i_n_d_x does not index



Sun Release 4.1   Last change: 19 February 1988                 1






LDLREAD(3X)      MISCELLANEOUS LIBRARY FUNCTIONS      LDLREAD(3X)



     a function entry in the symbol table, or if it finds no line
     number equal to or greater  than  _l_i_n_e_n_u_m.   ldlinit()  will
     fail  if there are no line number entries in the object file
     or if _f_c_n_i_n_d_x does not index a function entry in the  symbol
     table.  ldlitem() will fail if it finds no line number equal
     to or greater than _l_i_n_e_n_u_m.

     The programs must be loaded with the object file access rou-
     tine library libld.a.

SEE ALSO
     ldclose(3X), ldfcn(3), ldopen(3X), ldtbindex(3X)











































Sun Release 4.1   Last change: 19 February 1988                 2



