[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 1

ldlread, ldlinit, or ldlitem Subroutine

Purpose

Manipulates line number entries of a common object file function.

Library

Object File Access Routine Library (libld.a)

Syntax

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

int ldlread (ldPointer, LineNumber, LineEntry)
LDFILE *ldPointer;
long FunctionIndex;
unsigned short LineNumber;
LINENO LineEntry;
 
int ldlinit (ldPointer, FunctionIndex)
LDFILE *ldPointer;
long FunctionIndex;
 
int ldlitem (ldPointer, LineNumber, LineEntry)
LDFILE *ldPointer;
unsigned short LineNumber;
LINENO LineEntry;

Description

The ldlread subroutine searches the line number entries of the common object file currently associated with the ldPointer parameter. The ldlread subroutine 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 the FunctionIndex parameter, the index of its entry in the object file symbol table. The ldlread subroutine reads the entry with the smallest line number equal to or greater than the LineNumber parameter into the memory beginning at the LineEntry parameter.

The ldlinit and ldlitem subroutines perform exactly the same function as the ldlread subroutine. After an initial call to the ldlread or ldlinit subroutine, the ldlitem subroutine may be used to retrieve a series of line number entries associated with a single function. The ldlinit subroutine simply locates the line number entries for the function identified by the FunctionIndex parameter. The ldlitem subroutine finds and reads the entry with the smallest line number equal to or greater than the LineNumber parameter into the memory beginning at the LineEntry parameter.

Parameters

ldPointer Points to the LDFILE structure that was returned as the result of a successful call to the ldopen or ldaopen subroutine.
LineNumber Specifies the index of the first LineNumber parameter entry to be read.
LineEntry Points to a LINENO structure.
FunctionIndex Points to the symbol table index of a function.

Return Values

The ldlread, ldlinit, and ldlitem subroutines return a success or failure value.

Error Codes

The ldlread subroutine fails if there are no line number entries in the object file, if the FunctionIndex parameter does not index a function entry in the symbol table, or if it finds no line number equal to or greater than the LineNumber parameter. The ldlinit subroutine fails if there are no line number entries in the object file or if the FunctionIndex parameter does not index a function entry in the symbol table. The ldlitem subroutine fails if it finds no line number equal to or greater than the LineNumber parameter.

Implementation Specifics

These subroutines are part of Base Operating System (BOS) Runtime.

Related Information

The ldahread subroutine, ldfhread subroutine, ldgetname subroutine, ldshread or ldnshread subroutine, ldtbread subroutine.

Subroutines Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Contents | Glossary | Home | Search ]