Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ldclose(3x)

ldopen(3x)

ldtbindex(3x)

ldfcn(5)

ldlread(3x)  —  RISC

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 ldlread function searches the line number entries of the common object file currently associated with ldptr. The ldlread 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 ldlread function reads the entry with the smallest line number equal to or greater than linenum into linent.

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

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

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

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

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

The ldlitem 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)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026