Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ nlist(3C) — HP-UX 5.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

a.out(5)

nlist(5)

NLIST(3C)

NAME

nlist − get entries from name list

SYNOPSIS

#include <nlist.h>

int nlist (file-name, nl)
char ∗file-name;
struct nlist ∗nl;

HP-UX COMPATIBILITY

Level: HP-UX/STANDARD

Origin: System V

Remarks:

Nlist is currently implemented on the Series 200 and the Integral PC only. 

The use of symbol table type and value information is inherently non-portable.  Use of nlist should reduce the effort required to port a program which uses such information, but complete portability across all implementations of HP−UX cannot be expected. 

DESCRIPTION

Nlist examines the name list in the executable file whose name is pointed to by file-name, and selectively extracts a list of values and puts them in the array of nlist structures pointed to by nl. The name list nl consists of an array of structures initially containing names of variables; once nlist has been called, the information is augmented with types and values.  The list is terminated with a null name; that is, a null string is in the name position of the structure.  Each variable name is looked up in the name list of the file.  If the name is found, the type and value information is inserted into the structure.  If the name is not found, the type and value fields are set to zero.  The structure nlist is defined in the include file nlist.h.  See a.out(5) and nlist(5) for more discussion of the symbol table structure.

The file must have the organization and symbol table described for an a.out file in a.out.h(5). The information is extracted from the symbol table used by the link editor, ld(1).

The list of names provided by the caller is in an array of structures, each containing a pointer to a string giving the name for which information is desired.  The rest of the structure contains a type field, a value field, and possibly other machine specific information which will be filled in by the nlist call.  The list is terminated with a null name pointer.  The structure updated by this call is described in nlist(5). The name pointer in the nlist structure will always be the first field regardless of how the other fields may change across implementations.

On machines which have such a file, this subroutine is useful for examining the system name list kept in the file /hp-ux.  In this way programs can obtain system addresses that are up to date. 

NOTES

The <nlist.h> header file is automatically included by <a.out.h> for compatability.  However, if the only information needed from <a.out.h> is for use of nlist, then including <a.out.h> is discouraged. 

SEE ALSO

a.out(5), nlist(5). 

DIAGNOSTICS

All nlist structure fields are set to 0 if the file cannot be found or if it is not a valid object file containing a linker symbol table. 

Nlist returns −1 upon error; otherwise it returns 0. 

Hewlett-Packard  —  last mod. May 11, 2021

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