Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ldaopen(3x) [ultrix man page]

ldopen(3x)																ldopen(3x)

Name
       ldopen, ldaopen, ldreadst - open a common object file for reading

Syntax
       #include <stdio.h>
       #include <filehdr.h>
       #include <syms.h>
       #include <ldfcn.h>

       LDFILE *ldopen (filename, ldptr)
       char *filename;
       LDFILE *ldptr;

       LDFILE *ldaopen (filename, oldptr)
       char *filename;
       LDFILE *oldptr;

       ldreadst (ldptr, flags)
       LDFILE *ldptr;
       intflags;

Description
       The  and functions provide uniform access to simple object files and to object files that are members of archive files.	An archive of com-
       mon object files can be processed as if it is a series of simple common object files.

       If ldptr has the value null, opens filename, allocates and initializes the LDFILE structure, and returns a pointer to the structure to  the
       calling program.

       If ldptr is valid and TYPE(ldptr) is the archive magic number, reinitializes the LDFILE structure for the next archive member of filename.

       The  and  functions work in concert.  The function returns failure only when only when TYPE(ldptr) is the archive magic number and there is
       another file in the archive to be processed.  Only then should be called with the current value of ldptr.  In all other	cases,	but  espe-
       cially when a new filename is opened, should be called with a null ldptr argument.

       The following is a prototype for the use of and
       /* for each filename to be processed*/

       ldptr = NULL;
       do
	    if ( (ldptr = ldopen(filename, ldptr)) != NULL )

	    {
		 /* check magic number */
		 /* process the file */
	    }
       } while (ldclose(ldptr) == FAILURE );

       If  the	value  of  oldptr  is  not NULL, opens filename anew and allocates and initializes a new LDFILE structure, copying the fields from
       oldptr.	The function returns a pointer to the new LDFILE structure.  This new pointer is independent of the old pointer, oldptr.  The  two
       pointers  can  be  used	concurrently to read separate parts of the object file.  For example, one pointer can be used to step sequentially
       through the relocation information while the other is used to read indexed symbol table entries.

       The and functions open filename for reading.  If filename cannot be opened or if memory for the LDFILE structure cannot be allocated,  both
       functions return NULL.  A successful open does not ensure that the given file is a common object file or an archived object file.

       The  function  causes  the symbol table header and file descriptor table to be read.  Further access, using ldptr, causes other appropriate
       sections of the symbol table to be read (for example, if you call the symbols or externals are read).  To force sections  for  each  symbol
       table in memory, call with ST_P* constants or'ed together from st_support.h.

See Also
       fopen(3s), ldclose(3x), ldfcn(5)

								       RISC								ldopen(3x)

Check Out this Related Man Page

ldlread(3x)															       ldlread(3x)

Name
       ldlread, ldlinit, ldlitem - manipulate line number entries of a common object file function

Syntax
       #include <stdio.h>
       #include <filehdr.h>
       #include <syms.h>
       #include <ldfcn.h>

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

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

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

Description
       The  function  searches	the line number entries of the common object file currently associated with ldptr.  The function begins its search
       with the line number entry for the beginning of a function and confines its search to the line numbers associated with a  single  function.
       The  function  is identified by fcnindx, which is the index of its local symbols entry in the object file symbol table.	The function reads
       the entry with the smallest line number equal to or greater than linenum into linent.

       The and functions provide the same behavior as After an initial call to or can be used to retrieve a series of line number entries  associ-
       ated with a single function.  The function simply finds the line number entries for the function identified by fcnindx.	The function finds
       and reads the entry with the smallest line number equal to or greater than linenum into linent.

       The functions and each return either success or failure.  The function fails if one of the following occurs:

       o    If line number entries do not exist in the object file.

       o    If fcnindx does not index a function entry in the symbol table.

       o    If it does not find a line number equal to or greater than linenum.

       The fails if it does not find a line number equal to or greater than linenum.

See Also
       ldclose(3x), ldopen(3x), ldtbindex(3x), ldfcn(5)

								       RISC							       ldlread(3x)
Man Page